I have a segmentation that was converted into models in order to use the Surface Toolkit with them and access decimation and other optimization methods.
However, I want to export the models that have been processed to a .obj file, but the “slicer.vtkSlicerSegmentationsModuleLogic.ExportSegmentsClosedSurfaceRepresentationToFiles()” only works for segments. Is there a way to do it without converting the models to a segmentation?
If not, how can I convert my models to a segmentation in python?
In order to simplify, I want to be able to do the following steps with Python scripts.
When I use “slicer.modules.segmentations.logic().ImportModelToSegmentationNode()” method, my Slicer3D stops for 30 minutes and crashes.
And the “slicer.util.saveNode(model, outputFileName)” gives this error:
Saving failed with all writers found for file “C:\Users\virtu\Desktop\python-slicer\obj_"muscle".obj” of type “ModelFile”