Possible regression in events triggered by plane and ROI markups

rfenioux
Mon, 02 Dec 2024 11:34:18 +0000
Development

Hi all,

I am encountering an inconsistent behavior regarding the handling of events for plane and ROI markups in the latest preview version of Slicer, comparing to the stable release (slicer 5.6.2)

It seems that in the cases detailed below, some events are missing.

Here is the detailed behaviour :

Reproduction:
OS = Windows 11
Slicer version = 5.7.0 (revision 33134, built 2024-12-01) compared to slicer 5.6.2 (both installed from binaries)

1. Create the markups (plane or ROI) using the markups module

2. use the following snippet to get the node and connect the observers

# retrieve the node using its name (default is P for plane, R for ROI)
node = getNode("P")
# connect callbacks
node.AddObserver(slicer.vtkMRMLMarkupsROINode.PointStartInteractionEvent, lambda *_: print("start"))
node.AddObserver(slicer.vtkMRMLMarkupsROINode.PointModifiedEvent, lambda *_: print("modified"))
node.AddObserver(slicer.vtkMRMLMarkupsROINode.PointEndInteractionEvent, lambda *_: print("end"))

3. observe the console logs while click and dragging either the center point, or the corner (or side) handles

Results:
Here are the events triggered depending on the use cases

Use case | Slicer 5.6.2 | Slicer 5.7.2 2024-12-01
Dragging center of ROI | startInteraction, modified, endInteraction | modified
Dragging corner of ROI | startInteraction, modified, endInteraction | modified
Draging center of plane markup | startInteraction, modified, endInteraction | startInteraction, modifiedEvents, endInteraction
Dragging corner of plane markup | StartInteraction, endInteraction* | No event

*The first time a corner of the plane is moved in 5.6.2, a single modifiedEvent is triggered between the start and end events

To me it seems like a regression, unless I have missed an API change regarding the events of these markups. I didn’t notice any change in other markups (fiducial, line, angle…) but I haven’t tried all of them.

I would be grateful if you have any insight on what could be causing these changes.

6 posts - 2 participants