Create a mesh in python script

It’s a couple of more lines (setActiveEffectByName only activates an effect). See the examples that I linked above.

RAS is anatomical coordinate system (right-anterior-superior). What is MNI coordinate system?

You can easily add a shortcut for jump to a current cursor position, just open the Python console and copy-paste these lines to make Ctrl+M jump to current slice position:

def jumpToCursor():
  ras=[0,0,0]
  slicer.mrmlScene.GetFirstNodeByClass('vtkMRMLCrosshairNode').GetCursorPositionRAS(ras)
  slicer.modules.markups.logic().JumpSlicesToLocation(ras[0], ras[1], ras[2], slicer.vtkMRMLCrosshairNode.JumpSlice)

shortcut = qt.QShortcut(slicer.util.mainWindow())
shortcut.setKey(qt.QKeySequence("Ctrl+M"))
shortcut.connect( 'activated()', jumpToCursor )

If you want this feature permanently then add it to your application startup script (edit it in menu: Edit / Application settings / Application startup script).

1 Like