# Scale the whole segmentation

**URL:** <https://discourse.slicer.org/t/scale-the-whole-segmentation/15902>\
**Category:** Support\
**Created:** [February 8, 2021, 5:37pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902 "2021-02-08T17:37:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [February 8, 2021, 5:37pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/1 "2021-02-08T17:37:07Z")

</div>

Hello,  
How can we scale up/down a whole segmentation?  
I want to do it in segment editor by changing the size of the main volume, but it seems that my RAM is not enough for that. I am wondering whether there is a way to scale a segmentation without changing the size of the main volume.  
Thanks in advance

---

<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:** [February 8, 2021, 6:04pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/2 "2021-02-08T18:04:56Z")

</div>

> [@Aep93](#):
>
> How can we scale up/down a whole segmentation?

Can you clarify what you mean by this?  
If you want to increase the resolution of your segmentation, you can use the segment geometry settings Oversampling option to do that. Putting in 2 as an oversampling factor will increase the memory usage 8 folds. So if you don’t have enough RAM on your computer you may encounter issues or sluggishness. [See this thread](https://discourse.slicer.org/t/computer-slows-down-after-volume-is-oversampled/15743/17)

If this is not what you want to do, please explain more.

---

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [February 8, 2021, 6:45pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/3 "2021-02-08T18:45:59Z")

</div>

Thank you for your explanations @muratmaga. Actually what I want to do is to make the whole model smaller for exporting related tasks and post processing. Therefore, the main volume is not important for me at this step and I do not need it anymore. Therefore, I wanted to know the easiest way to scale down a segmentation/model without changing the main volume.

---

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [February 8, 2021, 7:14pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/4 "2021-02-08T19:14:25Z")

</div>

I get this error when I want to scale down the volume:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/f/cf9b5998ef6d247aaac634c08de5306f6ebc186f.png)  
Any help is greatly appreciated.

---

<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:** [February 8, 2021, 7:20pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/5 "2021-02-08T19:20:42Z")

</div>

As the error message states, you need to increase swap size in your system settings or add more RAM if you want to oversample the segmentation or input volume.

However, from what you describe, it seems that you want to decimate the segmentation (reduce number of points and triangles in the mesh without changing its geometry), which can be achieved using “Decimation” module (after exporting the segmentation to closed surface).

---

<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:** [February 8, 2021, 7:28pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/6 "2021-02-08T19:28:19Z")

</div>

> [@Aep93](#):
>
> I get this error when I want to scale down the volume:

What module/function are you using that generates this error?

---

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [February 8, 2021, 7:45pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/7 "2021-02-08T19:45:22Z")

</div>

Thanks for your response @lassoan. I tried to use Decimation module but it seems that it is not what I want. In fact, I want to change the geometry somehow. I want to make my whole model smaller and not reducing the number of points of the same size model.

---

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [February 8, 2021, 7:45pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/8 "2021-02-08T19:45:56Z")

</div>

I got this in “Segmentation geometry” section of the segment editor module.

---

<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:** [February 8, 2021, 7:51pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/9 "2021-02-08T19:51:12Z")

</div>

> [@Aep93](#):
>
> I tried to use Decimation module but it seems that it is not what I want. In fact, I want to change the geometry somehow.

You can change physical scale of segmentations when you [export to files](https://slicer.readthedocs.io/en/latest/user_guide/modules/segmentations.html#export-segmentation-to-model-surface-mesh-file) or using Surface Toolbox module (Scale mesh) or apply a transform in Transforms module (scaling factors are the 3 diagonal values in the first 3 columns).

---

<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:** [February 8, 2021, 7:51pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/10 "2021-02-08T19:51:54Z")

</div>

Remember it is the option is to oversample. If you are trying to reduce the detail, you need to put a number less than 1. However, this may cause loss of detail in your segmentation.

Perhaps you can first export the segmentation as a model, and then use the `Surface Toolbox`'s Decimation option to reduce the model detail.

---

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [February 8, 2021, 7:55pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/11 "2021-02-08T19:55:17Z")

</div>

Thank you very much @lassoan. I think the “Surface Toolbox” is very close to what I want. Just one question:  
How can we increase the limitation of the number of input decimals. It seems that only two decimals can be used as scale factor by default.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/3/436eac6809c464b96c67360ee05331291f607670.png)

---

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [February 8, 2021, 7:57pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/12 "2021-02-08T19:57:04Z")

</div>

Thank you very much for your response @muratmaga. I think the best way for me is to use “Surface toolbox” module as you mentioned and there I can scale down my model.

---

<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:** [February 8, 2021, 7:59pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/13 "2021-02-08T19:59:47Z")

</div>

> [@Aep93](#):
>
> How can we increase the limitation of the number of input decimals. It seems that only two decimals can be used as scale factor by default.

You can increase the decimal digits by hitting Ctrl++.

However, both the need to scale down the model and use a very specific many-digit scaling factor are things that should normally not needed. Why do you need to change the physical scale of your model?

---

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [February 8, 2021, 9:51pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/14 "2021-02-08T21:51:14Z")

</div>

Thanks for your response @lassoan. I want to scale my segmentation (which is related to a very small organ) to its real physical dimensions and export it.  
One question:  
Does this combination (ctrl and +) work in all modules of slicer for increasing decimal digits? For me, it works in the “Surface Toolbox” module but it seems not to be working in the “Create models” module. Do you have any ideas in this regard?  
Thanks in advance

---

<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:** [February 8, 2021, 9:59pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/15 "2021-02-08T21:59:41Z")

</div>

This keyboard shortcut is enabled by default in all ctkDoubleSpinBox widgets. We can enable it in Create Models module, too.

---

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [February 8, 2021, 10:02pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/16 "2021-02-08T22:02:17Z")

</div>

Thanks for your response @lassoan. How should I enable it? Is this possible for you to kindly enable it?

---

<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:** [April 27, 2021, 2:32am UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/17 "2021-04-27T02:32:17Z")

</div>

I’ve enabled it now. You can enter arbitrary number of decimals in SlicerIGT extension from tomorrow (in latest Slicer Preview Release and if you update SlicerIGT in latest Stable Release).

---

<div class="post-metadata">

**Author:** ![Aep93](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aep93/32/5990_2.png) [@Aep93](https://discourse.slicer.org/u/Aep93)\
**Post date:** [April 27, 2021, 2:44am UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/18 "2021-04-27T02:44:29Z")

</div>

Thank you so much @lassoan.

---

<div class="post-metadata">

**Author:** ![Qazi](https://avatars.discourse-cdn.com/v4/letter/q/a4c791/32.png) [@Qazi](https://discourse.slicer.org/u/Qazi)\
**Post date:** [June 3, 2022, 6:45pm UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/19 "2022-06-03T18:45:16Z")

</div>

Hi there,

would scaling up/down change the volume (quantification) using segment statistics? If yes, by which factor you can correct it? e.g. if your scaling factor is 0.2, and your volume reading on segment statistics is 20000cm3, do you need to multiply the 20000 with 0.2^3 to get the correct volume of the segment? or if there is any other way to get the correct value for volume. Thanks

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 5, 2022, 11:08am UTC](https://discourse.slicer.org/t/scale-the-whole-segmentation/15902/20 "2022-06-05T11:08:59Z")

</div>

Appply a limear transform woth values on the doagonal thay rqusl your svaleFactor

Sorry Im on my hpone
