[TUTORIAL UNDER CONSTRUCTION]

FEM tutorial: MEG/EEG Median nerve stimulation

Authors: Takfarinas Medani, Juan Garcia-Prieto, Wayne Mead, Francois Tadel

This tutorial introduces the FEM modeling in the Brainstorm environment, using DTI tensors and third-party programs BrainSuite, SimNIBS and CAT12.

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.

Dataset description

Experiment

The experiment consists of an unilateral median nerve stimulation conducted in a MEG laboratory with an Elekta Triux (Megin, Finland) scanner.

  • The stimulation signal was a square-wave pulse with 2Hz frequency and duration of 0.2ms.
  • An ISI (inter-stimulus interval) of 500ms with a variation of ±20ms in order to be able to average out time-locked noise to the stimulation, while remaining unnoticeable by the subject.
  • The stimulation was performed on the left hand/wrist, for two minutes, with a Digitimer DS7A stimulator. An electrode was placed on the hand/wrist while current value was tuned to match the motor threshold of the subject on the stimulated hand, with a result of 10~12mA approximately.
  • Recordings were performed with a 1kHz sampling rate. Continuous HPI was disabled during these recordings. High-pass filters were set to DC for MEG channels and 0.03Hz for EEG channels.
  • All MEG files underwent a MaxFilter (version 2.3.13) tsss post-processing.

MRI imaging scanning (Philips Medical Systems):

  • T1w image without contrast: 3T field strength, flip angle 8°, TR 7.9s, dimensions 512 × 512 × 200, and voxel dimensions of 0.469 × 0.469 × 0.939 millimeters
  • T2w spin-echo image: 3T field strength, 78.57% phase FOV, 90° flip angle, SAR 0.327, voxel dimensions 560 × 560 × 55, dimensions of 0.429 × 0.429 × 3 millimeters
  • DWI sequences: voxel dimensions 512 x 512 x 200 and dimensions of 0.469 × 0.469 × 0.939 millimeters, diffusion-sensitizing gradients in 32 non-collinear directions

Files

The dataset we distribute with this tutorial follows the Brain Imaging Data Structure (BIDS) standard for neuroimaging data organization. The files that will be imported in this tutorial are the following:

sample_fem/sub-fem01/: Raw data for subject fem01

  • ses-meg/: Simultaneous recordings of MEG and EEG.

    • sub-fem01_ses-meg_task-mediannerve_run-01_proc-tsss_meg.fif

  • ses-mri/: Imaging exams.

    • anat/sub-fem01_ses-mri_T1w.nii.gz: T1-weighted MRI

    • anat/sub-fem01_ses-mri_T2w.nii.gz: T2-weighted MRI

    • dwi/sub-fem01_ses-mri_dwi.*: Diffusion-Weighted Imaging (DWI)

License

Creative Commons CC0 1.0 Universal. This dataset is distributed in the public domain.

Download and installation

Import the anatomy

T1 MRI

T2 MRI

Diffusion imaging

The FEM has the ability to incorporate anisotropic conductivity from MRI diffusion imaging, which is particularly interesting for the modeling of the white matter. Brainstorm can load the Diffusion-Weighted Images (DWI), and compute the tensors (DTI) using the BrainSuite Diffusion Pipeline (BDP). This requires BrainSuite to be installed on your computer, with the bdp program available in the system path.

FEM head model

The FEM approach requires a segmentation of the head volume in different tissues, represented as hexahedral or tetrahedral 3D meshes. The methods available within Brainstorm are listed in the tutorial FEM mesh generation. This tutorial illustrates only the use of SimNIBS.

FEM mesh with SimNIBS

Running SimNIBS:

At the end of this computation, new files are available in the database:

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.

simnibs.gif

Remesh with Iso2mesh

In some cases, the FEM mesh generated with SimNibs causes issues with the DUNEuro FEM solver, due to the air cavities that are not tesselated. In order to avoid these possible issues in the next steps, we will correct the mesh using the Iso2mesh functions integrated within Brainstorm.

The following figure shows the two model, left is the initial model obtained with SimNibs, right is the second model obtained from the Iso2Mesh remesh: the air cavity in the bottom-right corner is now fully tesselated. Note that you can also use this process to generate FEM models with higher mesh densities.

femMeshSimNibsVSiso2mesh2.jpg

FEM tensors

We can now incorporate the diffusion information into the FEM model, and compute anisottropic conductivity tensors for the tetrahedral elements of the white matter (we consider the other tissues to have isotropic conductivities).

Visualization

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

Right-click on the FEM mesh > Display FEM tensors: The FEM tensors can be displayed on the mesh or MRI, as arrows on the main eigenvector or as ellipsoids on each FEM element.

dispTensorMenu.png

tensorsOnBrain.jpg

tensorsOnMRI.jpg

To configure the display: right-click on the figure > FEM tensors menu. The keyboard shortcuts for changing the size of the displayed tensors are the Up and Down arrows keys. You can also switch the display mode by using the shortcut "Shift + Space".

Advanced

On the hard drive

The DTI-EIG file as the same structure as any MRI file, with 12 volumes stacked along the 4th dimension. From 1 to 9: components of the three eigenvectors; from 10 to 12: the values of their norm to the eigenvalue.

The FEM mesh contains the following fields:

BEM head model

For the purpose of comparison between the FEM and the BEM, we will generate also the BEM surfaces for this subject and we will follow the same step as explained in the BEM tutorial.

Access the recordings

Channel file

Pre-processing

Frequency filters

EEG: Average reference

Epoching

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 300ms around the stimulation events (-100 to 200ms).

Averaging

Forward model

We are going to use the realistic FEM model previously generated from the MRI. Go to the "Anatomy" view, and make sure that the FEM head model is highlighted in green color (it should be the case if you have only one model). You may also highlight the cortex to use for the computation (select the cortex_15002V).

You can compute the forward model both for EEG and MEG simultaneously, however, using the high mesh resolution model we recommend to compute separately the head model for each modality (EEG and then MEG). The time required for EEG is aound one hour for ~70 channels, for the MEG with 306 sensors it can take up to 4 hours or more (with the integrations points).

The EEG/MEG FEM computation depends on the computation of the FEM transfer matrix, which is related to the resolution of the FEM head 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)

EEG with DTI tensors

MEG with DTI tensors

EEG with isotropic conductivity

If the DTIs are not available, it is possible to use the isotropic conductivities instead. In this tutorial, we will compute another forward model in order to compare the sources obtained with anisotropic or isotropic conductivities.

MEG with isotropic conductivity

Source estimation

Noise covariance matrix

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

Inverse model

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 within Brainstorm.

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

P20/N20 source localization

The following figures (left EEG, right MEG), show the localization of the dipoles on the MRI at the 21ms. The ISO model is colored in greeen wherease the DTI model is colored in red.

eegMegDipolesSagittal.jpg eegMegDipolesAxial.jpg eegMegDipolesCoronal.jpg

In this experiment, the anisotropy does not show a significant effect on the source localization, whereas it shows a slich difference in the orientation.

When we compare between the EEG and the MEG, there is a difference of 20mm between the localization between the MEG and the EEG as well as a difference in the orientation in the coronal view.

If we compare the difference between the EEG and MEG dipoles, the following figures (left anisotropy, right isotropic), show the localization of the dipoles on the MRI at the 21ms. The EEG dipole is colored in green wherease the MEG dipole is colored in red.

eegMegDipolesSagittal2.jpg eegMegDipolesAxial2.jpg eegMegDipolesCoronal2.jpg

Aniso: Eeg [-7.5 -35.7 89.8] vs Meg [-0.2 -33.6 88.6] ==> distance = 7.7mm

Iso: Eeg [-7.5 -35.7 89.8] vs Meg [-0.2 -33.6 88.6] ==> distance = 7.7mm

In both modalities, the dipoles are located exactely in the same positions, and there is 7.7mm between the two dipoles. Further more, we notice a difference on the orientation on the coronal and sagital views

Comparaison with BEM for EEG and with OS for the MEG

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 For the MEG: compute the forward using overlapping spheres,

For all the methods, we will perform the dipole scanning as done previously but with the new forward models, the results are shown in the following figures:

In the following figures, left is the dipoles computed from the EEG (BEM in red and FEM in green), right are the dipoles computed from the MEG (OS in red and FEM in green)

eegMegDipolesSagittal3.jpg eegMegDipolesAxial3.jpg eegMegDipolesCoronal3.jpg

EEG: fem [-7.5 -35.7 89.8] ; bem [-10.7 -35.0 89.5] ==> 3.3mm

MEG: fem [-0.2 -33.6 88.6] ; os [-10.7 -39.3 83.2] ==> 13.1 mm

As expeced, the slight difference on the localization can be explained by the difference on the head shape, the conductivity values as well as the resolution method.

Advanced

Resect the neck and the bottom part of the head model

The FEM computation can be time and memory-consuming, on way to reduce this issue is to remove the part of the FEM mesh that is not required.

In some cases where the field of the MRI is large, you can have the mesh of the neck and even the shoulders. In Brainstorm, it is possible to remove these parts. You can this by following these steps : right-click on the FEM-mesh => Resect Neck ==> keep the default value ==> Ok


[ATTACH]


Once the process is finished, a new FEM head model appears in the database with the same name and a prefix "resect" which is the resected head. The following figure shows the model before and after re-section.

[ATTACH]

Note that the initial model has 743828 nodes and 4079587 and the resected model has 613955 nodes and 3400957 elements.

Scripting

This section is under developement

DUNEuro advanced options

This section is under development

A set of advanced options are made available and can be easily changed. Here a short explanation is given for each option.

In this version, only the Fitted FEM approaches are integrated, that require the FEM mesh of the head model. Unfitted methods are also available within DUNEuro, and will be integrated soon in Brainstorm.

For more information about these methods, users can check this thesis (Vorwek thesis).

All these parameters are stored and passed to the DUNEuro as a text file. This file is the main interface that passes the parameters from Brainstorm to DUNEuro. More details about the integration can be found in these links:

Troubleshooting 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-08-13 09:30:39 by FrancoisTadel)