# How to edit an STL file using Segment Editor

**URL:** <https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [May 3, 2021, 8:20pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559 "2021-05-03T20:20:40Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hamid](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hamid](https://discourse.slicer.org/u/Hamid)\
**Post date:** [May 3, 2021, 8:20pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/1 "2021-05-03T20:20:40Z")

</div>

I want to do some modifications on my stl file. when I open it from file as a data the “Segment Editor” is NOT active. How may I do that?

---

<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:** [May 11, 2021, 4:54am UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/2 "2021-05-11T04:54:43Z")

</div>

See step-by-step instructions in [Segmentations module documentation](https://slicer.readthedocs.io/en/latest/user_guide/modules/segmentations.html#import-an-existing-segmentation-from-model-surface-mesh-file) (see the tip at the end of the section on how to create a master volume if you don’t have one).

---

<div class="post-metadata">

**Author:** ![Hamid](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hamid](https://discourse.slicer.org/u/Hamid)\
**Post date:** [May 12, 2021, 3:40am UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/3 "2021-05-12T03:40:32Z")

</div>

Great! It works now. Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Hamid](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hamid](https://discourse.slicer.org/u/Hamid)\
**Post date:** [May 14, 2021, 5:54pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/4 "2021-05-14T17:54:55Z")

</div>

I load the stl file and after specifying the geometry I tried to modify the stl file using Draw tube effect. when I click on Draw tube effect a message shows up that says:“ **change master representation to binary labelmap** ”. if say YES,the files quality changes like

 ![before-after](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/a/cad3c1d617397271054887cb18ae92358be103a5.jpeg)  
attached screenshot. what would be the solution for this?  
The barbed fitting beforehand is added to the stl file in solidworks.(FYI)  
Many thanks

---

<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:** [May 14, 2021, 6:01pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/5 "2021-05-14T18:01:18Z")

</div>

This is looks good. The resolution you choose determines what details are preserved. If it is not feasible to use a resolution that preserves all the details you need (e.g., because your segmentation is large and your computer could not handle a very fine resolution labelmap of that size) then you can combine image-derived meshes with CAD parts by Boolean mesh operations, using Combine Models module (in Sandbox extension).

---

<div class="post-metadata">

**Author:** ![Hamid](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hamid](https://discourse.slicer.org/u/Hamid)\
**Post date:** [May 14, 2021, 7:54pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/6 "2021-05-14T19:54:09Z")

</div>

Thanks for quick reply. This quality does not work for my case because the tube should be fitted to the fitting barbed that you see in the screen shot and this one will end up with a leakage.  
How may I change the resolution?  
Does the image spacing change the mentioned quality? for my case the image spacing is 1mm along each axes. What happened if I change it e.g to 0.1mm?

---

<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:** [May 14, 2021, 8:49pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/7 "2021-05-14T20:49:38Z")

</div>

Spacing of the binary labelmap representation of the segmentation directly determines “quality”, i.e., size of the smallest details that can be preserved. Typical spacing is between few tenths of a millimeter to a few millimeters - consistent with spacing of the input images. However, if you need fitting between mechanical parts then you would need to work with 1-2 magnitudes smaller spacing along each axis, which would mean that you would have 3-6 magnitudes more voxels in the labelmap. Working with such large labelmaps (tens of GBs in size) is often not practically feasible, so if you need to combine pieces from image-driven segmentations with CAD parts, I would recommend to export the segmentation to models and then combine them with CAD-designed meshes using Combine models module.

---

<div class="post-metadata">

**Author:** ![Hamid](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hamid](https://discourse.slicer.org/u/Hamid)\
**Post date:** [December 8, 2021, 6:07pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/8 "2021-12-08T18:07:58Z")

</div>

When I load data (.stl model) into Slicer there are three options(segmentation-model-volume). If I choose model and load it, is there any way to modify the model? e.g cutting a part of it?  
Thanks

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [December 8, 2021, 6:23pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/9 "2021-12-08T18:23:19Z")

</div>

Look at the Dynamic Modeler module, which provides tools for manipulation of surface models, including cutting.

---

<div class="post-metadata">

**Author:** ![Hamid](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hamid](https://discourse.slicer.org/u/Hamid)\
**Post date:** [December 10, 2021, 11:11pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/10 "2021-12-10T23:11:34Z")

</div>

Thank you Mike. it works for cutting. Is there any option to fill holes ,…etc there?

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [December 10, 2021, 11:34pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/11 "2021-12-10T23:34:11Z")

</div>

The Surface Toolbox module has a variety of processing options oriented towards cleaning up and optimizing model meshes. One of the options there is “Fill Holes”, which might accomplish what you want (I don’t have experience with using that tool, so I’m not sure how it goes about filling holes).

Depending on what manipulations you want to do, you might have an easier time loading your stl as a segmentation and editing it using the Segment Editor tools. Then you can convert back to a surface representation after editing.

---

<div class="post-metadata">

**Author:** ![Hamid](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hamid](https://discourse.slicer.org/u/Hamid)\
**Post date:** [October 31, 2022, 8:19pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/12 "2022-10-31T20:19:58Z")

</div>

Hello,  
How can I use painting option with stl file?segment editor is inactive when open a stl file

---

<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:** [October 31, 2022, 11:37pm UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/13 "2022-10-31T23:37:54Z")

</div>

Right click on the stl object in the Data module and choose “convert model to Segmentation node”

---

<div class="post-metadata">

**Author:** ![Hamid](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hamid](https://discourse.slicer.org/u/Hamid)\
**Post date:** [November 1, 2022, 3:32am UTC](https://discourse.slicer.org/t/how-to-edit-an-stl-file-using-segment-editor/17559/14 "2022-11-01T03:32:21Z")

</div>

Perfect! Thank you so much Muratmaga
