how to sum all the frames in each dicom image and all the dicom images to form the volume
Mostrar comentarios más antiguos
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),[]);
1 comentario
Star Strider
el 27 de Nov. de 2016
Please learn to use the ‘[{}Code]’ button to format your code.
Respuestas (0)
Categorías
Más información sobre DICOM Format en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!