How can I react to a segmentation node being changed using the cut, erase and paint capabilities of the segmentation extension? At first I tried to attach slicer.vtkMRMLSegmentationNode.SegmentationChangedEvent this event to the segmentation node and tried to react to it but whenever I changed the segment the control did not go inside my function to react to it. And after that I tried using vtk.vtkSegmentation.SourceRepresentationModified, event but this also so did not work. Is the problem is in my code and one of the above mentioned event is the correct one to use? Or is it totally a different event to react to?
Try something simple and it should work. I just have one segmentation and when I use the code I pasted I get a print when I use the paint effect on the segmentation. Try to debug in the python console before using the approach in more complex code so that you are confident you know a certain call will work.