# How to keep continuity when surface smoothing

**URL:** https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598
**Category:** Support
**Tags:** segmentation
**Created:** [March 17, 2021, 3:52pm UTC](https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598 "2021-03-17T15:52:59Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![xiang\_luo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiang_luo/32/9305_2.png) [@xiang\_luo](https://discourse.slicer.org/u/xiang_luo)
#### Post date: [March 17, 2021, 3:52pm UTC](https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598/1 "2021-03-17T15:52:59Z")

</div>

When i smooth the pulmonary artery, i find that the vessel continuity had beed destoryed sharply. Like this:  
 ![smooth](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/e/6ed9a9e1f641e4218f3f35719be08e232f6c26a5.png)  
Also i find this happend in Mimics when i set the prefer to accuracy, while the default value is continuity, which make no continutity destoryed. How can i do this in Slicer? Any simple way to change the quality for smoothing?

---

<div class="post-metadata">

### Author: ![xiang\_luo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiang_luo/32/9305_2.png) [@xiang\_luo](https://discourse.slicer.org/u/xiang_luo)
#### Post date: [March 18, 2021, 6:55am UTC](https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598/2 "2021-03-18T06:55:40Z")

</div>

Sorry, I forget add some instructions. Here is the different 3D Reconstruction in Mimics with two option.  
Reconstruction options:

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

Option: accuracy

 ![mimics_accuracy](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/b/db0ba0d52de4927da9ad8bf9b2075cc0a8f6ffcb.png)  
Option: continutiy  
 ![mimics_continuity](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/f/3f1d78b8594a2a716db52ec8b97ffd5ca77f9f67.png)

---

<div class="post-metadata">

### Author: ![xiang\_luo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiang_luo/32/9305_2.png) [@xiang\_luo](https://discourse.slicer.org/u/xiang_luo)
#### Post date: [March 22, 2021, 12:19pm UTC](https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598/3 "2021-03-22T12:19:24Z")

</div>

Can you help me with this? @lassoan

---

<div class="post-metadata">

### Author: ![xiang\_luo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiang_luo/32/9305_2.png) [@xiang\_luo](https://discourse.slicer.org/u/xiang_luo)
#### Post date: [March 24, 2021, 11:26am UTC](https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598/4 "2021-03-24T11:26:19Z")

</div>

I have tried the source code about smoothing label in Slicer Preview, but it doesn’t work while the speed is faster.

---

<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: [March 24, 2021, 3:42pm UTC](https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598/5 "2021-03-24T15:42:50Z")

</div>

I’ve searched on the web about what Mimics means by Continuity vs Accuracy and found the description [here](https://www.researchgate.net/profile/Yousof-Mohandes/post/can_anyone_suggest_me_any_appropriate_resources_for_Learning_MIMICS_and_3Matic/attachment/59d635f579197b80779936d1/AS%3A386294325760004%401469111153225/download/Mimics+Research+17.0+Reference+Guide.pdf). In short, these parameters control “matrix reduction” i.e., image downsampling. I would not recommend to use “continuity” mode ever.

In Slicer, the simplest, most transparent way of adjusting sampling distance is in Crop volume module. You can choose the spacing scale value to upsample (scale\<1.0) or downsample (scale\>1.0) and force isotropic spacing. In general, I would recommend to force isotropic spacing because many image processing operations work better if voxels are approximately cubic shape. Downsampling should be avoided, as it may remove relevant details and make measurements less accurate. If there are small details that you cannot represent at the native image resolution then you can fix the problem by upsampling the image. Upsampling can increase memory need and computation time by magnitudes, therefore it often makes sense to combine it with cropping the image to minimum size (that’s why all these features are implemented in one module).

With a croppping and resampling the module with a isotropic spacing and well-chosen scaling factor the vasculature will look perfect. You can also adjust smoothing factor to fine-tune appearance. If you prefer to optimize for visual appearance rather than accuracy then you can also apply Smoothing or Margin effects in Segment Editor to make the vessels thicker.

> [@xiang\_luo](#):
>
> I have tried the source code about smoothing label in Slicer Preview, but it doesn’t work while the speed is faster.

Which module or feature do you mean exactly?

---

<div class="post-metadata">

### Author: ![xiang\_luo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiang_luo/32/9305_2.png) [@xiang\_luo](https://discourse.slicer.org/u/xiang_luo)
#### Post date: [March 25, 2021, 2:40am UTC](https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598/6 "2021-03-25T02:40:13Z")

</div>

Exactly, i have tried code in [Slicer/LabelMapSmoothing.cxx at master · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/blob/master/Modules/CLI/LabelMapSmoothing/LabelMapSmoothing.cxx) and [Slicer/vtkClosedSurfaceToBinaryLabelmapConversionRule.cxx at 08789e8f2224f89206b2d6a49d1d452d4e677994 · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/blob/08789e8f2224f89206b2d6a49d1d452d4e677994/Libs/vtkSegmentationCore/vtkClosedSurfaceToBinaryLabelmapConversionRule.cxx)

---

<div class="post-metadata">

### Author: ![xiang\_luo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xiang_luo/32/9305_2.png) [@xiang\_luo](https://discourse.slicer.org/u/xiang_luo)
#### Post date: [March 25, 2021, 2:53am UTC](https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598/7 "2021-03-25T02:53:59Z")

</div>

I have read the Mimics documentions [here](https://www.researchgate.net/profile/Yousof-Mohandes/post/can_anyone_suggest_me_any_appropriate_resources_for_Learning_MIMICS_and_3Matic/attachment/59d635f579197b80779936d1/AS%3A386294325760004%401469111153225/download/Mimics+Research+17.0+Reference+Guide.pdf), i mentioned the “contour interpolation” and the “matrix reduction algorithm”, i want to know if there exist simility algrithm or function in Sliver or VTK to implement this, any demo?

---

<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: [July 18, 2021, 3:00am UTC](https://discourse.slicer.org/t/how-to-keep-continuity-when-surface-smoothing/16598/8 "2021-07-18T03:00:48Z")

</div>

“Contour interpolation” in Mimics → “Fill between slices” segment editor effect in Slicer.  
“Matrix reduction algorithm” in Mimics → “Crop volume” and “Resample scalar/vector/dwi volume” module in Slicer.
