The headModel toolbox for MATLAB/EEGLAB is a collection of routines, encapsulated in the headModel
class, that are commonly used for solving the forward and inverse problems of the EEG.
The headModel
toolbox was built out of frustration. With some exceptions, it is often cumbersome to get up and running with distributed source analysis of EEG data in MATLAB.
To estimate EEG source images (see EEG source imaging) we need an electric and geometric model of the head to link cortical EEG sources distributed inside the brain to the sensors where the data are collected. Towards that end, below is a summary of the items that we often need to construct such model (requirements for specific use cases can vary):
- Template or individual MRI.
- Standard or digitized EEG sensor positions.
- Segment the MRI into gray, white, bone, and scalp tissue.
- Extract surfaces from of the segmented MRIs (for surface-based inverse problem).
- Coregister the EEG sensors with the MRI or surface-based head model.
- Find an EEG forward solver that works well with your MRI-derived data.
Finding solutions for each point listed above is highly nontrivial for many researchers and engineers, and often a limiting factor for doing EEG (distributed) source imaging (ESI) analysis. The pourpuse of the headModel
toolbox is to provide an out-of-the-box solution in MATLAB/EEGLAB that can get us quickly from scalp EEG data to distributed cortical source estimates sidestepping the complications listed above.
- We provide pre-built and curated surface-based head models in the following variants:
- Colins27 template with 2003 cortical sources (vertices) and 65 scalp sensors superset of the 10/20 standard montage.
- Colins27 template with 5003 cortical sources and 65 scalp sensors superset of the 10/20 standard montage.
- Colins27 template with 5003 cortical sources and 339 scalp sensors superset of the 10/20 standard montage.
- All templates come with the 68 structures Desikan & Killiany anatomical atlas.
- We provide high-level interfaces to EEGLAB and OpenMEEG toolboxes.
- We provide several out-of-the box visualization tools.
- Affine and nonlinear coregistration between a surface-based head model template and a set of sensor locations, both manually through a (painless) GUI and unsupervised at script level. We can apply the coregistration from the space of the template to the space of the subject's sensors (for computing an individualized head model) or coregister in the opposite direction so that the same head model can be used for all subjects in a study.
- Computation of the lead field matrix using the Boundary Element Method, for which we interface the OpenMEEG toolbox.
- Estimation of cortical sources using Low Resolution Electrical Tomography (LORETA). We use our own implementation in MATLAB for greater flexibility.
- We do not support volume-based head models.
- We cannot segment, normalize, label or extract surfaces from MRI data, for that you can use FreeSurfer.
- We cannot solve the forward problem of the EEG using Finite Element method (FEM), for that you can use the NFT toolbox, which is part of the EEGLAB plug-in suite.