Hope you are doing well!
As shown in figure below, I’ve created a ‘Segmentation’ node for ‘MRHead’ which contains two segments: Segment_1(with threshold 50-279), Segment_2(with threshold 80-279).
- I imported this segmentation node into the model module using the following code:
shNode = slicer.mrmlScene.GetSubjectHierarchyNode() exportFolderItemId = shNode.CreateFolderItem(shNode.GetSceneItemID(), 'HEAD') segmentationNode1 = getNode("Segmentation") slicer.modules.segmentations.logic().ExportAllSegmentsToModels(segmentationNode1, exportFolderItemId)
But after I run the above code, the models’ visibility of the two segments are turned on by default. How to turn off the visibility of the two segmented models using python separately?
- How to remove a segment in this segmentation node programmatically? For example, how to delete the second segment node(Segment_2)?
Grateful for your help in advance!