Hi, at this time I’m trying to export the model node as RAS stl. Diving into documentation I saw that stl are saved as LPS by default, but it wont work for me…
Now I’m doing a quite simple process:
'Export segments to Models:'
segmentationNode = slicer.util.getNode(segmentationName)
segmentIDs = segmentationNode.GetSegmentation().GetSegmentIDs()
segmentNames = [segmentationNode.GetSegmentation().GetSegment(segmentID).GetName() for segmentID in segmentIDs]
'Create a folder to export models inside.'
shNode = slicer.mrmlScene.GetSubjectHierarchyNode()
exportFolderItemId = shNode.CreateFolderItem(shNode.GetSceneItemID(), "Segments")
slicer.modules.segmentations.logic().ExportSegmentsToModels(segmentationNode,segmentIDs, exportFolderItemId)type or paste code here
modelNode = slicer.util.getNode(segmentName)
stlPath = os.path.join(saveResults_path,segmentName)
slicer.util.saveNode(modelNode, stlPath+'.stl')