# Is it possible to shrink/grow a segmentation by relative measure based on its volume?

**URL:** <https://discourse.slicer.org/t/is-it-possible-to-shrink-grow-a-segmentation-by-relative-measure-based-on-its-volume/15295>\
**Category:** Support\
**Created:** [December 30, 2020, 3:09pm UTC](https://discourse.slicer.org/t/is-it-possible-to-shrink-grow-a-segmentation-by-relative-measure-based-on-its-volume/15295 "2020-12-30T15:09:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niko\_Plath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/niko_plath/32/8665_2.png) [@Niko\_Plath](https://discourse.slicer.org/u/Niko_Plath)\
**Post date:** [December 30, 2020, 3:09pm UTC](https://discourse.slicer.org/t/is-it-possible-to-shrink-grow-a-segmentation-by-relative-measure-based-on-its-volume/15295/1 "2020-12-30T15:09:46Z")

</div>

Hi, I am searching for a functionality to shrink/grow a segmentation by a ratio of its volume instead of by absolute values via “Margin”.  
So something like “isotropic increase of volume by x%”.  
Any hints?  
Thanks in advance!

Operating system: WIn10  
Slicer version: 4.10.2  
Expected behavior:  
Actual behavior:

---

<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:** [December 30, 2020, 10:55pm UTC](https://discourse.slicer.org/t/is-it-possible-to-shrink-grow-a-segmentation-by-relative-measure-based-on-its-volume/15295/2 "2020-12-30T22:55:24Z")

</div>

You can increase/decrease volume of a segment by applying a scaling transform. You can easily compute the scaling factor from the amount of volume growth you want to achieve.

However, you might prefer margin growing instead of scaling, as it is more similar to tissue growth. Amount of volume increase due to margin growing depends on the shape of the segment, so you need to do a couple of iterations to find the margin that leads to the desired volume change. You can speed up computation of these iterations by a bit of Python scripting, which computes a distance map from the segment labelmap once and tries different threshold values on that.
