Image is too big to fit on screen!!

Hi,
I'm currently working on a project; and I have some uint16 dicom images. But when I try to display these images by using imshow, I get a warning saying that image is too bigto fit on screen, displaying at 73%. I have already tried imresize, imscrollpanel and imagemagnification but I still get full black images.
Any suggestion would help. Thanks

 Respuesta aceptada

Image Analyst
Image Analyst el 12 de Nov. de 2013
Being all black is not related to the warning. The warning merely says that it's shrinking your huge image down so that it will fit into the smaller axes you have. Don't worry about it. If you want to turn that error off, you can - just see this snippet:
% Turn off this warning "Warning: Image is too big to fit on screen; displaying at 33% "
% To set the warning state, you must first know the message identifier for the one warning you want to enable.
% Query the last warning to acquire the identifier. For example:
% warnStruct = warning('query', 'last');
% messageID = warnStruct.identifier
% messageID =
% MATLAB:concatenation:integerInteraction
warning('off', 'Images:initSize:adjustingMag');
What are the max and min values of your array?

7 comentarios

bazinga
bazinga el 12 de Nov. de 2013
Then can you tell me what is it related to?
One of the dicom images' min value is 0 and max value is 21298.
Image Analyst
Image Analyst el 12 de Nov. de 2013
Editada: Image Analyst el 12 de Nov. de 2013
How are you displaying it? Are you doing
imshow(yourImage, []);
Can you attach your script or image?
bazinga
bazinga el 12 de Nov. de 2013
Editada: Image Analyst el 12 de Nov. de 2013
First, I have read the images (20 of them) with dicomread and put them into a 3D matrix, S which has dimensions 576x576x20 for the ease of use in other parts of the project. Then I have displayed them using the following code:
for i=1:10
subplot(2, 5, i);
imshow(T2(:, :, i));
title(['Image ', int2str(i)]);
end
After that I get the warning and the full black images.
So how was T2 derived? From S?
Try this:
whos T2
for k = 1 : 10
subplot(2, 5, k);
thisImage = T2(:, :, k);
maxGL = max(thisImage (:));
minGL = max(thisImage (:));
imshow(thisImage, []);
title(['Image ', int2str(k)]);
message = sprintf('For slice %d, min = %d, max = %d', k, minGL, maxGL);
fprintf('%s\n', message);
uiwait(helpdlg(message));
end
bazinga
bazinga el 12 de Nov. de 2013
Sorry, T2 is kind of manipulated version of S; but it has the same dimensions with S.
The code you have written worked really well, now I can properly display the image. However can you explain the logic behind your code?
Image Analyst
Image Analyst el 12 de Nov. de 2013
The [] scaled the image's actual min and max between 0 and 255 for display. You probably had 16 bit images which maybe went from 0 - 3000 or so but if you don't use [], it will scale the max for that class (uint16 which is 65535) to be 255. Which means that if your actual max was 3000, it would show up as 3000/65535 * 255 = 11 gray levels, which is too dark to see.
bazinga
bazinga el 12 de Nov. de 2013
Oh okay I understand now, thank you very much :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre DICOM Format en Centro de ayuda y File Exchange.

Preguntada:

el 12 de Nov. de 2013

Comentada:

el 12 de Nov. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by