adding an RGB volume to a grayscale MRI volume
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a grayscale MRI volume of dimension 160x216x176.
I also have a volume corresponding to its labels, which is in RGB, so its 160x216x176x3.
I want to use imshow to show each mri volume slice superimposed to its labels, with the mri volume appearing in gray and the labels appearing in a custom colormap that I created.
I use this to produce the RGB slices:
labelRGB_slice=label2rgb(handles.label(:,:,handles.current_slice_z), my_colormap, [0 0 0]);
handles.labelRGB(:,:,handles.current_slice_z, : , : , :) = labelRGB_slice;
this is the imshow that I plan to use to update axes:
imshow((handles.imdata_show(:,:, handles.current_slice_z) +...
handles.labelRGB(:,:,handles.current_slice_z, : , : )),...
'DisplayRange', [])
it's obviously faulty cause the matrix dimensions don't agree, but I don't know how to fix the grayscale slice to make it addable to the rgb slice.
What should I use here? repmat? ind2rgb?
I tried using ind2rgb with a 'gray' colormap, like this:
imshow((ind2rgb(handles.imdata_show(:,:, handles.current_slice_z), gray) +...
squeeze(handles.labelRGB(:,:,handles.current_slice_z, : , : ))),...
'DisplayRange', [])
and got this botched image, losing all gray contrast (rgb labels haven't been placed yet):
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu 3-D Volumetric Image Processing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!