# Trouble saving segment as an STL

**URL:** <https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654>\
**Category:** Support\
**Created:** [July 7, 2017, 8:15pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654 "2017-07-07T20:15:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![KateOxley](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@KateOxley](https://discourse.slicer.org/u/KateOxley)\
**Post date:** [July 7, 2017, 8:15pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/1 "2017-07-07T20:15:24Z")

</div>

I’m having trouble saving a segment as an STL. When I try to save, I’d expect to see a file called “Intervertebral Disc 1.vtk” that I could save as an STL, but I am not seeing that option. What am I doing wrong? Thanks for your help.

 ![](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/1X/6be6388b479232189f3871c28d1b4669752f0b95.jpg)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [July 7, 2017, 8:38pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/2 "2017-07-07T20:38:26Z")

</div>

You need to export the segment to a model node so that you can save it to STL. Easiest way is to go to Data module’s Subject hierarchy view, right-click the segmentation and select Export visible segments to models.

---

<div class="post-metadata">

**Author:** ![KateOxley](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@KateOxley](https://discourse.slicer.org/u/KateOxley)\
**Post date:** [July 7, 2017, 9:19pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/3 "2017-07-07T21:19:32Z")

</div>

I only have the option to export to DICOM.

---

<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:** [July 7, 2017, 9:31pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/4 "2017-07-07T21:31:59Z")

</div>

Use the latest nightly version of Slicer.

---

<div class="post-metadata">

**Author:** ![ssyip](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@ssyip](https://discourse.slicer.org/u/ssyip)\
**Post date:** [March 12, 2018, 10:09pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/5 "2018-03-12T22:09:45Z")

</div>

I have multiple contours (e.g. contour\_1, contour\_2, contour\_3). I created a model and it looks fine. But 3D slicer forced me to save the contours as three separate models (model\_1.stl, model\_2.stl, model\_3.stl). How do I save all of the models as a single stl file rather than three?

Thank you!

---

<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 13, 2018, 2:54am UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/6 "2018-03-13T02:54:17Z")

</div>

You can use `Merge models` module for this.

---

<div class="post-metadata">

**Author:** ![ssyip](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@ssyip](https://discourse.slicer.org/u/ssyip)\
**Post date:** [March 13, 2018, 3:45pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/7 "2018-03-13T15:45:20Z")

</div>

Hi Adras,

I have a brain and a tumor model. After merging them, it seems like the hierarchical structure is lost. That is, I can’t differentiate between the brain and tumor. Is that possible to merge them into one file, while assigning them with two different colors?

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:** [March 13, 2018, 4:28pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/8 "2018-03-13T16:28:59Z")

</div>

STL files cannot store scalar data. There are tricks that some software support, but you have to do the model merging in that software then. What would you like to do with the merged 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:** [March 20, 2018, 6:32pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/9 "2018-03-20T18:32:55Z")

</div>

Implemented [direct STL file export from segmentation](https://github.com/Slicer/Slicer/pull/919) - will be available in tomorrow’s nightly build. There is an option to merge all models to a single file STL and an option to save single-file .obj file, where each segment is saved with a different color.

---

<div class="post-metadata">

**Author:** ![xszomol](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xszomol](https://discourse.slicer.org/u/xszomol)\
**Post date:** [April 17, 2018, 12:24pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/10 "2018-04-17T12:24:14Z")

</div>

Hi a would like to export my swgmentations to .obj file. I am using slicer 4.9.0. When I try to export from segment editor I always get error that is shown on one of the pictures.

Thanks very much for help

 ![Sn%C3%ADmka2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/f/0fa6f8c7de949ec87a9a6700ee719ab5f19d4d19.png)  
 ![Sn%C3%ADmka](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/1/812f48d2fbd71b98060cbf3f7d65d382ea595fca.png)

---

<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 17, 2018, 12:46pm UTC](https://discourse.slicer.org/t/trouble-saving-segment-as-an-stl/654/11 "2018-04-17T12:46:37Z")

</div>

“unable to open .obj files” error is logged when the .obj file cannot be written. Make sure the target obj files are not open in any viewer or editor application and/or choose a different destination folder.
