Tutorial 20: Head modelling
Authors: Francois Tadel, Elizabeth Bock, John C Mosher, Richard Leahy, Sylvain Baillet
The following tutorials describe how cerebral currents can be estimated from the MEG/EEG recordings we have processed so far. To achieve this, we need to consider two distinct modeling problems: the modeling of the electromagnetic properties of the head and of the sensor array (a.k.a. head model or forward model), and the estimation of the brain sources which produced the data, according to the head model in question. That second step is known as source modeling or solving an inverse problem. It requires that forward modeling of head tissues and sensor characteristics is completed first. This tutorial explains how to compute a head model for the participant to the auditory oddball experiment.
Why estimating sources?
Reconstructing the activity of the brain from MEG or EEG recordings involves several sophisticated steps. Athough Brainstorm simplifies the procedures, it is important to decide whether source modeling is essential to answer the neuroscience question which brought you to collect data in the first place.
If one of your primary objectives is to identify and map the regions of the brain involved in a specific stimulus response or behaviour, source estimation can help address this aspect. Empirical interpretations of sensor topographies can inform where brain generators might be located: which hemisphere, what broad aspect of the anatomy (e.g., right vs. left hemisphere, frontal vs. posterior regions). Source estimation improves anatomical resolution further from the interpreration of sensor patterns. The spatial resolution of MEG and EEG depends on source depth, the principal orientation of the neural current flow, and overall SNR: still, a sub-centimeter spatial resolution can be expected in ideal conditions, especially when contrasting source maps between conditions in the same participant. As for other imaging modalities, spatial resolution of group-level effects (i.e. after averaging across multiple participants) is limited by the notion of geometrical registration of individual brain structures, which are very variable between participants.
Source mapping is a form of spatial deconvolution of sensor data. In EEG in particular, scalp topographies are very smooth and it is common that contributions from distant brain regions overlap over large clusters of electrodes. Moving to the source space can help discriminating between contributing brain regions.
In MEG, source maps can be a great asset to alleviate some issues that are specific to the modality. Indeed in MEG and contrarily to EEG, the head of the participant is not fixed with respect to sensor locations. Hence data sensor topographies depend on the position of the subject's head inside the MEG sensor array. Therefore, between two runs of acquisition, or between subjects with different head shapes and sizes and positions under the helmet, the same MEG sensors may pick up signals from different parts of the brain. This problem does not exist in EEG, where electrodes are attached to the head and arranged according to standard positions.
Another important point to consider when interpreting MEG sensor maps and that can be solved by working in the MEG source space instead, is that MEG manufacturers use different types of sensor technology (e.g., magnetometers vs. gradiometers; axial vs. tangential gradiometers, etc. yielding different physical measures). This is not an issue with EEG, with essentially one sensor type (electrodes, dry or active, all measuring Volts).
Nevertheless, if your neuroscience question can be solved by measuring signal latencies over broad regions, or other aspects which do not depend crucially on anatomical localization (such as global signal properties integrated over all or clusters of sensors), source modeling is not required. To sort out this question will influence the time and computational resources required for data analysis (source analysis multiplies the needs in terms of disk storage, RAM and CPU performance).
The origins of MEG/EEG signals
To better understand how forward and inverse modelling work, we need to have a basic understanding of the physiological origins of MEG/EEG signals. Note that, as always with modeling, we need to deal with various degrees of approximation.
Overall, it is assumed that most of - but not exclusively - the MEG/EEG signals are generated by postsynaptic activity of ensembles of cortical pyramidal neurons of the cerebral cortex. The reason is essentially in the morphology and mass effect of these cells, which present elongated shapes, and are grouped in large assemblies of cells oriented in a similar manner along the cortex. Mass effects of close-to-simulatenous changes in post-synaptic potentials across the cell group add up in time and space. These effects can conveniently be modeled at a mesoscopic spatial scale with electric dipoles distributed along the cortical mantle (green arrows in figure below). Note that there is growing evidence that MEG and EEG are also sensitive to deeper, cortical and subcortical structures, including brain nuclei and the cerebellum. Brainstorm features advanced models of these structures, as an option to your analysis. The emphasis in this tutorial is on cortical source models, for simplicity.
The primary and volume currents generated by current dipoles create differences in electrical potentials and magnetic fields that can be detected outside the head. They can be measured with electrodes placed on the skin (EEG, with respect to a reference) or very sensitive magnetic detectors (MEG).
- Matti Hamalainen, 2007
Dipole fitting vs distributed models
MEG/EEG source estimation consists in modeling brain activity with current dipoles. A current dipole is a convenient model equivalent to the net post-synaptic electrophysiological activity of local assemblies of neurons. Two main approaches have been explored for source MEG/EEG estimation: dipole fitting methods - where the position and amplitude of one to a few equivalent current dipoles (ECD) are estimated over relatively short time windows - and distributed models - where the location (and typically, the orientation) of a large number dipoles is fixed; the dipoles sample a spatial grid covering the entire brain volume or the cortical surface - requiring estimation of the amplitude of a vast sample of dipoles in a fixed grid at each time point.
Equivalent dipole fitting approaches are quite straightforward and can be adequate when the number of brain regions expected to be active is small (ideally only one). Therefore, it is most adequate for responses at early post-stimulus latencies. They cannot generalize to capture complex dynamics over extended period of time (epochs) and the associated estimation techniques are quite sensitive to initial conditions (how many dipoles to fit? where does the search start? etc). Our strategy in Brainstorm is to promote distributed source models, which are less user dependent, can generalize to all experimental conditions, and yield time-resolved image volumes that can be processed in many different, powerful ways (group statistics, spatial segmentation, use of regions fo interest, correspondence with fMRI, etc.)
When opting for distributed source models, the positions and orientations of the elementary dipoles that will define the "voxel" grid of the source images produced need to be defined. This set of dipoles is called the source space. By default, Brainstorm constrains the source space to the cortex, where signal-to-noise and sensitivity is maximum in MEG/EEG. Note however that more complete models that include subcortical structures and the cerebellum are available in Brainstorm. Therefore, one decision you need to make before proceeding with source imaging is whether more complete source spaces are required to answer your neuroscience question.
For this tutorial, we use the simple approach where current dipoles are automatically assigned to each of the vertices of the cortical surface (see the nodes in the grey mesh in the leftmost image below). When importing the anatomy of the subject, we downsampled the cortex surface to 15,000 vertices.
This default number of 15,000 vertices is empirical. In our experience, this balances the adequate geometrical sampling of cortical folds with the volume of data to be analyzed. To use a smaller number of vertices (sources) oversimplifies the shape of the brain; to use more vertices yields considerably larger data volumes, without necessarily adding to spatial resolution, and may lead to practical hurdles (CPU and memory issues.)
After defining the locations of the dipoles, we also need to define their orientations. Brainstorm efatures two main options: unconstrained dipole orientations or orientations constrained perpendicularly with respect to the cortical surface.
In the unconstrained case, three orthogonal dipoles are assigned to each vertex of the cortex surface. This triplet can account mathematically for local currents flowing in arbitrary directions. The total number of elementary sources used in that case amounts to 45,000 dipoles (3 orientations x 15,000 vertices).
In the constrained case, one dipole is assigned to each vertex with its orientation perpendicular to the cortica surface. The benefit to this option is that ist restricts the number of dipoles used to 15,000 (one per vertex). Results are also easier to process and visualize. However, there are some instances where such constraint is exaggerated and may bias source estimation, for instance when the individual anatomy is not available for the participant.
In the Brainstorm workflow, this orientation constraint is offered as an option of the inverse model and will be discussed in the following tutorial sections. In the present tutorial, we compute the forward model corresponding to a grid of 15,000 cortical sources without orientation constraints (hence a total of 45,000 dipoles). Note that the orientation constraint can be applied subsequently in the workflow: We do not have to take such hard decision (constrained vs. unconstrained source orientation) at this stage.
The constraint of restricting source locations to the cortical surface can be seen as too restrictive in some cases, especially if subcortical areas and cerebellum are regions of interest to the study. Brinstorm features the possibility to use the entire brain volume as source space (see green dots below: they represent dipole locations sampling the entire brain volume). One minor drawback of such model is that the results produced are impractical to review. We encourage users interested in more sophisticated approaches to add non-cortical structures to their MEG/EEG model to consult the sections concerning Volume and Mixed Head Volumes in the advanced tutorials about source modeling.
We now need to obtain a model that explains how neural electric currents (the source space) produce magnetic fields and differences in electrical potentials at external sensors (the sensor space), given the different head tissues (essentially white and greay matter, cerebrospinal fluid (CSF), skull bone and skin).
To model how data values can be otbained outside of the head with MEG/EEG from electrical curent dipoles in the brain is called forward modelling or solving a forward problem.
In Brainstorm, we call the outcome of this modelling step a "head model", a.k.a. forward model, leadfield matrix or gain matrix in the MEG/EEG literature.
In this tutorial we will use the default source space: a lower-resolution cortical surface representation, with 15,000 vertices, serving as location support to 45,000 dipoles (see above: models with unconstrained orientation). Note that we use the terms dipole and source interchangeably.
We will otbain a matrix [Nsensors x Nsources] that relates the activity of the 45,000 sources to the sensor data collected during the experiment.
Available methods for MEG forward modeling
Single sphere: The head geometry is simplified as a single sphere, with homogeneous electromagnetic properties.
Overlapping spheres: Refines the previous model by fitting one local sphere under each sensor.
OpenMEEG BEM: Symmetric Boundary Element Method from the open-source software OpenMEEG. Described in an advanced tutorial: BEM head model.
Models recommended for each modality
MEG: Overlapping spheres.
The magnetic fields are not affected too much by the heterogeneity of the tissues of the head. There is no real need for modeling the head with too much detail.
EEG: OpenMEEG BEM.
The electric currents are strongly affected by jumps between very conductive tissues (brain, CSF, skin) and an insulant medium (the skull). A realistic head model is advised for integrating the properties of the skull correctly. When computing a BEM model is not an option, for instance if OpenMEEG crashes for unknown reasons, the Berg's three-layer sphere can be an acceptable option.
sEEG/ECoG: The OpenMEEG BEM option is the only one available.
The forward models are related with the anatomy of the subject and the description of the sensors, therefore the menus associated to its computation are attached to the channel file.
In the imported Run#01, right-click on the channel file or the folder > Compute head model.
Keep the default options selected: Source space=Cortex, Forward model=Overlapping spheres.
You obtain one new file in the database. It is always saved in the same folder as the channel file.
There is not much you can do with this file except for using it for estimating sources. This will be the purpose of the following tutorials.
Right-click on the new head model > Check spheres. This window shows the spheres that were estimated. You can check them by following the indications written in green at the bottom of the window: use left/right arrows. At each step, the current sensor marker is displayed in red, and the sphere you see is its local estimation of the inner skull shape.
This algorithm is supposed to use the inner skull surface from the subject, but we usually do not have this information. In this case, a pseudo-innerskull is reconstructed using a dilated version of the cortex envelope.
Repeat the same operation for the other file. We have two different acquisition runs with two different relative position of the head and the sensors, therefore we need to compute two different head models.
In the imported Run#02, right-click on the channel file > Compute head model.
Additional considerations about the management of the head model files.
If you have multiple head models computed in the same folder, you would see one displayed in green and the others in black. The one in green is selected as the default head model, it will be used for all the following computation steps. To change the default selection, double-click on another head model file (or right-click > Set as default head model).
You can use the database explorer for batching the computation of the head model. The menu "Compute head model" is available in popup menus in the database explorer at all the levels. It is applied recursively to all the folders contained in the node(s) you selected.
On the hard drive
Right-click on any head model > File > View file contents:
Structure of the head model files: headmodel_*.mat
MEGMethod: Forward model used for MEG sensors ('os_meg', 'meg_sphere', 'openmeeg' or empty).
EEGMethod: Forward model used for EEG sensors ('eeg_3sphereberg', 'openmeeg' or empty).
ECOGMethod: Forward model used for ECoG sensors ('openmeeg' or empty).
SEEGMethod: Forward model used for sEEG sensors ('openmeeg' or empty).
Gain: Leadfield matrix, [Nsensors x Nsources], equivalent to [Nsensors x 3*Nvertices]
Comment: String displayed in the database explorer to represent this file.
HeadModelType: Type of source space used for this head model ('surface', 'volume', 'mixed').
GridLoc: [Nvertices x 3], (x,y,z) positions of the grid of source points. In the case of a surface head model, it corresponds to a copy of the 'Vertices' matrix from the cortex surface file.
GridOrient: [Nvertices x 3], direction of the normal to the surface for each vertex point (copy of the 'VertNormals' matrix of the cortex surface). Empty in the case of a volume head model.
GridAtlas: In the case of mixed head models, contains a copy of the "Source model options" atlas structure that was used for creating the model.
SurfaceFile: Relative path to the cortex surface file related with this head model.
Param: Description of the sphere that was estimated for each sensor (Center/Radius).
The Gain matrix stores the leadfield for 3 orientations (x,y,z) at each grid point (p1, p2, ...).
The successive columns of the Gain matrix are: [p1_x, p1_y, p1_z, p2_x, p2_y, p2_z ...]
To convert this unconstrained leadfield matrix to a constrained model, where the orientation of each dipole is fixed and normal to the cortex surface:
Export the head model file to the HeadModel structure: Right-click > File > Export to Matlab.
> Gain_constrained = bst_gain_orient(HeadModel.Gain, HeadModel.GridOrient);
The dimension of the output matrix is three times smaller: [Nsensors x Nvertices]
in_headmodel_bst(HeadModelFile, ApplyOrient, FieldsList): Read a head model.
bst_gain_orient(Gain, GridOrient): Apply orientation constraints.
Additional documentation [TODO]
Huang MX, Mosher JC, Leahy RM (1999)
"A sensor-weighted overlapping-sphere head model and exhaustive head model comparison for MEG," Phys Med Biol, 44:423-440 | pdf
Tutorials and forum discussions
Tutorial: BEM with OpenMEEG
Tutorial: Volume source estimation
External documentation: Electromagnetic neural source imaging
Forum: Sensor modeling: http://neuroimage.usc.edu/forums/showthread.php?1295
Forum: EEG reference: http://neuroimage.usc.edu/forums/showthread.php?1525#post6718
Forum: EEG and default anatomy: http://neuroimage.usc.edu/forums/showthread.php?1774
Forum: Mixed head models indices: http://neuroimage.usc.edu/forums/showthread.php?1878
Forum: Gain matrix units for EEG: http://neuroimage.usc.edu/forums/showthread.php?1837