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?
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).
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?
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.
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).