How can I display multiple DICOM images on Matlab?

3 views (last 30 days)
I am trying to display multiple DICOM images at once. I have the dicom images in a folder called 'patient1scans'. It contains 133 images. I eventually want to try to display 10-20 images per page at a time, but I want to first figure out how to display all of them. I have tried using the code below but it keeps saying "undefined functions or variable 'nume1'. and error in 'for i = 1: nume1(files)'. I'm not sure if using subplot would be the best thing to do, or is there a better way? Please help. Thank you in advance.
files = dir(fullfile(pwd,'patient1scans\*.dcm'));
for i = 1: nume1(files)
[X, map] = dicomread(fullfile(pwd,'patient1scans',files(i).name));
if ~isempty(map)
subplot(2,2,i);
subimage(X,map);
else
subplot(2,2,i);
imshow(X,[]);
end
end
  1 Comment
Karl Largo
Karl Largo on 26 Oct 2015
I was able to get the code above to work. If I change the numbers in the subplot function, I can change how many images are gonna be displayed. However, when I try to change it to subplot(12,12,i) , it takes a really long time for it to run and display the images ( i changed it to 12 because 12 x 12 = 144, and Im trying to display 133 images.). Is there a way to display 20 images at once per page and then have some kind of next page function to show the next 20 images? thank you in advance.

Sign in to comment.

Answers (0)

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!