Merge colored images and show them as 1 volume

(Katharina Abrar) #1

Hello everyone,
is there a way to merge multiple colored png images into one volume and visualize this than in the 3D space?

I really need this feature since in these images, the colors are really important and I can´t segment pixel by pixel…

I would be very pleased if somebody could give me some advice to this topic!

Thank you for your understandings!



(Andras Lasso) #2

This should help:


(Katharina Abrar) #3

Thank you Sir for the fast reply!

Is there a way to retain the colors of the images? When I create a scalar volume it automatically creates a grey 3D volume. I really need the colored volume out of theses images like there are in there

… Is there a solution for my problem?

Thanks in advance!


(Andras Lasso) #4

If you just want to visualize them with their original color, apply spatial transforms, etc. then you don’t need to convert to scalar volume. What would you like to do with the image?


(Katharina Abrar) #5

I just showed the view of one image. I would like to visualize the colored image stack in their original color in the 3D space (View 1). Since the pixels of the image stack are colored differently, I can´t segment pixel by pixel. It is also not possible to use the vector to scalar volume, since it is creating a Grey-colored 3D volume, where the original color is lost.

I hope that the issue is now understandable.
Is there a way to solve this?

Thank you very much for all help!


(Andras Lasso) #6

If you have a full-color image then you can show a direct volume rendering of it by turning off “independent component” option in the volume renderer (it makes image components interpreted as RGBA). Type this in the Python console after enabling volume rendering:


Note that you need an RGBA image (not just RGB). The fourth (alpha) component controls opacity. If you only have an RGB image then you can create the “alpha” volume using “Vector to scalar volume” module, then append this alpha volume to the original RGB volume by copy-pasting this to the Python console:

colorVolume = getNode('MyColorVolume') # RGB vector volume
alphaVolume = getNode('MyAlphaVolume') # scalar volume created from RGB volume using Vector to scalar volume module


For segmentation (if you want to create a surface mesh, 3D-printable model, etc), use the scalar volume created by “Vector to scalar volume” module.