How to get mouse IJK coordinates?

Hi everyone,

I am trying to write my first module using MarkUp PointList. And I would like to use a label in UI to show the real-time mouse position, both RAS and IJK, just like the screenshot below.

I found the RAS coordinates using

crosshairNode.GetCursorPositionRAS(ras)

What are the functions I should use to retrieve the mouse IJK coordinates?

Thank you very much in advance!

The DataProbe is implemented in Python, so you can copy-paste the code snippet that computes voxel coordinates from slice XYZ - see here.

1 Like