Can I center the views on a crosshair position?

Hi. I can set the location of crosshairs, e.g.
slicer.mrmlScene.GetNodesByClass(‘vtkMRMLCrosshairNode’).GetItemAsObject(0).SetCrosshairRAS(point)

but is there a way to re-center the views on that location?

You can use this API:

Thanks, that did the trick!

Not sure if this is the exact right way, but it worked:

def set_ras_coords(point: list[float]):
    slicer.mrmlScene.GetNodesByClass('vtkMRMLCrosshairNode').GetItemAsObject(0).SetCrosshairRAS(point)
    sliceNodes = list(slicer.mrmlScene.GetNodesByClass('vtkMRMLSliceNode'))
    for sliceNode in sliceNodes:
        sliceNode.JumpAllSlices(point[0], point[1], point[2])
1 Like