STL of a 2d surface

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

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”

1 Like

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

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

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.

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
1 Like

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