# surface rendering of many segments

**URL:** <https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044>\
**Category:** Support\
**Created:** [September 10, 2018, 1:32pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044 "2018-09-10T13:32:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adriana\_Zlahoda](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Adriana\_Zlahoda](https://discourse.slicer.org/u/Adriana_Zlahoda)\
**Post date:** [September 10, 2018, 1:32pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/1 "2018-09-10T13:32:03Z")

</div>

Slicer version:4.9.0  
Hi,  
I performed all heart segmentation from CT data. Now I want to render all segments in 3D assuming that all bordering segments have a common contact surface. Although during segmentation my segments are perfectly matched in slicer, during surface rendering I get separated surfaces…

Is it possible in slicer / any other software package?

---

<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:** [September 10, 2018, 3:09pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/2 "2018-09-10T15:09:52Z")

</div>

If you disable smoothing then the forced contact won’t be lost when converting to surfaces. Please note that this phenomenon only happens for visualization, and the underlying labelmap data is still contiguous. You can disable smoothing in the Segment Editor by clicking the small arrow next to Show 3D, or in the Segmentations module by changing the conversion parameter if you click Update on the Closed surface representation.

---

<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:** [September 10, 2018, 9:45pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/3 "2018-09-10T21:45:42Z")

</div>

@cpinter wouldn’t it be better to use [joint smoothing?](https://www.vtk.org/pipermail/vtkusers/2017-December/100502.html)

---

<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:** [September 11, 2018, 4:42am UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/4 "2018-09-11T04:42:09Z")

</div>

We have that option in Smoothing effect but not in the automatic conversion between segment representations. The assumption is that smoothing operation in “binary labelmap to closed surface” conversion is only used for removing staircase artifacts and so it does not require adjustment of the geometry.

We would need to implement some new mechanism in segmentation infrastructure to allow joint conversion of multiple segments, because right now conversion happens segment by segment.

---

<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:** [September 11, 2018, 12:45pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/5 "2018-09-11T12:45:58Z")

</div>

Joint smoothing works on labelmaps. The user’s problem is about the surfaces shown in 3D which are converted from the labelmaps. This conversion is temporary and is only for visualization.

@lassoan I don’t think we need to implement a new converter for this. It would basically mean a new representation type, some “topologically correct surface”, but it would mean the same or more interaction from the user than simply disabling smoothing. I assume that if the user needs to preserve this property on the segments then they won’t care about staircase artifacts.

---

<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:** [September 11, 2018, 1:09pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/6 "2018-09-11T13:09:31Z")

</div>

The joint smoothing results are very useful in my opinion because they look more like real anatomy with smooth surfaces and no gaps between the structures. This is useful even if the conversion is only temporary.

---

<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:** [September 11, 2018, 1:22pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/7 "2018-09-11T13:22:45Z")

</div>

If there is a converter in VTK that converts labelmaps to a set of surfaces preserving the joint edges, then it should not be hard to add. On a second thought, we probably wouldn’t need a new representation, but an option in the converter would be enough and we could expose it in segment editor the same way as smoothing. If there is no such converter though, then this would be a major project.

---

<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:** [September 11, 2018, 1:58pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/8 "2018-09-11T13:58:44Z")

</div>

It would the same pipeline as the JointSmoothing option of [the ModelMaker](https://www.slicer.org/wiki/Documentation/4.8/Modules/ModelMaker). [The code](https://github.com/Slicer/Slicer/blob/master/Modules/CLI/ModelMaker/ModelMaker.cxx) is pretty hard to follow but I’d think it could be ported.

---

<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:** [September 11, 2018, 2:04pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/9 "2018-09-11T14:04:59Z")

</div>

I added a Mantis issue for this: [https://issues.slicer.org/view.php?id=4604](https://issues.slicer.org/view.php?id=4604)

I think we have a good plan, so implementing it is now a matter of priorities.

---

<div class="post-metadata">

**Author:** ![sarvpriya1985](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sarvpriya1985/32/4094_2.png) [@sarvpriya1985](https://discourse.slicer.org/u/sarvpriya1985)\
**Post date:** [December 27, 2018, 3:57pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/10 "2018-12-27T15:57:49Z")

</div>

Hi,  
How is 3D surface rendering different from 3D segmentation of heart and how is it used.

Thanks,  
Sarv

---

<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 27, 2018, 4:35pm UTC](https://discourse.slicer.org/t/surface-rendering-of-many-segments/4044/11 "2018-12-27T16:35:16Z")

</div>

When you segment structures then they are displayed in 3D views using surface rendering.
