How to read and show multiple dicom images?

49 views (last 30 days)
Arathy Das
Arathy Das on 28 Jan 2017
Commented: Walter Roberson on 31 Dec 2020
Can anyone help me to read and show multiple dicom images from a folder...
dicomlist = dir(fullfile(pwd,'Images','*.dcm'));
for cnt = 1 : numel(dicomlist)
I{cnt} = dicomread(fullfile(pwd,'Images',dicomlist(cnt).name));
end
I have tried this code but it is not working... Please help me
  6 Comments
Walter Roberson
Walter Roberson on 31 Dec 2020
foldername = 'Images_patient001';
dicomlist = dir(fullfile(foldername,'*.dcm'));
for cnt = 1 : numel(dicomlist)
thisfile = fullfile(foldername, dicomlist(i).name);
I{cnt} = dicomread(thisfile);
end
I3D = cat(ndims(I{1})+1, I{:});

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 31 Dec 2020
foldername = 'Images';
dicomlist = dir(fullfile(foldername,'*.dcm'));
for cnt = 1 : numel(dicomlist)
thisfile = fullfile(foldername, dicomlist(i).name);
I{cnt} = dicomread(thisfile);
end

Categories

Find more on DICOM Format in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by