I would like to be able to use the Markups module to obtain a 2D pixel location, instead of the RAS coordinates on a transformed image. For example I would like to obtain the coordinates of Image_Probe not RAS in the following image:
Any help is appreciated. Thanks.
As shown in
https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_DataProbe_text
you can do something like
infoWidget = slicer.modules.DataProbeInstance.infoWidget infoWidget.layerIJKs['B'].text
I’ve added an example to the script repository that shows how to get voxel coordinate from RAS coordinate of a markup fiducial point: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_volume_voxel_coordinates_from_markup_fiducial_RAS_coordinates