how to sum all the frames in each dicom image and all the dicom images to form the volume

조회 수: 3 (최근 30일)
an any one help me how to do this I has 72 dicom images in a folder each dicom image has 72 frames. I wanted to aggreagate all frames of all dicom images to form a volume c
projectdir = 'E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002';
% y = length(projectdir);
y = 72;
Odd = zeros(128, 128, 1, 72, y, 'uint8');
Even = zeros(128, 128, 1, 72, y, 'uint8');
% Read the series of images.
for p=1:y
thisfile = sprintf('IM_%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
Odd(:, :, :, :,p) = imdata;
% Even(:, :, :, :, :,p+1)=imdata;
end
% end
end
figure();
% Display the first image stack.
z=montage(Odd(:,:,:,:,1),[]);

답변 (0개)

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by