# 2021.01.05 Hangout

**URL:** <https://discourse.slicer.org/t/2021-01-05-hangout/15335>\
**Category:** Weekly meetings\
**Created:** [January 4, 2021, 4:14pm UTC](https://discourse.slicer.org/t/2021-01-05-hangout/15335 "2021-01-04T16:14:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [January 4, 2021, 8:30pm UTC](https://discourse.slicer.org/t/2021-01-05-hangout/15335/5 "2021-01-04T20:30:21Z")

</div>

> [@jcfr](#):
>
> > [@pieper](#):
> >
> > volume rendering of segmentations too if we have time (rendering vector volumes with independent components off)
> 
> @Sankhesh_Jhaveri will join us at 10.30am to participate to this discussion

That’s great! Let me give a bit of background in case anyone wants to look in advance. The basic idea is to render segmentations using a technique like [the one described here](https://discourse.slicer.org/t/merge-colored-images-and-show-them-as-1-volume/6472/7) but with the reference volume as the alpha channel.

It works pretty well, and the SlicerMorph team really wants this mode, so one thing I want to do is speed up calculation of these. I’m sure it can be made to work in real time for feedback while segmenting, with per-segment visibility controls, etc.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/d/4de7393d8e93c0d0d7e4199a712a3e5229b7372a.jpeg)

The problem I’m hitting is that the ray caster seems to use the alpha channel for opacity integration, but for some reason uses the red channel to calculate the gradient for lighting, leading to pixelation artifacts and incorrect normals (e.g. no normals in blue areas).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/8/d85e9472c3d67c3de63814e9e6991dafc91bafb6.jpeg)

I’ve started working on a [pure vtk script to reproduce the issue](https://github.com/pieper/SlicerMorph/blob/SegmentRendering/SegmentationRendering/Experiments/independentComponetns.py) but wanted to discuss with this group before filing a bug report. Maybe I’m using it wrong or it’s already fixed in VTK master or someone’s branch.

The bottom ellipsoid is a single component volume and the top is rgba with the same alpha as the single component and red, green, blue slabs

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

I suspect this issue is [on this line](https://github.com/Kitware/VTK/blob/master/Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h#L1239) but changing the 0 to a 3 does not work as I expected (color becomes black everywhere).

---

_[View the full topic](https://discourse.slicer.org/t/2021-01-05-hangout/15335)._
