2
votes

I want to show a stack of dicom files. I already have the code that loads the images, but i get an warning saying

Warning: Image is too big to fit on screen; displaying at 67% 
> In imuitools\private\initSize at 71
  In imshow at 282
  In montage at 147
  In dicom at 11 

If you know how to fix this please let me know.

Here is my code:

% Preallocate the 256-by-256-by-1-by-20 image array.
X = repmat(uint16(0), [256 256 1 20]);

% Read the series of images.
for p=1:20
   filename = sprintf('brain_%03d.dcm', p);
   X(:,:,1,p) = dicomread(filename);
end

% Display the image stack.
montage(X,[])
1
What kind of fix are you thinking of? If the combined display is to large for your screen, then it is too large... Please be more precise in what you want to achieve.A. Donda
Hi, I tried it but I'm getting a black output screen! Do you know why?Mariam

1 Answers

0
votes

The imshow function is very limited in its ability to rescale images, and suffers from some aliasing problems. To work around this, you can rescale your images using imresize prior to the call to imshow.

I had a lot of difficulty with imshow and the underlying image function, so I wrote a wrapper class that dynamically resizes images to fit the figure window. It is called RViewer, and it is a drop in replacement for image: http://www.mathworks.com/matlabcentral/fileexchange/46051-rviewer