Grabbing the default segment editor widget

Hi,
Is there any way to access the active segment editor widget, for example to see the master volume / segmentation active currently?

Thanks
Usman.

Yes, you can access these information, but not through digging in the GUI, but elegantly getting information from the MRML node. For example, if you are interested in the segment editor widget of the Segment Editor module:

segmentEditorNode = slicer.mrmlScene.GetSingletonNode("SegmentEditor", "vtkMRMLSegmentEditorNode")
segmentEditorNode.GetMasterVolumeNode()

Note that you can place a segment editor widget in your own module’s GUI. That segment editor widget will not use the singleton node above, but you create a separate vtkMRMLSegmentEditorNode for that. See the examples here: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#How_to_run_segment_editor_effects_from_a_script

1 Like

Thanks for the prompt reply.

can something similar be done to access the instance of slicer.qMRMLSegmentSelectorWidget()?