How to set volume rendering color same as in slices?

Hi,

I have loaded RGB compatible ‘.dcm’ slices into the 3D slicer. I am able to get the slices in the RGB format as required. But the 3D volume from volume rendering shows grayscale. If I use preset from Volumes, it will get generated. But, I require the color format as addressed from slices.

How can I change the volume color as same as seen from slices?

Regards,
Sunag R A.

See if you can replicate what’s shown in the post below. Be sure you are using the latest and report back with details if things aren’t working (i.e. what slicer version you used, how to replicate the issue public data).

@pieper

Thanks for the reply.

Firstly, I am using 3D Slicer with version 4.11.2021226. So, back to 3D volume rendering, I am able to get the color changes based on the ‘preset’ in the Display panel. What I am trying to say is, for example, I have loaded dcm files with temperature RGB values. But in 3D model, apart from Preset color codes, how do I make is similar to color codes of my dcm slices?

I have attached the image for refrence. In the image, we can see that in volume, the color is generated by preset (say, US-Fetal). How to make the color code similar to slice views as can be seen in axial, coronal and sagittal views?
Or do we need to add new color codes in presets.xml?

Regards,
Sunag R A.

Please try a recent Slicer Preview Release. RGB volume rendering is set up automatically in these versions, but not in 4.11.2021226.

@lassoan

Thanks for the reply. Newer version means 4.13.0 which is in Preview release? In Stable release, I could see 4.11.2021226 as the highest version.

Regards,
Sunag R A.

Yes, we mean a recent preview release. It is not the stable release.

1 Like

Okay thanks. Will work on it.

Regards,
Sunag R A.

1 Like

@lassoan

I am unable to download the Linux preview version. Tired in Mozilla and Chrome many times. Its getting failed.

Regards,
Sunag R A.

Sorry, there is an issue with the packaging of the latest Slicer Preview Release on Linux. We are working on it, you can track its status here:

In the meantime, you can use a Slicer Preview Release from a week ago, downloaded via this link: https://download.slicer.org/?offset=-7 (the -7 means going back 7 days)

@lassoan

Hi, I tried working with 4.13 with previous releases like 7, 20, 50 and 100 days back. In these, I am unable to get any volume rendering view. Nothing happens when I opt for showing volume rendering.

Apart from this, I would like to understand the xml contents in the “presets.xml” mainly on colorTransfer parameter.

Example xml from 3dslicer:

<VolumeProperty selected="false" hideFromEditors="false" name="MR-T2-Brain" gradientOpacity="4 0 1 160.25 1" userTags="" specularPower="40" scalarOpacity="10 0 0 36.05 0 218.302 0.171429 412.406 1 641 1" id="vtkMRMLVolumePropertyNode26" specular="0.5" shade="1" ambient="0.3" colorTransfer="16 0 0 0 0 98.7223 0.956863 0.839216 0.192157 412.406 0 0.592157 0.807843 641 1 1 1" selectable="true" diffuse="0.6" interpolation="1" effectiveRange="0 412.406"/>

Or, if any other version which loads color model as slices then that would be good.

Regards,
Sunag R A.

I’ve just tested RGB volume rendering on Linux using Slicer-4.13.0-2022-02-14 and it worked well:

Please try to follow exactly what is done in the video, using the same Visible Human head RGB volume and see if that works for you.

If it works then something may be wrong with your data. If you share it (upload somewhere and post the link) then we can have a look.

Thank you, the video showed what your problem was: you used the experimental “Multi-volume rendering” mode, which does not support RGB volume rendering.

@lassoan

Yes. I changed to CPU ray casting and it worked perfectly for the head image. It is not working for my case study.

If you could provide an email id, I would like to send the case study (zip file of dicom).

Regards,
Sunag R A.

You can send me a private message by clicking on my username and then clicking on “Message”.

I’ve received the data set and it is not legal DICOM.

First of all, the same SOP instance UID is used in all the files, so the DICOM importer imports the first file and ignores the rest.

If I use a workaround and instead of properly using the DICOM module, I just add the data set as non-DICOM data (that uses ITK’s DICOM reader) then the image appears but since the voxel type is short (instead of unsigned char) and the range is off (-1024 to -769), the volume renderer does not show anything.

If you fix the data set to have prober unique identifiers and voxel type and range then Slicer will display it correctly.

RGB volumes are problematic for many reasons, so instead of burning in a colormap I would strongly recommend to save a standard scalar image and apply a color lookup table in the application. You can choose colormap for slice views in Volumes module and apply the same coloring in Volume rendering module by clicking on Synchronize with Volumes module button.

1 Like

@lassoan

Thank you for the detailed explanation. I will work on it.

Regards,
Sunag R A.

@lassoan

Hi,
Based on manual color map, I was able to get the 3D model with desired color coding. I saved the scene as “.mrml” file.

Is there way that I could load this mrml color code as default whenever I load new dicom files.?

Attached image as reference.

Regards,
Sunag R A.

Yes, you can customize how specific type of DICOM files are visualized by default.

Probably the simplest solution is to add an observer to the scene and when a new node is added check if that is that special kind. If it is then modify the visualization: change color map, show volume rendering, etc. See an example here.

If you want a more clear solution and also specify custom right-click menu actions, etc. then you can define a new Subject Hierarchy plugin that will recognize the special image type and return a high confidence value for it (so your plugin will be the owner of that image). In this case, your plugin will show/hide the volume, so you can customize how exactly it is performed. See these related examples: simple subject hierarchy plugin, complete example of a new volume type (RT dose volume, with custom colormap, custom icon in the subject hierarchy, custom right-click menu actions).