I converted a mha file to dicom format (and got this file: https://www.dropbox.com/s/i0cr2910ie4k5zy/TumorSimOutput2_T1.dcm ) via a Linux utility program (this one: http://manpages.ubuntu.com/manpages/lucid/man1/gdcm2vtk.1.html ) and visualize it via imshow using threedimensional indexing:
when I examine the dimensions of image_data I get:
256 256 1 181
I understand the third dimension is the grayscale intensity (thanks to Walter Roberson and his answer here: http://www.mathworks.com/matlabcentral/answers/62671-4d-dicom-matrix-why-not-3d).
I want to convert this grayscale dimension of the matrix into RGB, how can I do this?
How about extracting the gray scale image from the 4D image, and then converting it:
grayImage = your4Dimage(:,:,1,181); % Can use any frame instead of 181 rgbImage = cat(3, grayImage, grayImage, grayImage);
Play games and win prizes!Learn more