Import ECoG contact positions with MNI coordinates

Hi Francois,

I am trying to import MNI normalized ECoG positions into brainstorm to visualize it with the MNI normalized individual MRI (ECoG contact positions are extracted in MNI space). As far as I understand it, I need a translation form the MNI space to brainstorm’s SCS. This translation should already by available within brainstorm, as both values are displayed for the Colin 27. Could you create an import option for the channel file that applies this transformation to e.g. a m-file or textfile?

Thanks a lot!


Hi Marcel,

I will do this when I get back to working with intra-cranial recordings.
I have many features to implement to import or mark implanted electrodes positions. I will do it all at once, like I did with the epilepsy/EEG tutorials. Hopefully this summer or fall.

Until then, I recommend you do this manually.
I added a small function cs_mni2mri to convert easily from MNI to MRI coordinates (then you can convert from MRI to SCS). See the examples at the bottom of the following page:

Let me know if you need further help with those coordinates conversions.

Hi Francois,

for some of the MRIs that I imported into brainstorm I do not have the fields R & T in the struct MRI.NCS. I tried to create them similar to what you suggested for missing R & T for MRI.SCS. I used trans = cs_mri2mni(MRI) but trans remained empty.
I do not understand at what point you create R & T for the MRI.NCS within brainstorm.

In one subject I had MRI.NCS R & T and I used your scripts in the following way:

% mni coordinates of points from mm to m
MNI = H.mni./1000;

% MNI to MRI (m, m)
P_MRI = cs_mni2mri(MRI, MNI’.* 1000)’ ./ 1000;

% MRI to SCS
P_scs = cs_mri2scs(MRI, P_MRI’ .* 1000)’ ./ 1000;

In the end the coordinates were within the head but still not aligned. Am I doing anything wrong with your scripts?


Hi Marcel,

The MNI coordinates are calculated and displayed only for the Colin27 and ICBM152 templates (the only ones that are in MNI stereotaxic space).
We usually do not work with individual MRI volumes that have been normalized to the MNI stereotaxic space, so this case is not handled well yet in Brainstorm.
To force Brainstorm to consider your MRI structure to be in a valid MNI space, you have to rename it first to “Colin27” (or simply “MNI” with today’s version).

MRI.Comment = 'Colin27';
trans = cs_mri2mni(MRI);

I have changed several things in the processing of the “MNI coordinates” in the last few months, so if you want accurate coordinates conversions I would recommend that you recalculate all the transformations instead of using the ones that are already in the MRI files from previous studies.
Except for that I think your script is correct.

Let me know how it goes.

Thank you for your help Francois! This way it works!


FYI: We improved significantly the tools available in Brainstorm for processing and visualizing SEEG and ECOG data, including new options for volume coregistration. They are now documented in a new tutorial: