I am trying to access the Scissors effect from Segment Editor in my scripted module. When I run print(slicer.mrmlScene.GetFirstNodeByClass(“vtkMRMLSegmentEditorNode”)), I see that Scissors.Operation:EraseInside. I would like for the operation to be EraseOutside.
I have also tried “EraseOutside” and 1 (since it’s a radio button), but none of these have changed the value of Operation. I looked at the source code for the scissors effect and I can’t figure out why this isn’t working. Any help would be appreciated. Thanks.
I didn’t change my code at all but suddenly effect.setParameter(“Operation”, “EraseOutside”) started working.
Another question: I want to trigger an event after the scissor cuts. I have tried adding an observer to the segment like so:
self.observerTag = self.segmentationNode.GetSegmentation().GetSegment(addedSegmentID).AddObserver(‘ModifiedEvent’, self.printStatus)
This seems to trigger when I apply a threshold but not when I cut with the scissors, I think since there isn’t an onApply() method for the Scissors effect. What would be the best way to trigger an event after a cutting occurs?
I’m trying to develop a streamlined method for determining breast volume from MRI. After scissoring I want to advance the program.
I’m having another issue that is related to the initial topic. I’m trying to use the Margin effect and I can’t seem to get it to Shrink instead of Grow. My code is:
However, the margin grows instead of shrinks. What is unusual is when I print the SegmentEditorNode I see “Margin.Operation:Shrink” yet the margin is clearly growing. Any advice?