After doing some digging in the script repository & on the forum, I found some helpful answers (see here and here). However, much of what I found advises that one use the markups module for interactions with the slice viewer. I’m sure this might work, but it seems a little roundabout for what I actually need to do. Is there no way to:
-
set an event translation via something like:
sliceViewWidget = slicer.app.layoutManager().sliceWidget(“Red”)
displayableManager = sliceViewWidget.sliceView().displayableManagerByClassName(“vtkMRMLCrosshairDisplayableManager”)
widget = displayableManager.GetSliceIntersectionWidget()
widget.SetEventTranslation(widget.WidgetStateAny, vtk.vtkCommand.RightButtonDoubleClickEvent, vtk.vtkEvent.NoModifier, widget.WidgetEventCustomAction1) -
Take the translation and set an observer on a vtkMRMLsliceNode or a vtkMRMLcrosshairNode?
i.e. sliceNode.AddObserver(sliceNode.CustomActionEvent1 (DOES NOT EXIST), GenericCallbackFn)