# Remove small artifacts from 3d model

**URL:** <https://discourse.slicer.org/t/remove-small-artifacts-from-3d-model/6170>\
**Category:** Development\
**Tags:** visualization\
**Created:** [March 17, 2019, 11:00am UTC](https://discourse.slicer.org/t/remove-small-artifacts-from-3d-model/6170 "2019-03-17T11:00:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Ef](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Michael\_Ef](https://discourse.slicer.org/u/Michael_Ef)\
**Post date:** [March 17, 2019, 11:00am UTC](https://discourse.slicer.org/t/remove-small-artifacts-from-3d-model/6170/1 "2019-03-17T11:00:57Z")

</div>

Hello,

I reconstructed a 3d model of prostate glands from histological slides by marching cubes algorithm. In my model I have a lot of small contours that i do not want to have in the model. Is there a way (e.g. a vtk filter) to extract these contours by setting a minimum size for these contours? Similar to the vtkConnectivityFilter where you can extract the largest region!?

Thanks a lot in advance.

Regards Michael

---

<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:** [March 17, 2019, 12:40pm UTC](https://discourse.slicer.org/t/remove-small-artifacts-from-3d-model/6170/2 "2019-03-17T12:40:58Z")

</div>

The Islands effect in Segment Editor can do this, here’s the code:

> <https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Segmentations/EditorEffects/Python/SegmentEditorIslandsEffect.py#L121-L208>

Is there a good reason for using low-level VTK functions instead of Segment Editor? You’re using Slicer I assume so why not use its features?
