# Setting an MNI origo to a volume

**URL:** https://discourse.slicer.org/t/setting-an-mni-origo-to-a-volume/16164
**Category:** Support
**Tags:** coordinates
**Created:** [February 23, 2021, 5:43pm UTC](https://discourse.slicer.org/t/setting-an-mni-origo-to-a-volume/16164 "2021-02-23T17:43:56Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [February 25, 2021, 1:46pm UTC](https://discourse.slicer.org/t/setting-an-mni-origo-to-a-volume/16164/4 "2021-02-25T13:46:18Z")

</div>

> [@Kalman](#):
>
> It would be a good thing to have in the first place!

You can copy-paste this into the Python console to jump slice views to (0,0,0) position on Ctrl+e:

```python
shortcut = qt.QShortcut(qt.QKeySequence('Ctrl+e'), slicer.util.mainWindow())
shortcut.connect('activated()',
  lambda: slicer.modules.markups.logic().JumpSlicesToLocation(0,0,0, True))

```

If you want to make this keyboard shortcut permanent then copy-paste the code into your startup script  
(you can find its location in menu: Edit / Application settings / General / Application startup script).

> [@Kalman](#):
>
> whether the MNI coordinate of a given point can be shown (e.g. in the Data Probe, or in another window)?

The Data probe only shows coordinate values in the world coordinate system. You can make the world coordinate system mean anything you want (e.g., MNI) by applying a transform to the volume that transforms it into that space.

You only need a small custom script (or if you want to be fancy then a custom module) to display coordinate values in multiple coordinate systems at the same time. For example, if you have a transform that moves your image to MNI space then you can use this code snippet to display world and MNI coordinates in the status bar as you move across the viewers:

```python
def onMouseMoved(observer,eventid):
  mniToWorldTransformNode = getNode('LinearTransform_3') # replace this by the name of your actual transform
  worldToMniTransform = vtk.vtkGeneralTransform()
  mniToWorldTransformNode.GetTransformToWorld(worldToMniTransform)
  ras=[0,0,0]
  mni=[0,0,0]
  crosshairNode.GetCursorPositionRAS(ras)
  worldToMniTransform.TransformPoint(ras, mni)
  slicer.util.showStatusMessage(f"RAS={.3:ras} MNI={mni}")

crosshairNode=slicer.util.getNode('Crosshair') 
observationId = crosshairNode.AddObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent, onMouseMoved)

# Run this to stop displaying values:
# crosshairNode.RemoveObserver(observationId)

```

> [@Kalman](#):
>
> is there an option to re-set this MNI origo if I would like to change that to another point (to correct its placement)?

Yes, by applying a transform. You can create a transform in Transforms module and set the coordinates in Translation section, click “Invert”, and then apply this transform to the volume.

I’m not sure if it is relevant for you, but you can compute ACPC transform using ACPC transform module.

---

_[View the full topic](https://discourse.slicer.org/t/setting-an-mni-origo-to-a-volume/16164)._
