onClick() function for vtkMRMLCrosshairNode?

Currently working on a python extension. I want to know ras coords for where the user clicks in the Crosshair Node.

I see that we have CursorPositionModifiedEvent, but this fires every time the cursor moves. I want an event that fires only when the user clicks. Cant find it in the class reference for crosshairnode nor its parent class :frowning:

Im sure this functionality exists, just not under whatever function name im expecting haha.

We usually want users to be able to see the clicked positions and adjust them as needed, so we use markup fiducials. If you really just want to get clicks from the user and immediately start processing based on those points, then you can do that by adding observers to the markups node. See for example how this is done in the LungCTAnalyzer extension’s Lung CT segmenter module:

1 Like

Wow this is great, thanks!

1 Like