# Robustness of "Fill between slices" effect

**URL:** <https://discourse.slicer.org/t/robustness-of-fill-between-slices-effect/220>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [April 28, 2017, 1:27pm UTC](https://discourse.slicer.org/t/robustness-of-fill-between-slices-effect/220 "2017-04-28T13:27:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fernando/32/5640_2.png) [@Fernando](https://discourse.slicer.org/u/Fernando)\
**Post date:** [April 28, 2017, 1:27pm UTC](https://discourse.slicer.org/t/robustness-of-fill-between-slices-effect/220/1 "2017-04-28T13:27:04Z")

</div>

Hi all,

I’m applying the “Fill between slices” effect to two very similar images and I get the desired result in only one of them. Can someone take a look and let me know if you have any ideas to solve this? I expect two connected components and not three.

I tried (outside Slicer) all different combinations of the boolean parameters of `itkMorphologicalContourInterpolator` and got no improvements.

Link to the scene containing the two images and a segmentation with the contours before and after interpolation: [Dropbox - File Deleted - Simplify your life](https://www.dropbox.com/s/auhvg2epq9efdhk/2017-04-28-Scene-fill-between-slices.mrb?dl=0)

Thanks for looking into this. If you think this should be posted in ITK instead of here, please let me know.

Here’s what the scene looks like:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/2/022d52b57e7b72656f26406a4cb0bcf7a7cfa5c6.png)

Best,  
Fernando

---

<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:** [April 29, 2017, 4:33am UTC](https://discourse.slicer.org/t/robustness-of-fill-between-slices-effect/220/3 "2017-04-29T04:33:15Z")

</div>

The interpolation algorithm assumes smoothly changing shape between segmented slices. If anywhere the interpolated contours are not accurate, all you have to do is segment some more slices. The interpolation will be updated automatically.

---

<div class="post-metadata">

**Author:** ![thewtex](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thewtex/32/32_2.png) [@thewtex](https://discourse.slicer.org/u/thewtex)\
**Post date:** [April 29, 2017, 1:09pm UTC](https://discourse.slicer.org/t/robustness-of-fill-between-slices-effect/220/4 "2017-04-29T13:09:00Z")

</div>

As Andras noted, another manual segmentation on the region where it is failing will improve the result.

It fails because there is an assumption that the segmented contours will overlap – it looks like they are not quite overlapping in that case.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dzenanz/32/1992_2.png) [@dzenanz](https://discourse.slicer.org/u/dzenanz)\
**Post date:** [April 29, 2017, 5:48pm UTC](https://discourse.slicer.org/t/robustness-of-fill-between-slices-effect/220/5 "2017-04-29T17:48:01Z")

</div>

The contours must have some overlap to be considered the same object. The  
lack of overlap distinguishes different objects e.g. parallel blood vessels.
