# Four/Eight Neighbor Morphology Effects in Segment Editor

**URL:** <https://discourse.slicer.org/t/four-eight-neighbor-morphology-effects-in-segment-editor/889>\
**Category:** Feature requests\
**Created:** [August 17, 2017, 6:09pm UTC](https://discourse.slicer.org/t/four-eight-neighbor-morphology-effects-in-segment-editor/889 "2017-08-17T18:09:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moselhy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/moselhy/32/501_2.png) [@moselhy](https://discourse.slicer.org/u/moselhy)\
**Post date:** [August 17, 2017, 6:09pm UTC](https://discourse.slicer.org/t/four-eight-neighbor-morphology-effects-in-segment-editor/889/1 "2017-08-17T18:09:57Z")

</div>

I find that Segment Editor’s Margin effect does not achieve the same job as Editor’s “Four Neighbor” erode effect. What resources would be useful to implement a tool where the user selects neighbor type and erode/dilate then apply it to the segment?

Thanks

---

<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:** [August 17, 2017, 6:53pm UTC](https://discourse.slicer.org/t/four-eight-neighbor-morphology-effects-in-segment-editor/889/2 "2017-08-17T18:53:43Z")

</div>

Segment editor’s Margin effect uses a sphere shaped structuring element, which allows adding/removing margin by a specific size (regardless of pixel size and segment surface normal direction).

For noise removal, I would suggest to use methods available in Smoothing effect.

The legacy Editor’s 4/8-neighbor erode/dilate effect was very limited (mostly usable only for removing very small amount of random noise), as it grew diamond-shaped regions, with shape depending on the volume spacing.
