# convert from vertex number to MNI

**URL:** <https://mne.discourse.group/t/convert-from-vertex-number-to-mni/209>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [March 10, 2010, 12:21am UTC](https://mne.discourse.group/t/convert-from-vertex-number-to-mni/209 "2010-03-10T00:21:30Z")\
**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:** [March 10, 2010, 12:21am UTC](https://mne.discourse.group/t/convert-from-vertex-number-to-mni/209/1 "2010-03-10T00:21:30Z")

</div>

Hi,

I see that in mne\_analyze it's possible to get the MNI coordinates for selected vertices. How can I have access to the transformation used there? In other words, if I have a list of vertices in matlab, how can I get their MNI coordinates (and vice-versa)?

Thanks,

Gus

---

<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:** [March 10, 2010, 12:42am UTC](https://mne.discourse.group/t/convert-from-vertex-number-to-mni/209/2 "2010-03-10T00:42:25Z")

</div>

Hi Gus,

> I see that in mne\_analyze it's possible to get the MNI coordinates  
> for selected vertices. How can I have access to the transformation  
> used there? In other words, if I have a list of vertices in matlab,  
> how can I get their MNI coordinates (and vice-versa)?

I a few easy steps:

1. Use mne\_collect\_transforms to make a fif file containing all the  
coordinate transforms you need, see Section 9.9 in the MNE manual.

In Matlab:

2. Load the surface(s) of interest using mne\_read\_surfaces or  
mne\_read\_source\_spaces

3. Using mne\_transform\_coordinates, transform the coordinates of the  
vertices in the structures returned in step 2 to the desired  
coordinate frame.

I hope this helps,  
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:** [August 2, 2010, 7:10pm UTC](https://mne.discourse.group/t/convert-from-vertex-number-to-mni/209/3 "2010-08-02T19:10:57Z")

</div>

Hi,

> I a few easy steps:
> 
> 1. Use mne\_collect\_transforms to make a fif file containing all the  
> coordinate transforms you need, see Section 9.9 in the MNE manual.
> 
> In Matlab:
> 
> 2. Load the surface(s) of interest using mne\_read\_surfaces or  
> mne\_read\_source\_spaces
> 
> 3. Using mne\_transform\_coordinates, transform the coordinates of the  
> vertices in the structures returned in step 2 to the desired coordinate  
> frame.

When I follow these steps I get a series of errors -- I think I'm making  
syntax errors somewhere along the way but can't determine where. I'm doing:

[src] =  
mne\_read\_source\_spaces('SUBJECTS\_DIR/SUBJECT/bem/SUBJECT-oct-6-src.fif');

and

[trans\_pos] =  
mne\_transform\_coordinates('SUBJECT\_xforms.fif',src(1,2).tris,'FIFFV\_COORD\_HEAD','FIFFV\_COORD\_MNI\_TAL');

The errors include:

Error in ==\> mne\_transform\_coordinates at 85  
if (from == FIFF.FIFFV\_COORD\_HEAD && isempty(T0)) || isempty(T1) ||  
isempty(T2) ||

??? Error using ==\> eq  
Matrix dimensions must agree

and

??? Error using ==\> mne\_transform\_coordinates at 103  
Input data must be in MEG head or surface RAS coordinates

depending on what I comment out in troubleshooting. Can you see anything  
obvious that I've done wrong? I've been using the 2009-04-27 version of  
mne\_transform\_coordinates that was included in MNE 2.7.0-3106. The matrix  
from the SUBJECT\_xforms.fif file is given below.

Thanks

Jon Houck

Coordinate transformation: MEG device -\> head  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.999839 -0.010549 -0.014511 -0.32 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.013018 0.983165 0.182259 1.43 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.012344 -0.182419 0.983144 61.88 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 0.000000 0.000000 1.00  
Coordinate transformation: MRI (surface RAS) -\> head  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.997896 0.029082 -0.057949 -1.16 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-0.011038 0.956921 0.290140 17.67 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.063891 -0.288890 0.955228 46.51 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 0.000000 0.000000 1.00  
Coordinate transformation: MRI (surface RAS) -\> RAS (non-zero origin)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.000000 0.000000 0.000000 4.31 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 1.000000 0.000000 60.02 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 0.000000 1.000000 3.69 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 0.000000 0.000000 1.00  
Coordinate transformation: RAS (non-zero origin) -\> MNI Talairach  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.972405 -0.036926 -0.098139 -2.42 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.051778 1.001975 0.163707 -71.57 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.080551 -0.169009 1.019200 0.88 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 0.000000 0.000000 1.00  
Coordinate transformation: MNI Talairach -\> Talairach (MNI z \> 0)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.990000 0.000000 0.000000 0.00 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 0.968800 0.046000 0.00 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 -0.048500 0.918900 0.00 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 0.000000 0.000000 1.00  
Coordinate transformation: MNI Talairach -\> Talairach (MNI z \< 0)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.990000 0.000000 0.000000 0.00 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 0.968800 0.042000 0.00 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 -0.048500 0.839000 0.00 mm  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.000000 0.000000 0.000000 1.00  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20100802/58b223a8/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20100802/58b223a8/attachment.html)
