Brainstorm user forum: MEG/EEG source imaging

Go Back   Brainstorm user forum: MEG/EEG source imaging > BrainStorm3 > Open discussion

Reply
 
Thread Tools Display Modes
  #1  
Old November 5th, 2009, 08:19
haziran15 haziran15 is offline
Junior Member
 
Join Date: Oct 2009
Location: Michigan State University, East Lansing, USA
Posts: 4
haziran15 is on a distinguished road
Default EEG Head Model ?

Hi everyone;

I'm a very new Brainstorm user and I have been trying to compute a head model for EEG. The tutorial only explains how to compute a forward model for MEG. In fact, there is an open discussion on "http://neuroimage.usc.edu/forums/showthread.php?t=190&highlight=EEG+Tutorial", however, I didn't find it very clear to understand. Could anybody help me and explain the steps (in a simpler and clear way) to obtain a head model for EEG ?

Thanks...
Ali
Reply With Quote
  #2  
Old November 5th, 2009, 10:13
Francois Francois is offline
Software Engineer of BrainStorm
BrainStorm DeveloperSite Admin
 
Join Date: Feb 2007
Posts: 48
Francois is on a distinguished road
Default

Hi Ali,

The post you cite is relative to Brainstorm2. Brainstorm is now a completely different software, so those old posts will not help you much...

Writing at least one tutorial for EEG is one of our (many) priorities, so it will be available maybe by the beginning of 2010.

In the meantime, the MEG tutorial should explain almost everything you need.
The main difference with EEG is that you have to import your own EEG caps (3D positions of the electrodes), or use a default one.
=> Right click on condition > Import channel file, or Use default EEG cap;
=> then Register EEG-MRI > Manual registration

Brainstorm currently supports EEG systems from: EGI, Neuroscan, Brainamp, and any other system that can export EEG recordings in ASCII.

Let me know if need more information.
Francois
Reply With Quote
  #3  
Old November 5th, 2009, 13:31
haziran15 haziran15 is offline
Junior Member
 
Join Date: Oct 2009
Location: Michigan State University, East Lansing, USA
Posts: 4
haziran15 is on a distinguished road
Default

Thank you very much Francois. I just followed the instructions you gave:

After creating a protocol and importing the individual anatomy as in Tutorial 2, I jumped to the Tutorial 5 and followed your instructions. I used a default EEG cap ( MNI_Colin27 10-20(19) ) and checked EEG-MRI registratio. Finally I clicked "Compute head model". I guess this gives the head model that I was looking for.

Now the question is: Is there a need for importing EEG recordings to compute the forward model? Because in the tutorial 3, MEG recordings were imported before computing the forward model in Tutorial 5. However; I`m trying to obtain the EEG recordings which are expected to be altered by volume conduction.

And my last question is: How can I model the EEG sources? I just want to assign some sinusoidal functions with different frequecy or phases to the sources used to construct the forward matrix. Thank you for your help again.
Best;

Ali
Reply With Quote
  #4  
Old November 5th, 2009, 16:49
Francois Francois is offline
Software Engineer of BrainStorm
BrainStorm DeveloperSite Admin
 
Join Date: Feb 2007
Posts: 48
Francois is on a distinguished road
Default

Quote:
Is there a need for importing EEG recordings to compute the forward model?
Recordings and headmodels are independent. You can compute the forward model without recordings.

In the tutorials we import them before because it is usually this way one proceeds: you analyze your recordings first at the sensor level, and then at the source level (forward + inverse models).

Quote:
How can I model the EEG sources? I just want to assign some sinusoidal functions with different frequency or phases to the sources used to construct the forward matrix.
I will create an interface to do that easily, but not now (maybe next year).
Now, what you can do is just simulate your sources activities, and multiply them by the forward matrix:
1) Create a [nSources, nTime] matrix
2) The sources are the vertices of the cortex surface. To get them in your Matlab workspace, go to the "Anatomy" view of the database, right click on the cortex, and select menu: File > Export to Matlab.
3) Get the headmodel matrix the same way ("Gain" field)
4) Simulation at the electrodes level will be given by: Gain * Sources

Francois
Reply With Quote
  #5  
Old November 8th, 2009, 18:29
haziran15 haziran15 is offline
Junior Member
 
Join Date: Oct 2009
Location: Michigan State University, East Lansing, USA
Posts: 4
haziran15 is on a distinguished road
Default

Sorry for asking so many questions but I still have some questions Francois :

[\QUOTE]I will create an interface to do that easily, but not now (maybe next year).
Now, what you can do is just simulate your sources activities, and multiply them by the forward matrix:
1) Create a [nSources, nTime] matrix
2) The sources are the vertices of the cortex surface. To get them in your Matlab workspace, go to the "Anatomy" view of the database, right click on the cortex, and select menu: File > Export to Matlab.
3) Get the headmodel matrix the same way ("Gain" field)
4) Simulation at the electrodes level will be given by: Gain * Sources [\QUOTE]

Since I followed the instructions in the tutorials, there are 15028 sources on the Cortex surface. Hence, I created a source matrix which is customized as follows :

Sources=zeros (15028,12
Sources(1,: )=cos(0.4*pi*(0:1/127:1) )
Sources(2,: )=cos(0.01*pi*(0:1/127:1) )

We have 128 time samples and 15028 sources. I only customized the first 2 sources just to have a different matrix from all zeros matrix.


I exported the sources to MATLAB with the name "Cor1" as follows:

Data exported as "Cor1"
Cor1
Cor1 =
Vertices: [3x15028 double]
Faces: [29899x3 double]
Comment: 'cortex_brvisa_15000V'
VertConn: [15028x15028 logical]
VertNormals: [3x15028 double]
Curvature: [15028x1 single]

Now, my question is: How can I associate the sources data ("Cor1") given by Brainstorm and my own "Sources" matrix that was customized by me? Because the Vertices field has [3x15028 double] matrix and my sources matrix is 15028x128.
And I want to assign my own signals to each source on the cortex.


I got the headmodel matrix as:

Data exported as "gain"
>> HeadModel
HeadModel=
MEGMethod: ''
EEGMethod: 'eeg_3sphereBerg'
Gain: [19x45084 single]
HeadModelName: '3-shell Sphere (BERG)'
HeadModelType: 'ImageGrid'
GridLoc: [3x15028 double]
GridOrient: [3x15028 double]
SourceOrder: -1
SurfaceFile: '@default_subject/tess_cortex_crtex_brvisa_15000V.mat'
Param: [1x19 struct]


The "Gain" field of "HeadModel" is a [19x45084 single] matrix and as we see, 45084 is 3 times the 15028. In order to get the simulation at electrodes (19 electrodes and 128 time samples), I need a source matrix (SRC) which must be 45084x128. (electrode (19x12 = Gain(19x45084) * SRC(45084x12 ). I think "SRC" matrix should be formed using "Sources" matrix that I formed and "Cor1.Vertices" given by Brainstorm. But I don't know how to do this. I hope I could have explained my questions very well.

If you can clarify these points, I would really appreciate Francois, thank you very much...
Reply With Quote
  #6  
Old November 10th, 2009, 10:31
Francois Francois is offline
Software Engineer of BrainStorm
BrainStorm DeveloperSite Admin
 
Join Date: Feb 2007
Posts: 48
Francois is on a distinguished road
Default

Hi Ali,

Quote:
I exported the sources to MATLAB with the name "Cor1" as follows:
Data exported as "Cor1"
Cor1
Cor1 =
Vertices: [3x15028 double]
Faces: [29899x3 double]
Comment: 'cortex_brvisa_15000V'
VertConn: [15028x15028 logical]
VertNormals: [3x15028 double]
Curvature: [15028x1 single]
This is not a matrix with sources activities, this is the tesselation file for your cortex. This file describes the source space but do not contain any temporal information. That is why it is displayed in the "Anatomy" part of the database, and not in the "Functional" part.

What you need to export, and the re-import in Brainstorm database is what you get in the Tutorial #6: Source estimation, with the following fields:

|- Comment: 'MN: MEG(Full)'
|- Function: 'minnorm'
|- Time: [1x375 double]
|- ImageGridTime: [1x375 double]
|- HeadModelFile: '/Subject01/StimRightThumb/headmodel_surf_meg_sphere_CD.mat'
|- SurfaceFile: 'Subject01/tess_cortex_concat.mat'
|- ChannelFlag: [182x1 double]
|- GoodChannel: [1x151 double]
|- DataFile: '/Subject01/StimRightThumb/data_Trial__1.mat'
|- Projector: []
|- ImagingKernel: []
|- ImageGridAmp: [15010x375 single]

In the ImageGridAmp field, you will find the [nSource x nTime] matrix your are looking for. (Only for results computed with "Full matrix" output option)


Quote:
The "Gain" field of "HeadModel" is a [19x45084 single] matrix and as we see, 45084 is 3 times the 15028. In order to get the simulation at electrodes (19 electrodes and 128 time samples), I need a source matrix (SRC) which must be 45084x128. (electrode (19x12 = Gain(19x45084) * SRC(45084x12 ). I think "SRC" matrix should be formed using "Sources" matrix that I formed and "Cor1.Vertices" given by Brainstorm. But I don't know how to do this. I hope I could have explained my questions very well.
What you see in the Gain field is the leadfield without constrained orientation. For each source, you have three values for three orthogonal directions. Column 1 to 3 = source 1. Columns 4 to 6 = sources 2. And so on.

If you want to work with constrained orientations (dipole orientation = the normal to the cortex surface at the corresponding vertex), use :
Gain = bst_gainApplyOrient(HeadModel.Gain, HeadModel.GridOrient);

Note: HeadModel.GridOrient (orientations of the sources) is equal to the field Surface.VertNormals (normal vector for each vertex).

I hope this is clear enough...
Francois
Reply With Quote
  #7  
Old November 11th, 2009, 07:31
haziran15 haziran15 is offline
Junior Member
 
Join Date: Oct 2009
Location: Michigan State University, East Lansing, USA
Posts: 4
haziran15 is on a distinguished road
Default

Thank you so much Francois Now it is clear.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 16:17.