Multi-plane image inputs must be RGB images of size MxNx3.

63 views (last 30 days)
i have a total of 381 dicom imgaes which i have stacked. now i want to see the stacked images but when i use imshow function for it gives an error 'Multi-plane image inputs must be RGB images of size MxNx3'. my stacked image variable shows it value 512x512x381 uint16. how can i see those stacked images?

Answers (1)

Walter Roberson
Walter Roberson on 19 Dec 2019
imshow is only for single grayscale images or single rgb images.
If you are using a fairly recent version see volumeViewer() and otherwise look in the File Exchange for vol3d v2.
Or use implay() if you don't need a volume view.
  3 Comments
Rik
Rik on 20 Dec 2019
While it is possible to do that, you really shouldn't. By doing that you will be throwing out a lot of image detail and you will treat different slices of your CT as the three color channels.
What would be your goal with turning three slices into a color image?
Walter Roberson
Walter Roberson on 20 Dec 2019
RGB8 = im2uint8(IndividualGrayscaleImage(:,:,[1 1 1]));
However this will not help you view the images as a volume.
For some of the functions able to display volumes, it can help to
reshape(ImageStack, size(ImageStack,1), size(ImageStack,2), 1, size(ImageStack,3))
or equivalently,
permute(ImageStack, [1 2 4 3])
manking a 512 x 512 x 1 x 381 stack .
Some of the display routines need this 4D array in order to distinguish what could hypothetically be a single image with 381 information channels compared to a stack of 381 grayscale images.
However, imshow() is not one of the routines. imshow() can only handle grayscale and RGB.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!