Hi all,
I am trying to access to what is displayed in the Data Probe Module. In particular, I need to access the anatomical information that is displayed there. For instance, I want to get the anatomical location corresponding to the location of the mouse tip.
What functions do I need to use to access that information ? I looked at the Documentation but I could not find any coding examples. etc.
Thank you !
lassoan
(Andras Lasso)
July 9, 2020, 2:26am
2
DataProbe module has no logic that other modules could use, but fortunately there is a much simpler way of getting anatomical location from the crosshair node. See complete example here: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_current_mouse_coordinates_in_a_slice_view
1 Like
Thanks !
I looked at the example, but I actually want to access to that information without using the mouse at all.
For instance I want to get all the anatomical coordinates and locations corresponding to the points in the Markup Fiducials.
How should I modify the example code for this ?
Thank you…
lassoan
(Andras Lasso)
July 9, 2020, 1:45pm
4
Markups fiducial positions are already defined in anatomical coordinates.
Yes but can’t I obtain the anatomical names which are displayed in the Data Probe module ?
lassoan
(Andras Lasso)
July 9, 2020, 7:09pm
6
What do you mean by anatomical name? Can you attach a screenshot and mark the information that you would like to obtain?
Basically I need all the information provided by the Data Probe Module.
For the 1st screenshot, I need the indices which are displayed next to the coordinates.
For the 2nd, I need the names which correspond to the segments (in this example Amygdala).
lassoan
(Andras Lasso)
July 9, 2020, 7:55pm
8
Indices: see above (example in the script repository), you can also have a look at the implementation in DataProbe:
hasVolume = False
layerLogicCalls = (('L', sliceLogic.GetLabelLayer),
('F', sliceLogic.GetForegroundLayer),
('B', sliceLogic.GetBackgroundLayer))
for layer,logicCall in layerLogicCalls:
layerLogic = logicCall()
volumeNode = layerLogic.GetVolumeNode()
ijk = [0, 0, 0]
if volumeNode:
hasVolume = True
xyToIJK = layerLogic.GetXYToIJKTransform()
ijkFloat = xyToIJK.TransformDoublePoint(xyz)
ijk = [_roundInt(value) for value in ijkFloat]
self.layerNames[layer].setText(self.generateLayerName(layerLogic))
self.layerIJKs[layer].setText(self.generateIJKPixelDescription(ijk, layerLogic))
self.layerValues[layer].setText(self.generateIJKPixelValueDescription(ijk, layerLogic))
Segment names: you can get them from the displayable managers, see implementation here: