# MNE source points in the MRI coordinate system

**URL:** <https://mne.discourse.group/t/mne-source-points-in-the-mri-coordinate-system/855>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [October 21, 2014, 11:14am UTC](https://mne.discourse.group/t/mne-source-points-in-the-mri-coordinate-system/855 "2014-10-21T11:14:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [October 21, 2014, 11:14am UTC](https://mne.discourse.group/t/mne-source-points-in-the-mri-coordinate-system/855/1 "2014-10-21T11:14:10Z")

</div>

Dear MNE users,

I am trying to transform the coordinates of the MNE source points (in  
"Head coordinates") of a subject to the coordinate system of the original  
anatomical MR image of the subject (in "RAS coordinates"?).

Following the description in the manual  
([http://martinos.org/mne/stable/manual/forward.html](http://martinos.org/mne/stable/manual/forward.html)) it seems that I have  
to apply two coordinate transformations to these points: from "Head  
coordinates" to "Surface RAS coordinates" and from "Surface RAS" to "RAS  
coordinates".

I have extracted the two transformations by using these commands:  
mne\_show\_fiff --in example\_subject/mri/T1-neuromag/sets/COR.fif --verbose  
mne\_make\_cor\_set --mgh example\_subject/mri/orig.mgz --verbose

The commands output the following lines:

head -\> MRI (surface RAS)  
&nbsp;&nbsp;0.99551 -0.04669 -0.08235 0.57  
&nbsp;&nbsp;0.02221 0.96082 -0.27627 -13.19  
&nbsp;&nbsp;0.09202 0.27320 0.95754 -22.42  
&nbsp;&nbsp;0.00000 0.00000 0.00000 1.00

Coordinate transformation: MRI (surface RAS) -\> RAS (non-zero origin)  
&nbsp;&nbsp;&nbsp;1.000000 0.000000 0.000000 0.46 mm  
&nbsp;&nbsp;&nbsp;0.000000 1.000000 0.000000 42.65 mm  
&nbsp;&nbsp;&nbsp;0.000000 0.000000 1.000000 -11.77 mm  
&nbsp;&nbsp;&nbsp;0.000000 0.000000 0.000000 1.00

If I understood correctly, applying these transformations to the  
coordinates of the MNE source points listed in the file  
'example\_subject-7-lh.pnt' in the bem directory should then give me the  
source points in the original MRI coordinate system. However, these  
transformed coordinates are nowhere near the cortical surface in the  
original anatomical MR image (they are off tens of centimeters).

(the first few lines of the 'example\_subject-7-lh.pnt' file are as follows:  
# CoordinateSystem "Head"  
# X (mm) Y (mm) Z (mm)  
-15.949615 -101.250862 10.354758  
-11.817389 -99.757225 24.933018  
-8.782373 -99.445816 11.100106  
-15.355161 -100.348282 7.023144  
...)

Where is the error in these steps? Is there an easier way to get the MNE  
source points in the original anatomical MRI coordinate system? Any help  
clarifying these coordinate systems and their transformations is  
appreciated.

Thanks,  
--Jukka Saari

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [October 21, 2014, 12:10pm UTC](https://mne.discourse.group/t/mne-source-points-in-the-mri-coordinate-system/855/2 "2014-10-21T12:10:16Z")

</div>

The easiest way is to read the source spaces from the source space file in Matlab or Python. The coordinates are then directly the surface RAS coordinates and a simple origin shift is needed to transform to the non-zero origin RAS.

- Matti

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [October 21, 2014, 2:47pm UTC](https://mne.discourse.group/t/mne-source-points-in-the-mri-coordinate-system/855/3 "2014-10-21T14:47:52Z")

</div>

Reading the source points from the file example\_subject-7-src.fif in  
Python and transforming these points with the Surface RAS -\> RAS  
transformation solved the problem. Thank you!

--Jukka
