# STL of a 2d surface

**URL:** <https://discourse.slicer.org/t/stl-of-a-2d-surface/945>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [August 25, 2017, 9:42am UTC](https://discourse.slicer.org/t/stl-of-a-2d-surface/945 "2017-08-25T09:42:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [August 25, 2017, 9:42am UTC](https://discourse.slicer.org/t/stl-of-a-2d-surface/945/1 "2017-08-25T09:42:13Z")

</div>

Dear all,  
I have a png image loaded to slicer and segmented. When I try generate the model using Model Maker I get this error:  
Model Maker standard error:  
The volume is not 3D.  
Image data extents: 0 511 0 361 0 0

When I use “Create Surface” in “Segment Editor”, The surface is generated and viewed in the 3D view but it does not appear in the “Subject hierarchy” or in “Save”.  
Any suggestion?  
best regards!  
Ibraheem

---

<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:** [August 25, 2017, 11:29am UTC](https://discourse.slicer.org/t/stl-of-a-2d-surface/945/2 "2017-08-25T11:29:14Z")

</div>

I’ve just tested and it works well in a recent nightly version of Slicer. To export the segment to a model, go to Data module (Subject hierarchy section), right-click on the segment, and choose “Export visible segments to models”

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [August 25, 2017, 12:01pm UTC](https://discourse.slicer.org/t/stl-of-a-2d-surface/945/3 "2017-08-25T12:01:29Z")

</div>

This works, thanks Andras. I suggest to make the model generation automatic.

---

<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:** [August 25, 2017, 12:48pm UTC](https://discourse.slicer.org/t/stl-of-a-2d-surface/945/4 "2017-08-25T12:48:48Z")

</div>

Generation of 3D closed surface representation of segments is already automatic.  
Can you describe why you need to automate exporting to model nodes?

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [August 28, 2017, 3:42pm UTC](https://discourse.slicer.org/t/stl-of-a-2d-surface/945/5 "2017-08-28T15:42:00Z")

</div>

Because it is expected since it is already implemented for 3D. I wanted to test an external tool i.e statismo, the example required a poly-data as input.

---

<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:** [August 28, 2017, 3:53pm UTC](https://discourse.slicer.org/t/stl-of-a-2d-surface/945/6 "2017-08-28T15:53:26Z")

</div>

Your answer is extremely brief, and calls for a lot of extrapolation and assumptions. You say you use an external tool. I can see two ways for doing that:

1. You need to save the STL to disk, and load it in your tool. In that case updating the STL on disk real-time as it changes seems like a dangerous operation. It should be done on-demand, which you can do easily
2. You built the tool and use it as an extension, from python for example. You say it needs vtkPolyData. You can get the poly data directly from the segmentation node, no need to go through the model node loop:[https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get\_a\_representation\_of\_a\_segment](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_a_representation_of_a_segment)

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [August 28, 2017, 3:58pm UTC](https://discourse.slicer.org/t/stl-of-a-2d-surface/945/7 "2017-08-28T15:58:06Z")

</div>

oh Andras post already solved the issue. I just replied to his question 😅 but thanks for explaining.
