Help needed plotting ECoG electrodes in anatomical surface

Hi,

I am new to brainstorm. I want to plot ECoG electrodes on average freesurfer brain.
I have the xyz coordinates of electrodes in form of .mgrid file.
Specifically,
I want to know what kind of file format I would need to put the location and name into for loading them. I tried loading a few by editing the channel_ctf_default.mat file (replacing my locations and electrode type as ecog). It doesn’t work. Is there another way to do this?

Hello,

I don’t know what is in this .mgrid file. Where does it come from, and what information does it contain?

What you need is a simple text file containing the position of all the ECOG contacts, together with the position of the three fiducials NAS/LPA/RPA.
You can search for “SEEG” or “ECOG” on the forum (this registration problem is common with intra-cranial recordings):
http://neuroimage.usc.edu/forums/showthread.php?1958-SEEG-electrodes-and-subject-s-anatomy-are-not-alligned
http://neuroimage.usc.edu/forums/showthread.php?2206-SEEG-channel-MNI-coordinates
http://neuroimage.usc.edu/forums/showthread.php?2357-Importing-EEG-positions-(intra-cranial-EEG)

Cheers,
Francois

Thanks Francois,
mgrid files basically have names and location of electrodes in x y z coordinates. I tried putting them in a .txt file and feeding it in but brainstorm doesn’t read it. I think I am not using the precise format needed. Do you have a dummy .txt file I could use to modify and feed in my locations? (my email is pmp2138@columbia.edu). Also I have the x y z (‘mri’) locations. Do I need to convert them in ‘scs’ format and put in the .txt file? And how do I get the location of the three fiducials NAS/LPA/RPA if I only have the ‘mri’ coordinates of electrodes?
Pardon me if my questions are too basic.
I could manually plot the electrodes as described in many threads but want to automate the process.

Do you have a dummy .txt file I could use to modify and feed in my locations?

When you import the channel file (or use the menu “Add EEG positions”, as in here), you can select from a large variety of standard file formats. The most standard are maybe “EEG: ASCII: Name,XYZ” and “EEG: ASCII: XYZ,Name” .
These file formats are very simple: one line = one coordinate, values separated with spaces or tabs, if possible in meters. Example “Fp1 -0.013 0.031 0.004”

how do I get the location of the three fiducials NAS/LPA/RPA if I only have the ‘mri’ coordinates of electrodes?

How did you get the position of your contacts? From a neuronavigation software, or a registration with a CT scan?
If so, could you also mark the position of the same NAS/LPA/RPA points that you defined in the Brainstorm, and export them together with the position of all the contacts?
Note that “mri” coordinates do not mean the same thing in different programs… Brainstorm “mri” coordinates use the CTF MEG standard, and is most likely different from the “mri” coordinates of your ECOG contacts.
http://neuroimage.usc.edu/brainstorm/CoordinateSystems

Pardon me if my questions are too basic.

This is definitely not basic, lots of people are struggling with the same problem…
We still do not have a correct tutorial to explain all this, but hopefully later this year.

Francois

Thanks a lot Francois. This is very helpful.

I tried importing a .txt file that looks like this (a segment from one of the files from a thread) just to check if I can plot dummy electrode locations. The file reads like this:
94 202 99 NAS
25 112 93 LPA
163 111 93 RPA
178.79 127.71 44.59 a1
178.49 122.16 44.59 a2
178.44 117.12 44.59 a3

Brainstorm gives the following warning,
BST> Warning: No channel information was read from the file.
What am I doing wrong?

Also, the coordinates mentioned in the .txt file have to be in ‘scs’ format or ‘mri’ coordinates will do?

Finally, the ‘mri’ coordinates I have are the x y z coordinates in voxel space of brainmask.nii file (freesurfer). Do you know how to convert them to CTF MEG std?

Thank you for helping out.

Best,
Prachi

BST> Warning: No channel information was read from the file.
What am I doing wrong?

You are probably not selecting the appropriate file format.
When using the menus “Import channel file” or “Add EEG positions”, you need to select a file format that correspond to what is inside the file. For the example you posted, you should select “EEG: ASCII: XYZ, Name”.

Also, the coordinates mentioned in the .txt file have to be in ‘scs’ format or ‘mri’ coordinates will do?

If you have the points NAS/LPA/RPA defined in your file, the coordinates will be converted automatically to SCS, no matter what the original coordinate system is. So any MRI coordinate system is fine.

Finally, the ‘mri’ coordinates I have are the x y z coordinates in voxel space of brainmask.nii file (freesurfer). Do you know how to convert them to CTF MEG std?

I don’t think so, unless the referential used in your file is a right-handed coordinate system.
This automatic alignment works only if the input coordinates are in a left-handed coordinate system (such as the SCS and CTF MRI ones).
https://www.evl.uic.edu/ralph/508S98/coordinates.html

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:
http://neuroimage.usc.edu/brainstorm/Tutorials/Epileptogenicity

Thanks Francois!
It looks great. Incorporating coregisteration is very helpful. I’ll try it out with our data.

Best,
Prachi