# Volume rendering of binary label maps

**URL:** <https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411>\
**Category:** Support\
**Tags:** volume-rendering, labelmap\
**Created:** [October 16, 2018, 12:06pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411 "2018-10-16T12:06:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [October 16, 2018, 12:07pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/1 "2018-10-16T12:07:00Z")

</div>

Hello everyone,

is it generally possible to use the volume rendering module for created binary label maps, which were originating from segmentations?

I was exporting my segments to binary label maps and were trying to visualize them as a volume rendering… it did not work. Is this not possible? And if yes, why not?

Might there be another solutions?

Thanks for all your inputs!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [October 16, 2018, 2:16pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/2 "2018-10-16T14:16:57Z")

</div>

> [@katharina\_hecker](#):
>
> it did not work

We need a bit more information. What did you do? What did you expect? What happened instead? Thanks!

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [October 16, 2018, 3:28pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/3 "2018-10-16T15:28:05Z")

</div>

Hi,  
I was segmenting an nrrd file which contained a gray scale image stack.  
I was creating several different segments from blood vessels with different colors and exported them thereupon in the data module to a binary label map. This binary label map is in a volume format right?  
So I was hoping to generate a volume rendering (VTK GPU Ray Casting) out of this binary label map…

It would also help if I could use the Volume Rendering module for one segmentation, which was converted to a binary label map.

What not worked was that I could not visualize the binary label map as a volume rendering in the 3D view. I selected it as according volume and clicked on the eye icon but no 3D volume was visible (I tried also to change the Shift)…

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [October 16, 2018, 3:30pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/4 "2018-10-16T15:30:40Z")

</div>

You said that volume rendering did not work, so it would be great if you explained what did it not work in _that_: What did you do? What did you expect? What happened instead?

Btw what Slicer version did you use? 4.8.1 is quite outdated especially in terms of Segment Editor and Volume Rendering, so if you used that then please install a recent nightly such as [this](https://download.slicer.org/?date=2018-10-09).

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [October 16, 2018, 3:32pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/5 "2018-10-16T15:32:15Z")

</div>

I explained it above again…  
I´m currently using 4.9.0…  
I will try it with the nightly version

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [October 16, 2018, 3:45pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/6 "2018-10-16T15:45:18Z")

</div>

I understand what you want to do and why. Your way of creating the labelmap volume looks fine. But you didn’t describe what’s the problem with volume rendering, which is your question.

1. Go to Volume Rendering module
2. Use GPU volume rendering
3. Turn on visibility for the labelmap volume
4. I expect to see X, but instead I see Y, see screenshot

Something like this please.

---

<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:** [October 16, 2018, 4:13pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/7 "2018-10-16T16:13:04Z")

</div>

> [@katharina\_hecker](#):
>
> And if yes, why not?

You can use volume rendering to show segments (you may need to adjust Scalar Color Mapping function to assign each color to map colors to voxel values 1.0, 2.0, …), however the result won’t be nice:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/1/3112f69839848e4a6db02324aaf7876b441a81b8.png)

You can get the same look and just as good rendering speed by using “Show 3D” function with smoothing turned off.

If you smooth the volume to get a better look then you’ll have interpolation artifacts at the edges. A solution can be to use multi-volume rendering, but it is still experimental (no shading is available in multi-volume rendering mode).

Therefore, right now for 3D display of segments your best option is to click “Show 3D” button.

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [October 17, 2018, 6:04am UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/8 "2018-10-17T06:04:30Z")

</div>

I was trying it again today with another version and now I can see the segmentation, thank you!

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [October 17, 2018, 6:05am UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/9 "2018-10-17T06:05:39Z")

</div>

yes exactly, I tried the smoothing too. Thank you!

---

<div class="post-metadata">

**Author:** ![eduardo.ecamargo](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@eduardo.ecamargo](https://discourse.slicer.org/u/eduardo.ecamargo)\
**Post date:** [February 8, 2021, 6:38pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/10 "2021-02-08T18:38:14Z")

</div>

Hi @lassoan. " however the result won’t be nice:". Could you tell me why? Or maybe point out some document with an explanation.

---

<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:** [February 8, 2021, 6:53pm UTC](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/11 "2021-02-08T18:53:42Z")

</div>

See the image [above](https://discourse.slicer.org/t/volume-rendering-of-binary-label-maps/4411/7), you can barely make out the shape of the segment, even for a very simple shape.

By smoothing the labelmap, you can get visualization that is similar to surface rendering, like these:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/d/bdba75ac4c953af68712fd527842d38caa899636.png)

A hybrid option exists, too, when you take the color from the segmentation but opacity from another volume (smoothed labelmap or the original input image):

 ![](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/7/e7ac7974a69d026024c8d7f9dedcd5fdf209ab97.jpeg)

See more information about this option [here](https://discourse.slicer.org/t/2021-01-19-hangout/15585/2).
