How to remove some segment editor effects

Operating system: Windows 10
Slicer version:4.11.202.00930

I am trying to create a new module from the segment editor module and need to remove some of the editor effects that I won’t be needing. Is there any way to do this. I want to keep some of the effects and remove the rest.For example, remove Draw tube, Engrave, Islands, Level tracing, split volume,flood filling, but keep the rest. Please let me know if anyone has done this and how? Any help is appreciated. Thanks.

You can use setEffectNameOrder to set the order that you would like the effects to appear and disable unorderedEffectsVisible to hide the ones that weren’t specified.

1 Like

Hey, thanks a lot. If its no trouble, Can you give me an example of how the code would be for any one effect to be listed.

Sure, here’s an example of creating a segment editor widget with only the paint and threshold effects:

segmentEditorWidget = slicer.qMRMLSegmentEditorWidget()
segmentEditorWidget.setEffectNameOrder(["Paint", "Threshold"])
segmentEditorWidget.unorderedEffectsVisible = False
segmentEditorWidget.show()

2 Likes

Thanks! That helped.

Good question and perfect answers to solve this problem. :slightly_smiling_face: I appreciate that, thanks!

3 Likes