I have a batch of segments-.nrrd files. (100s)
I would like to load them (Add data- files) as .nrrd. (The default in add data dialog box is volume, so I manually change them to segmentations, one by one. (So they load as segmentations)
Then I have to convert them to models. Here also I either do it one by one in the data module by right click, convert to models or in segmentations module by exporting to models.
Is there an efficient way to do this, without going one by one.
You can write a short python script to do the above
segmentationNode = slicer.util.loadSegmentation(YOUR_FILE_NAME) # load the data as a
# Export segmentation to model
shNode = slicer.mrmlScene.GetSubjectHierarchyNode()
exportFolderItemId = shNode.CreateFolderItem(shNode.GetSceneItemID(), "Segments")
slicer.modules.segmentations.logic().ExportAllSegmentsToModels(segmentationNode, exportFolderItemId)