# Volume rendering colorized with segmentation

**URL:** <https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689>\
**Category:** Development\
**Tags:** segmentation, volume-rendering\
**Created:** [January 18, 2021, 11:12pm UTC](https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689 "2021-01-18T23:12:45Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [December 12, 2022, 1:11pm UTC](https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689/21 "2022-12-12T13:11:25Z")

</div>

Hurrah.

[https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/6/e6bb5fe0b2820f387e49bb5cf21feb1bb22c4629.mp4](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/6/e6bb5fe0b2820f387e49bb5cf21feb1bb22c4629.mp4)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 12, 2022, 2:31pm UTC](https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689/22 "2022-12-12T14:31:32Z")

</div>

@rbumm, this image looks has very nice and smooth surface. Was it the result of enabling gradient opacity mapping? Were you able to get similarly smooth surfaces without making the segments semi-transparent?

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [December 12, 2022, 2:55pm UTC](https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689/23 "2022-12-12T14:55:23Z")

</div>

@lassoan Sorry for not providing that information.  
I used the dataset you linked, Median smoothed all segments (3.0 mm) and reduced the overall segment opacity to 0.4. Then combined it with a Muscle CT volume rendering.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 12, 2022, 3:02pm UTC](https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689/24 "2022-12-12T15:02:17Z")

</div>

Oh, I see. In this topic we investigate the possibility of displaying the segmentation in 3D **using volume rendering** to preserve subtle details in the original image (that cannot be captured in a binary segmentation), make occlusion more realistic (make thicker structures less transparent), and make 3D display updates faster (without having to spend time with generating a surface mesh).

---

<div class="post-metadata">

**Author:** ![ME\_Rad](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@ME\_Rad](https://discourse.slicer.org/u/ME_Rad)\
**Post date:** [June 23, 2023, 5:57pm UTC](https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689/25 "2023-06-23T17:57:03Z")

</div>

@rbumm Nice renderings. I like the approach.  
@lassoan I am interested in exactly what you described. Have you had any additional thoughts or implemented anything to make it easy for the end user to achieve?

Has anyone done a more photo-realistic coloring mapping based on the TotalSegmentator labels? Ribs and vertebrae are whiteish, intestines are pinky red, etc.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 15, 2023, 9:49pm UTC](https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689/26 "2023-10-15T21:49:33Z")

</div>

@ME_Rad - in case you missed it, there’s been some progress in fixing the underlying rendering code and adding a module in the sandbox extension that exposes this technique for end users.

See these links some example images and movies including TotalSegmentator labels.

> <https://github.com/Slicer/VTK/pull/43>
>
> Implements the feature and fixes discussed in this thread:
> 
> https://discourse.…slicer.org/t/volume-rendering-colorized-with-segmentation/26689/6
> 
> Basically allows RGBA volumes to be shaded according to their alpha component so that something like a CT or microCT can define an rgb value at spatial regions, while getting opacity and gradient information from the alpha channel (e.g. the Hounsfield unit).
> 
> Also always uses the 0 channel for defining the lighting parameters. This part is WIP since it may be more appropriate to set the alpha channel lighting parameters in this scenario. Currently, at least in 3D Slicer, only the 0 compnent's lighting parameters are being set, so they are being used here.

> <https://github.com/PerkLab/SlicerSandbox/tree/master/ColorizeVolume>
>
> //github.com/PerkLab/SlicerSandbox/tree/master/ColorizeVolume

> [@VTK multivolume/cinematic volume rendering](https://discourse.slicer.org/t/vtk-multivolume-cinematic-volume-rendering/31981/22):
>
> OMG! This is a game changer for us. We just now a way to adjust TF per segment basis somehow… And regular shadows/lights work great, just need the ambient shadows as @lassoan mentioned.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 16, 2023, 7:02pm UTC](https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689/27 "2023-10-16T19:02:40Z")

</div>

Adding the new thread from @jaimigray she posted. Check out the visuals.

> [@New Colorize Volume module](https://discourse.slicer.org/t/new-colorize-volume-module/32254):
>
> Just added to 3D Slicer 5.5 is the new Colorize Volume module! I tried it on a fully segmented rattlesnake skull with really nice results comparable to the expensive proprietary software VGStudio Max. I played around with the Volume Rendering settings, as well as Lights module (from the SandBox extension), and cropping to an ROI in the Volume Rendering module to bisect and view the inside of the skull. I am still exploring the various functions of this module but I am excited to see what else I …

[Previous page](https://discourse.slicer.org/t/volume-rendering-colorized-with-segmentation/26689.md?page=1)
