How do you get the slice view your cursor is over?

Hello,

How do you get the slice view (Red, Yellow, Green) your cursor is over?

Thank you!

Hi - Something like this should work for you:

c = getNode("*Crosshair*")
c.AddObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent, lambda callee, event: print(c.GetCursorPositionXYZ([0]*3).GetName()))

Look in Modules/Scripted/DataProbe/DataProbe.py for more details.

1 Like

Great, thank you so much!