[TUTORIAL UNDER CONSTRUCTION]

FEM tutorial: MEG/EEG Median nerve stimulation

Authors: Takfarinas Medani, Juan Garcia-Prieto, Wayne Mead.

This tutorial introduces the FEM modeling in the Brainstorm environment.

Note that the operations used here are not detailed, the goal of this tutorial is not to introduce Brainstorm to new users. For in-depth explanations of the interface and theoretical foundations, please refer to the introduction tutorials.

In this tutorial, we describe the full FEM process as described in the SPIE paper

License (to check with Juan/John)

This tutorial dataset (MEG/EEG and MRI data) remains proprietary of xxxxyyyy. Its use and transfer outside the Brainstorm tutorial, e.g. for research purposes, is xxxx yyy. (allowed /prohibited /request)

Requirements

You have already followed all the introduction tutorials and you have a working copy of Brainstorm installed on your computer. If you wan to reproduce this tutorial on your computer you need also to have these tools installed in your computer: SimNibsand BrainSuite. Check this tutorial for further information about these tools.

Description of the experiment (todo: Juan) only one file?

The experiment consists of two stimulation protocols being conducted during a single scanning session in a MEG laboratory with an Elekta Triux (Megin, Finland) scanner. The subject is a right-handed 46 years old male. The two stimulation protocols consist of unilateral median nerve stimulation and an eyes-closed resting-state recording.

Median nerve stimulation:

Resting-State protocol:

Download and installation

Import the MRIs

[ATTACH]

Head model construction

FEM head model

The first step requires the generation of the FEM head model, where the MRIs are segmented into the main issues and then tesselated into hexahedral or tetrahedral elements. The available methods within Brainstorm are listed in this page.

In the following tutorial, the SimNibs method is used

In order to use the call SimNibs you need to have it installed on your computer, please follow the instruction as explained in here.

Keep all the options to their default values.

Depending on your computer performance, this process can take 2 to 4 hours, so be patient.

[ATTACH]

At the end of this computation, Brainstorm will populate the windows with the following nodes

At the end of the process, make sure that the file "cortex_15002V" is selected (downsampled pial surface, which will be used for the source estimation). If it is not, double-click on it to select it as the default cortex surface.

Remesh the head model

In some cases, from our experiences, the FEM mesh generated with SimNibs may have some issues with the DUNEuro FEM solver, this issue is mainly related to the air cavities in the head model as well as the hole. In order to avoid these possible issues in the next steps, we will correct the mesh using the FEM mesh tools integrated within Brainstorm.

remeshHeadIso2mesh.jpg

The following figure shows the two model, left is the initial model obtained with SimNibs, right is the second model obtained from the Iso2Mesh re-mesh

femMeshSimNibsVSiso2mesh2.jpg

You can also use this process to generate FEM model with high mesh densities.

FEM tensors

The FEM has the ability to incorporate anisotropic conductivity, es[acially for the white matter. Brainstorm offers the known methods to estimate the tensors from the DWI data. For a more detailed example please refere to this page.

There are two main phases to compute the tensors, the first is the computation of the DTI from the DWI. The second is the estimation of the conductivity tensors from the DTI on each of the FEM mesh elements.

Step one:

[ATTACH]

BrainStorm will call internally the Brainsuite Software to compute the DTI. This process can take up to 20 minutes. At the end of this process, a node will appear in the Brainstorm database explorer under the name "DTI-EIG", this is a volume data that contains the 12 values of the eigenvalues and eigenvectors at each voxel.

Explanation of the options:

Brainstorm recognizes the tissue listed on the FEM had and assigns the default isotropic conductivities, as shown on the panel, users can change and use their own values.

When the DWI data are computed, the conductivity tensors can be estimated on the white matter tissues using the Effective Medium Approach (EMA), Brainstorm offers two option, the EMA with a fixed factor k=0.736, or the EMA with the volume constraint (EMA+VC), please refer to this tutorial and the cited publication for further information.

Step two:

Once the DTIs are computed,

[ATTACH]

This process can take up to 5min, depending on the resolution of the FEM mesh.

Visualisation of the FEM mesh and tensors

Brainstorms include the possibilities to display the FEM head models and the tensors, users can also overlay the display with the MRI as well as with the different surfaces.

overlayModalities.png

The FEM tensors can be also displayed either on the mesh or on the MRI, to do so, right-click on the FEM mesh, then "Display FEM tensors", you can choose the displaying mode, the tensors can be displayed either as arrows (line) on the main eigenvector or as ellipsoids, on each FEM element (tetrahedron).

dispTensorMenu.png

tensorsOnBrain.jpg

tensorsOnMRI.jpg

The size of the displayed tensors can be changed from the keyboard with the "Up" or "Down " arrows keys. You can also switch the display mode (from lines to ellipsoids to line or inversely) by using the shortcut "Shift + Space".

BEM head model

We will generate also the BEM surfaces for this subject and we will follow the same step as explained in this page. The obtained surfaces will be used later for the BEM source computation.

Richt-click on the subject and then "Generate BEM surfaces", then keep the default options (1922 ver)tices for each layer.


/!\ Edit conflict - other version:



/!\ Edit conflict - your version:



/!\ End of edit conflict


Advanced

On the hard disc

The "DTI-EIG" is saved structure as the Brainstorm MRI format, but it contains 12 values, from 1 to 9: components of the three eigenvectors, and from 10 to 12, the values of their norm to the eigenvalue.

The FEM mesh, as shown in the figure, contains the following fields

the 12 values are the eigenvalues and eigenvectors interpolated on each element of the mesh.

femDataOnHardDisc.png

Access the recordings

[ATTACH]

Prepare the channel file

Refine the MRI registration

[ATTACH]

Read the stimulation information

[ATTACH]

In the Record tab, menu File > Read events from channel.

[ATTACH]

Pre-processing (todo: not reauired?)

Evaluate the recordings

psd.jpg

Frequency filters

freqFilters.jpg

Review the recordings

EEG: Average reference

avgRef.jpg

Artifacts cleaning with ICA [@Juan/John seems not required?]

More information about ICA.

EEG: Heartbeats and eye movements

MEG: Heartbeats and eye movements

====> the data seems to be clean no artefcat detected using the ICA ===> already cleaned with tsss filters ? @ juan

[ATTACH]

Epoching and averaging

Import the recordings

In this experiment, the electric stimulation is sent with a frequency of 2Hz, meaning that the inter-stimulus interval is 500ms. We are going to import epochs of 400ms around the stimulation events.

importEpochs.jpg

In the end, you are asked whether you want to ignore one epoch that is shorter than the others. This happens because the acquisition of the MEG signals was stopped less than 450ms after the last stimulus trigger was sent. Therefore, the last epoch cannot have the full [-50,250]ms time definition. This shorter epoch would prevent us from averaging all the trials easily. As we already have enough repetitions in this experiment, we can just ignore it.

Averaging

avrgEpochs.jpg

Review the average for the MEG and EEG as a topography plot -Right-click on the averaged signal -EEG (then MEG) > 2D disc

megEegTopography.jpg

AT the selected time, an ERP is visible with a nice dipolar pattern on the sensors, both for the EEG and MEG.

Source estimation

EEG Head model

IMPORTANT: When using the high mesh resolution model we recommend computing separately the head model for each modality. However, you can compute simultaneously both modalities.

The EEG/MEG FEM computation depends on the computation of the FEM transfer matrix, and the computation of this matrix is related to the resolution of the mesh (number of vertices) and the number of sensors. In most of the case, the number of EEG sensors is lower than the number of MEG sensors. Furthermore, internally the MEG sensors modeling uses the integrations points, which increase the number of computation points (~ multiplied by 4 for the magnetometers and by 8 for the gradiometers). Therefore the MEG requires more time than the EEG.

To reduce the MEG computation time, there are some tips :

  1. Use only the inners tissues (wm, gm, and CSF) ==> reduce the number of vertices

  2. Do not use the integration points ==> reduce the number of virtual sensors

  3. These parameters can be tuned from the DUNEuro Options panel (see the advanced panel)

In this tutorial, we will separate the modalities.

EEG Head model with DTI tensors

eegDuneuroPanels.jpg

The FEM EEG head modeling will start and depending on the performance and the workload of your computer, it can last between 30min to 2 hours.

Once the computation is done, a new node with the name "DUNEuro FEM EEG DTI tensors"

appear on the Brainstorm database navigator, which can be used for the source localization process.

EEG Head model with isotropic conductivity

In the case where the DTIs are not available, or if the users want to use the isotropic conductivity, the following section explains how to do it.

eegDuneuroPanelsIso.jpg

In this tutorial, now we have two models, this is a good option to compare if there is any difference between the isotropic model and the anisotropic model.

[ATTACH]

MEG Head model

As for the EEG, the same steps are required for the MEG.

MEG Head model with DTI tensors

megDuneuroPanelsDTI.jpg

The FEM MEG head modeling will start and depending on the performance and the workload of your computer, it can last between 1hour to 4 hours (even more if you select all the tissues).

Once the computation is done, a new node with the name "DUNEuro FEM MEG DTI tensors" appears on the Brainstorm database navigator, which can be used for the source localization process.

MEG Head model with isotropic conductivity

In the case where the DTIs are not available, or if the users want to use the isotropic conductivity, the following section explains how to do it.

megDuneuroPanelsIso.jpg

In this tutorial, now we have two models, this is a good option to compare if there is any difference between the isotropic model and the anisotropic model.

Noise covariance matrix

Enter the same baseline interval we used for removing the DC offset: [-50, -10] ms noiseCovariance.jpg

Inverse model(to check)

Repeat the same operation for MEG and make sure to select the appropriate head model at each step.

computeDipolesInverseAll.jpg

It is better to study separately the two modalities because the method for combining MEG and EEG are not working well yet.

This operation creates a shared inversion kernel and one source link for each block of recordings in the folder.

[ATTACH]

Drag and drop the Dipoles kernels in the Process table and select the process > Run> Dipole Scanning>

dipoleScanningProcess.jpg

If you are not familiar with those concepts, please refer to the Source estimation tutorial.

Once the dipoles are computed, we display both EEG and MEG separately in the following figures. We merge the MEG ISO and the MEG DTI dipoles as well as the EEG dipoles.

dipolesMergeEEG&MEG.jpg

The following figures (left EEG, right MEG), show the localization of the dipoles on the MRI

eegMegDipolesSagittal.jpg eegMegDipolesSagittal.jpg eegMegDipolesCoronal.jpg

Once

Display the sources for the MEG (top) and the EEG (bottom) (Image for the DIPOLE FIT MODEL)

[ATTACH]

[ATTACH]

In this experiment, the anisotropy does not show any effects on the source localization.

Inverse model with BEM and OS

In order to compare qualitatively the results of the FEM models, we will use the previous methods already implemented in Brainstorm.

For the EEG: compute the forward using the BEM and the spherical head

For the MEG: compute the forward using the BEN and then the OS

For all the methods, we will perform the dipole fitting as sown in this figure

EEG: dipoles fit (FEM iso => green, 3shells => red, BEM => blue)

[ATTACH]

MEG: dipoles fit (FEM iso => green, OS => red, BEM => blue)

[ATTACH]

left EEG/ right MEG

[ATTACH]


/!\ Edit conflict - other version:


left EEG/ right MEG

[ATTACH]


/!\ Edit conflict - your version:



/!\ End of edit conflict


Regions of interest(TODO)

Scripting (TODO)

DUNEuro advanced options (TODO)

Troubles and solution(TODO)

Dipoles outside of the grid for the MEG: remove this dipole or replace it with its spatial neighbors (not the neighbor in the list) ==> not easy to handle write small tuto ?

Tutorials/FemMedianNerve (last edited 2021-04-06 20:02:13 by TakfarinasMedani)