MATLAB Answers

0

how to read all and form a single composite image

Asked by andhavarapu lokesh on 20 Jan 2017
i want to read a dicom file which is 4D having 63 frames out of which i need to get a composite image leaving the first 61,62 frames can any one tell me how to read the dicom image and get only composite image like that there are 63dcm files in a folder
if true
projectdir = 'E:\SHIVA BACKUP\THYROID\P1\AJAY BAIRAGY1';
X = zeros(128, 128, 1,63,'uint16');
% Read the series of images.
% for p=1
p=40;
thisfile = sprintf('IM_%d.dcm', p);
filename = fullfile( projectdir, thisfile );
imdata = dicomread(filename);
imsize = size(imdata);
if ~isequal( imsize, [128 128 1 63] )
fprintf('file is unexpected size %s instead of [128 128 1 72], skipping "%s"\n', mat2str(imsize), filename);
else
X(:, :,1,p) = imdata;
end
figure();
s= montage(X(:,:,1,p), [0 65000 ]);
end

  0 Comments

Sign in to comment.

Tags

0 Answers