이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
i wanted to read .dcm files for my project from a folder
조회 수: 16 (최근 30일)
이전 댓글 표시
can anyone give me code to read the dicom files from folder and
X = repmat(int16(0), [128 128 1 200]);
dicomFiles = dir('E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\*.dcm');
y=length(dicomFiles)
% Read the series of images.
for p=1:y
%filename = sprintf('IM_%01d.dcm', p);
X(:,:,1,p) = dicomread(dicomFiles);
end
% Display the image stack.
montage(X,[])
채택된 답변
Walter Roberson
2016년 11월 14일
projectdir = 'E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002';
dicomFiles = dir( fullfile(projectdir, '*.dcm' ));
y = length(dicomFiles)
X = zeros(128, 128, 1, y, 'uint8');
% Read the series of images.
for p=1:y
filename = fullfile( projectdir, dicomFiles(p).name );
X(:,:,1,p) = dicomread(filename);
end
% Display the image stack.
montage(X,[])
댓글 수: 14
andhavarapu lokesh
2016년 11월 14일
thank you very much sir but iam still getting this error Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Error in rep (line 10) X(:,:,1,p) = dicomread(filename);
Walter Roberson
2016년 11월 14일
The below will probably emit some messages, but we will need to know the sizes that it reports.
projectdir = 'E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002';
dicomFiles = dir( fullfile(projectdir, '*.dcm' ));
y = length(dicomFiles)
X = zeros(128, 128, 1, y, 'uint8');
% Read the series of images.
for p=1:y
filename = fullfile( projectdir, dicomFiles(p).name );
imdata = dicomread(filename);
imsize = size(imdata);
if ~isequal( imsize, [128 128] )
fprintf('file is unexpected size %s instead of [128 128], skipping "%s"\n', mat2str(imsize), filename);
else
X(:,:,1,p) = imdata;
end
% Display the image stack.
montage(X,[])
andhavarapu lokesh
2016년 11월 14일
편집: Walter Roberson
2016년 11월 14일
>> Untitled7
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_1.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_10.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_100.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_101.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_102.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_103.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_104.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_105.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_106.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_107.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_108.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_109.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_11.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_110.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_111.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_112.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_113.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_114.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_115.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_116.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_117.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_118.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_119.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_12.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_120.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_121.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_122.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_123.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_124.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_125.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_126.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_127.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_128.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_129.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_13.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_130.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_131.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_132.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_133.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_134.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_135.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_136.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_137.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_138.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_139.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_14.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_140.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_141.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_142.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_143.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_145.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_15.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_16.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_17.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_18.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_19.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_2.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_20.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_21.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_22.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_23.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_24.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_25.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_26.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_27.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_28.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_29.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_3.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_30.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_31.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_32.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_33.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_34.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_35.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_36.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_37.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_38.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_39.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_4.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_40.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_41.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_42.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_43.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_44.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_45.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_46.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_47.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_48.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_49.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_5.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_50.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_51.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_52.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_53.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_54.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_55.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_56.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_57.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_58.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_59.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_6.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_60.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_61.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_62.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_63.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_64.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_65.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_66.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_67.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_68.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_69.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_7.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_70.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_71.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_72.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_73.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_74.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_75.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_76.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_77.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_78.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_79.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_8.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_80.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_81.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_82.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_83.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_84.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_85.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_86.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_87.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_88.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_89.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_9.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_90.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_91.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_92.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_93.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_94.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_95.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_96.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_97.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_98.dcm"
file is unexpected size [128 128 1 72] instead of [128 128], skipping "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_99.dcm"
Warning: Image is too big to fit on screen; displaying at 50%
> In images.internal.initSize (line 71)
In imshow (line 305)
In montage (line 152)
In Untitled7 (line 16)
sir it is running but iam gettig only empty figure with black image
Walter Roberson
2016년 11월 14일
You have a problem. Each of the .dcm files has 72 slices stored in it. You can represent any one of them in 3D, but you would need to add another dimension to represent the series of 200 of them, such as if you were to use animation for them.
projectdir = 'E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002';
y = 200;
X = zeros(128, 128, 1, 72, y, 'uint8');
% Read the series of images.
for p=1:y
thisfile = sprintf('%d.dcm', p);
filename = fullfile( projectdir, thisfile );
imdata = dicomread(filename);
imsize = size(imdata);
if ~isequal( imsize, [128 128 1 72] )
fprintf('file is unexpected size %s instead of [128 128 1 72], skipping "%s"\n', mat2str(imsize), filename);
else
X(:, :, :, :, p) = imdata;
end
figure();
% Display the first image stack.
montage(X(:,:,:,:,1), [])
axis image
title('First file, all layers')
figure();
% Display the first layer of all of the stacks
montage( permute( X(:, :, :, 1, :), [1 2 3 5 4]) )
title('First layer of all files')
andhavarapu lokesh
2016년 11월 14일
Error using dicomread>getFileDetails (line 1426) File "E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002\IM_144.dcm" not found.
Error in dicomread>newDicomread (line 172) fileDetails = getFileDetails(filename);
Error in dicomread (line 79) [X, map, alpha, overlays] = newDicomread(msgname, frames);
Error in Untitled7 (line 8) imdata = dicomread(filename); still iam getting error
Walter Roberson
2016년 11월 14일
projectdir = 'E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002';
dicomFiles = dir( fullfile(projectdir, '*.dcm' ));
y = length(dicomFiles);
fnums = zeros(1,y);
for p = 1 : y
[~, basename, ~] = fileparts(dicomFiles(p).name);
fnums(p) = str2num(basename);
end
fnums = unique(fnums);
y = length(fnums);
X = zeros(128, 128, 1, 72, y, 'uint8');
% Read the series of images.
for p=1:y
thisfile = sprintf('%d.dcm', fnums(p));
filename = fullfile( projectdir, thisfile );
imdata = dicomread(filename);
imsize = size(imdata);
if ~isequal( imsize, [128 128 1 72] )
fprintf('file is unexpected size %s instead of [128 128 1 72], skipping "%s"\n', mat2str(imsize), filename);
else
X(:, :, :, :, p) = imdata;
end
figure();
% Display the first image stack.
montage(X(:,:,:,:,1), [])
axis image
title('First file, all layers')
figure();
% Display the first layer of all of the stacks
montage( permute( X(:, :, :, 1, :), [1 2 3 5 4]) )
title('First layer of all files')
fprintf('%d files loaded into X, with 72 slices each\n', y);
fprintf('You cannot meaningfully view everything together.\n');
fprintf('I do not know what you hope to be able to do with all of this images, but you have them now.\n');
andhavarapu lokesh
2016년 11월 14일
In an assignment A(I) = B, the number of elements in B and I must be the same.
Error in Untitled8 (line 7) fnums(p) = str2num('basename');
Walter Roberson
2016년 11월 14일
I said
fnums(p) = str2num(basename);
not
fnums(p) = str2num('basename');
andhavarapu lokesh
2016년 11월 16일
편집: Walter Roberson
2016년 11월 16일
projectdir = 'E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002';
y = 15;
X = zeros(128, 128, 1, 72, y, 'uint8');
% Read the series of images.
for p=1:y
thisfile = sprintf('IM_%1d.dcm', p);
filename = fullfile( projectdir, thisfile );
imdata = dicomread(filename);
imsize = size(imdata);
if ~isequal( imsize, [128 128 1 72] )
fprintf('file is unexpected size %s instead of [128 128 1 72], skipping "%s"\n', mat2str(imsize), filename);
else
X(:, :, :, :, p) = imdata;
end
end
figure();
% Display the first image stack.
z=montage(X(:,:,:,:,p), []);
axis image
title('First file, all layers')
figure();
% Display the first layer of all of the stacks
montage( permute( X(:, :, :, 1, :), [1 2 3 5 4]) )
title('First layer of all files')
sir still iam not able to read a single slice from 72 slice of each dicom image
andhavarapu lokesh
2016년 11월 25일
sir after reading the images i wanted to do volume rendering for the above code how to do please can you give me any code where i need to do find the leftventricle ejection fraction by calculating the end sistole and diastole volumes
Walter Roberson
2016년 11월 25일
I suggest you get vol3d v2 from the file exchange to do the volume rendering on each squeeze(X(:, :, :, :, p))
I do not know anything about calculating volume fraction or isolating ventricles. I always fainted when they did the heart rendering where I worked.
추가 답변 (1개)
Mostafa Hussien
2020년 2월 18일
i have a folder its name Brain-Tumor-Progressionon Desktop its dicom file how can i read a file insid this folder called PGBM-001 please answer
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)