# Importing models for segmentation to fix

**URL:** <https://discourse.slicer.org/t/importing-models-for-segmentation-to-fix/2229>\
**Category:** Support\
**Created:** [March 2, 2018, 7:38pm UTC](https://discourse.slicer.org/t/importing-models-for-segmentation-to-fix/2229 "2018-03-02T19:38:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 2, 2018, 7:38pm UTC](https://discourse.slicer.org/t/importing-models-for-segmentation-to-fix/2229/1 "2018-03-02T19:38:41Z")

</div>

I have these scalp models that have big gaps on top and a knot (before).I imported as segmentations into the segment editor, and used the scissors to trim the knot. Segment editor automatically stitched the gap at the top. which is good, except that the counter didn’t match very well (after). Any suggestions on how to improve this?

Thanks,  
M  
 ![before](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/8/488729ff2596a727042dabc9f3045d4a7a5cde3e.png)  
 ![after](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/0/702cb341cfdf1648eaa0d8a37e9991d5a3859b82.png)

---

<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 2, 2018, 7:56pm UTC](https://discourse.slicer.org/t/importing-models-for-segmentation-to-fix/2229/2 "2018-03-02T19:56:37Z")

</div>

You can apply [vtkFillHolesFilter](https://www.vtk.org/doc/nightly/html/classvtkFillHolesFilter.html) on the polydata in your model node before you import it into segmentation. It would be nice if you could add it as a step to SurfaceToolbox module.

---

<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 5, 2018, 2:25pm UTC](https://discourse.slicer.org/t/importing-models-for-segmentation-to-fix/2229/3 "2018-03-05T14:25:24Z")

</div>

@muratmaga Do you plan to work on adding this filter to [SurfaceToolbox module](https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/SurfaceToolbox/SurfaceToolbox.py)? It should be trivial, you can just clone and existing processing step and modify it to use vtkFillHolesFilter.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 5, 2018, 10:48pm UTC](https://discourse.slicer.org/t/importing-models-for-segmentation-to-fix/2229/4 "2018-03-05T22:48:05Z")

</div>

Sorry Andras, I do not. I took a look and I decided I will be beyond my depth.

---

<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 6, 2018, 3:42am UTC](https://discourse.slicer.org/t/importing-models-for-segmentation-to-fix/2229/5 "2018-03-06T03:42:04Z")

</div>

I’ve [added “Hole filling” step](https://github.com/Slicer/Slicer/commit/f4a792d66b910edc54060566573d13264f3951fc) to Surface Toolbox. It should be available in the nightly build from tomorrow or the day after.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/6/062c3d1783138786d6190e337e3bf80ccbc4e031.jpeg)
