# Adjusting margin sizes based on volume ratios and axes

**URL:** https://discourse.slicer.org/t/adjusting-margin-sizes-based-on-volume-ratios-and-axes/32974
**Category:** Support
**Tags:** volume
**Created:** [November 23, 2023, 8:39am UTC](https://discourse.slicer.org/t/adjusting-margin-sizes-based-on-volume-ratios-and-axes/32974 "2023-11-23T08:39:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ally7113](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ally7113/32/67730_2.png) [@ally7113](https://discourse.slicer.org/u/ally7113)
#### Post date: [November 23, 2023, 8:39am UTC](https://discourse.slicer.org/t/adjusting-margin-sizes-based-on-volume-ratios-and-axes/32974/1 "2023-11-23T08:39:58Z")

</div>

![화면 캡처 2023-11-23 173352](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/5/75862ddbdd589518b4428be94082952485bff775.png)

Sorry for the low-quality image…

I would like to expand the existing segment in three directions based on the volume ratio.  
For instance, I want to expand by 5% along the x-axis, 10% along the y-axis, and 10% along the z-axis. However, the margins are in millimeters, and I observed that the growth occurs uniformly in all three directions.

As I am not familiar with Slicer and Python, I would greatly appreciate it if you could provide detailed instructions on how to achieve this.

---

<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: [November 23, 2023, 9:01pm UTC](https://discourse.slicer.org/t/adjusting-margin-sizes-based-on-volume-ratios-and-axes/32974/2 "2023-11-23T21:01:43Z")

</div>

You can use PadImage filter in Simple filters which allows you to pad image in any value along 6 axis.

You can alternatively draw ROI and modify its extends under the ROI settings to match dimensions you want and then use the Crop Volume module.
