How to superimpose/overlay a grayscale 3D image onto a color 3D image?

17 Ansichten (letzte 30 Tage)
Jay
Jay am 21 Jan. 2014
Beantwortet: muna majeed am 4 Feb. 2015
I have used 'vol3d' from the following link by Oliver Woodford;
on the ultrasound data collected and was able to get the 3D image either in gray scale or color as required.
But I have another co-registered 3D data and would like to superimpose this 3D image in color over 3D ultrasound data which I require to be in gray scale.
I understand that this is quite straight forward for 2D images but technique for converting image to rgb cannot be used for 3D image since rgb conversion of 2D image gives 3 x m x n which is 3D in itself.
The resultant 3D image should be a co-registered image from both the modalities.
Or another way to look at this question is to have two superimposed 3D images with two different colormaps.
Please give your suggestions or guidance and thanks in advance.
  1 Kommentar
Walter Roberson
Walter Roberson am 21 Jan. 2014
Have I understood correctly that you have two 3D volume datasets (voxels), and you want to display them both in the same volume but with different coloring?
If so, then at any one voxel, how should the output be chosen? Suppose V1 is the value from the first (render-in-greyscale) volume, and V2 is the value from the second (render-in-rgb) volume, then what would you like the output to be at that location? For example is there a threshold for V2 above which color_map(V2) should be the output and V1 ignored, or should V2 be the alpha value applied to color_map(V2)?
V2 * color_map(V2) + (1-V2) * grey_map(V1)

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Bruno Pop-Stefanov
Bruno Pop-Stefanov am 21 Jan. 2014
Bearbeitet: Bruno Pop-Stefanov am 21 Jan. 2014
I don't think it is any different for 3D images. If a color 3D image has dimensions (m x n x p x 3), then you could convert a grayscale 3D image with dimensions (m x n x p) to color with the following:
% Generate a random grayscale 3D image
gray3Dimage = rand([m n p]);
% Create its color equivalent
gray3Dimage_rgb(:,:,:,1) = gray3Dimage; % red channel
gray3Dimage_rgb(:,:,:,2) = gray3Dimage; % green channel
gray3Dimage_rgb(:,:,:,3) = gray3Dimage; % blue channel
You could replace the three lines above with:
gray3Dimage_rgb = repmat(gray3Dimage,[1,1,1,3]);
Then overlay with a coefficient alpha:
% Superimpose with other color 3D image
alpha = 0.5;
super(:,:,:,1) = alpha*gray3Dimage_rgb(:,:,:,1) + (1-alpha)*other3Dimage_rgb(:,:,:,1); % red channel
super(:,:,:,2) = alpha*gray3Dimage_rgb(:,:,:,2) + (1-alpha)*other3Dimage_rgb(:,:,:,2); % green channel
super(:,:,:,3) = alpha*gray3Dimage_rgb(:,:,:,3) + (1-alpha)*other3Dimage_rgb(:,:,:,3); % blue channel
or simply
super = alpha*gray3Dimage_rgb + (1-alpha)*other3Dimage_rgb;
  1 Kommentar
Jay
Jay am 21 Jan. 2014
Thank you for prompt response.
I have tried this method before but both the 3D data that I have are 3D matrices not rgb images.
And even if I convert one data set to gray-scale rgb image when I use 'vol3d' code the whole 3D plot converts back to color image.
The co-registered 3D superimpose image that I am hoping to visualize using Matlab is similar to the following example, here is a web link of an image from a paper online http://www.winprobe.com/the-research-platform/photoacoustics.html
Here the gray part of the image is Ultrasound data while the color part of is the photo-acoustic data which are superimposed from two separate 3D data matrices.

Melden Sie sich an, um zu kommentieren.


muna majeed
muna majeed am 4 Feb. 2015
please can any one help me how to read pixel from 3d image is there special instruction in matlab

Kategorien

Mehr zu Get Started with Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by