# Getting files with different size in Python and GUI using the same decimation method

**URL:** <https://discourse.slicer.org/t/getting-files-with-different-size-in-python-and-gui-using-the-same-decimation-method/28477>\
**Category:** Development\
**Tags:** segmentation, python\
**Created:** [March 20, 2023, 2:16pm UTC](https://discourse.slicer.org/t/getting-files-with-different-size-in-python-and-gui-using-the-same-decimation-method/28477 "2023-03-20T14:16:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Contente](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/contente/32/65434_2.png) [@Contente](https://discourse.slicer.org/u/Contente)\
**Post date:** [March 20, 2023, 2:16pm UTC](https://discourse.slicer.org/t/getting-files-with-different-size-in-python-and-gui-using-the-same-decimation-method/28477/1 "2023-03-20T14:16:00Z")

</div>

Hello, everyone.

In order to use the decimation method, we call the method:

```auto
segmentation.SetConversionParameter("Decimation factor", "0.90")

```

My question is: by default, this method implements the DecimatePro algorithm or the new Quadric/FastQuadric ones? If not, then how can I call it using python to select which one I want to use (such as the “Boundary Deletion” checkbox in the GUI version).

For context purpouse, when I use the decimate by GUI I get an OBJ file with 200MB size and when I use python scripts with CLI I get an OBJ with 1GB with this decimate method from segmentation module. I’m trying to figure out why there is this difference.

---

<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:** [March 20, 2023, 2:17pm UTC](https://discourse.slicer.org/t/getting-files-with-different-size-in-python-and-gui-using-the-same-decimation-method/28477/2 "2023-03-20T14:17:57Z")

</div>

You can have a look at what the GUI does and do the same in your script:

> <https://github.com/Slicer/SlicerSurfaceToolbox/blob/3b556d10307c5c9ee9fd8da1ea873ddc1d48acf3/SurfaceToolbox/SurfaceToolbox.py#L419-L439>

---

<div class="post-metadata">

**Author:** ![Contente](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/contente/32/65434_2.png) [@Contente](https://discourse.slicer.org/u/Contente)\
**Post date:** [March 20, 2023, 7:31pm UTC](https://discourse.slicer.org/t/getting-files-with-different-size-in-python-and-gui-using-the-same-decimation-method/28477/3 "2023-03-20T19:31:02Z")

</div>

Thank you very much. I’ve managed to finally decrease the size of the models using this approach.
