# Margin effect to dilate segmentation

**URL:** <https://discourse.slicer.org/t/margin-effect-to-dilate-segmentation/19565>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [September 8, 2021, 10:39am UTC](https://discourse.slicer.org/t/margin-effect-to-dilate-segmentation/19565 "2021-09-08T10:39:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mgi](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mgi](https://discourse.slicer.org/u/Mgi)\
**Post date:** [September 8, 2021, 10:39am UTC](https://discourse.slicer.org/t/margin-effect-to-dilate-segmentation/19565/1 "2021-09-08T10:39:01Z")

</div>

Hi everyone, ![margin](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/5/157f5a64170d1d25cf5f19ed7246a97d1faec259.jpeg)

I’m using 3d slicer, 4.11.20200930 version on windows 10. When I use the Margin effect tool to dilate a segmentation I defined a margin size of 1.01 mm. However, below it appears “Actual: 0.5 x 0.5 x 1.0 mm (1 x 1 x 1 pixel)”. I attached an image.

I want to dilate the segmentation by 1 voxel, Is the margin size correct? Why appear 0.5 x 0.5 mm?

---

<div class="post-metadata">

**Author:** ![Mgi](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mgi](https://discourse.slicer.org/u/Mgi)\
**Post date:** [September 8, 2021, 10:40am UTC](https://discourse.slicer.org/t/margin-effect-to-dilate-segmentation/19565/2 "2021-09-08T10:40:11Z")

</div>

Hi @lassoan! Could you help me? please!

---

<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:** [September 8, 2021, 1:46pm UTC](https://discourse.slicer.org/t/margin-effect-to-dilate-segmentation/19565/3 "2021-09-08T13:46:14Z")

</div>

There have been fixes in this logic. Please try the latest Slicer Stable Release and latest Slicer Preview Release to see if they work as you expect.

Note that you can only add a margin to labelmap representations that is 2x the voxel size. If you need a different margin size then you either have to [modify the voxel size in the segmentation](https://slicer.readthedocs.io/en/latest/user_guide/modules/segmenteditor.html#segmentation-is-not-accurate-enough) or export the segmentation to a model and apply a VTK filter there (this latter requires a few lines of Python scripting).

---

<div class="post-metadata">

**Author:** ![Mgi](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mgi](https://discourse.slicer.org/u/Mgi)\
**Post date:** [September 8, 2021, 10:08pm UTC](https://discourse.slicer.org/t/margin-effect-to-dilate-segmentation/19565/4 "2021-09-08T22:08:47Z")

</div>

Thank you @lassoan! I tried in the latest Slicer stable release but It appears the same. I want to study the repeatability of radiomics features when the segmentation is dilated. Then I think the plane dilation with 1 pixel will be well.

---

<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:** [September 9, 2021, 1:14am UTC](https://discourse.slicer.org/t/margin-effect-to-dilate-segmentation/19565/5 "2021-09-09T01:14:39Z")

</div>

Could you please try with the latest preview release?
