MEG/EEG Data Analysis Using EEGLAB
EEGLAB (sccn.ucsc.edu/eeglab) is an easily extensible, highly evolved, and widely used open-source environment for signal processing and visualization of electroencephalographic data running on MATLAB (The MathWorks, Inc.). Methods central to EEGLAB include time and time-frequency analysis and visualization of individual datasets and complete studies, independent component analysis (ICA), and rich tools for connectivity analysis, brain-computer interface (BCI) development, and fusion and joint analysis of simultaneously recorded motion capture and brain data. We introduce a new MEEG plug-in that enables MEG and simultaneously recorded MEG/EEG (MEEG) data to be readily analyzed using EEGLAB. Its use is demonstrated by the analysis of an MEEG dataset. Here we show a first ICA decomposition of an MEEG dataset and use MEEG plotting tools to localize and evaluate maximally independent joint MEG/EEG component processes in the data. The analysis naturally recovers a range of artifact sources, as well as brain sources common to MEG and EEG, as well as sources primarily visible only to EEG.
KeywordsMEG EEG MEEG Independent component analysis (ICA) EEGLAB Localization Radial Tangential Dipole AMICA
EEGLAB (sccn.ucsd.edu/eeglab) (Delorme and Makeig 2004) evolved from an ICA toolbox for electrophysiological data analysis released by Makeig and colleagues at the Salk Institute (La Jolla CA) in 1997. Currently EEGLAB is a mature, actively evolving open-source software environment for electrophysiological data analysis running on MATLAB (The MathWorks, Inc.) that makes freely available a range of state-of-the-art approaches to describe brain dynamics of effective cortical and non-brain EEG sources at both the individual and group levels (Delorme and Makeig 2004; Makeig et al. 2004). By a 2011 survey (Hanke and Halchenko 2011), EEGLAB may currently be the most widely used open-source toolbox for EEG analysis. EEGLAB functions comprise a broad core range of functionality accessible either through its graphic user interface (GUI) or directly from the MATLAB command line, plus plug-in tools and toolboxes that implement a wide range of advanced analysis and visualization methods.
1.1 User Interface
1.2 Other Tools
EEGLAB is the center of a growing ecosystem of open-source software tools (Fig. 1) that have been released by researchers at the Swartz Center for Computational Neuroscience at UCSD (sccn.ucsd.edu). These include the human electrophysiology, anatomic data, and integrated tools (HeadIT) data archive and resource (http://headit.ucsd.edu/), with its system for tagging uploaded studies (Experimental Study Schema (ESS)) (Bigdely-Shamlo et al. 2013a), Hierarchical Event Descriptors (HED) (Bigdely-Shamlo et al. 2013b), and a cross-platform system for synchronized collection of data from EEG and many other devices (Lab Streaming Layer (LSL), https://github.com/sccn/labstreaminglayer) plus an extensible, XML-based data format (Extensible Data Format, XDF; https://github.com/sccn/xdfs) and a Python-language scripting framework for controlling simple or very complex experimental paradigms (SNAP).
An object-oriented environment for analysis of multimodal data collected under the mobile brain/body imaging (MoBI) paradigm, MoBILAB (sccn.ucsd.edu/wiki/Mobilab_software), can export EEG data to EEGLAB for further analysis and may in the future become our primary platform for developing and sharing multimodal data analysis methods, since the EEGLAB EEG data structure has limited support for different channel types and assumes all data to be recorded at the same sampling rate. For MEG/EEG data recorded at the same rate this is not much of an inconvenience, as EEGLAB provides a channel type variable that allows functions to perform EEG analysis and/or MEG analysis of the respective data channel subsets based on their specified channel types.
1.4 EEGLAB Plug-Ins
The growing range of EEGLAB plug-ins has been previously described (Delorme et al. 2011). Plug-ins released by SCCN itself include advanced Adaptive Mixture ICA (AMICA) for identification of maximally independent brain sources with artifact rejection (Delorme et al. 2012; Palmer 2006), the DIPFIT toolbox implementing source dipole fitting tools by Robert Oostenveld from Fieldtrip (fieldtrip.fcdonders.nl), the Neuroelectromagnetic Forward Head Modeling Toolbox (NFT) for creating detailed boundary element model (BEM) or finite element model (FEM) head models (Akalin Acar and Makeig 2010), the Measure Projection Toolbox (MPT) for cross-subject source-level analysis using measure projection (Bigdely-Shamlo et al. 2013c), the Source Information Flow Toolbox (SIFT) for calculation and visualization of multivariate causal source dynamics in both event-related and continuous data (Delorme et al. 2011), and BCILAB, a complete toolbox for building, running, and statistically evaluating brain-computer interface (BCI) models (Kothe and Makeig 2010). At least 20 other plug-in tools and toolboxes have been released by other research groups; these are listed on a wiki page (https://sccn.ucsd.edu/wiki/EEGLAB_Extensions_and_plug-ins). A facility for automated updating of listed plug-ins to new versions from within EEGLAB is provided.
1.5 The MEEG Plug-In
EEGLAB now includes an MEEG plug-in (sccn.ucsd.edu/wiki/MEEG) that expands the ability of EEGLAB users to import and analyze MEG and dual-modality MEEG (concurrent MEG and EEG) datasets, thereby opening a range of novel data analysis techniques for use by the MEG community. MEEG data handling within EEGLAB is tightly coupled to Fieldtrip, allowing the EEGLAB data structures to be readily imported from and exported to Fieldtrip. Both the EEGLAB environment and the MEEG plug-ins are ongoing efforts that we hope other MEG users and methods developers will contribute to. The MEEG developers remain open to partnering with other methods developers to share capabilities between MEEG and other MEG toolboxes.
1.6 Data and Experiment Types Supported
In addition to standard EEG data types, EEGLAB now supports the loading of MEG and MEEG data through its integration of the Fieldtrip fileio module. Individual data files can be imported as individual EEGLAB datasets, or multiple runs can be combined into a single dataset using realignment to a common sensor orientation. In addition, the new MEEG plug-in enables EEGLAB to import and export a range of Fieldtrip data structures, including raw and epoched data, as well as independent component analyses, so that EEGLAB processing can begin after partial analysis in Fieldtrip, or can be exported, allowing Fieldtrip to be used for additional processing. EEG recording systems provide a single scalar value per sensor location, in contrast to the wider variety of MEG sensor types. The scalar model easily accommodates magnetometer and radial gradiometer systems but requires either magnetometers or the magnitude of the planar gradient to be chosen (e.g., for Yokogawa system datasets).
1.7 Source Localization
ICA decomposition enables the profitable use of dipole-based inverse methods because of the characteristic resemblance of many MEG, EEG, or also MEEG independent component scalp maps to the projection of a single equivalent dipole, allowing them to be well-fit by a single equivalent dipole model (or, in some cases, to a dual-dipole model with symmetric location constraints) (Delorme et al. 2012). The DIPFIT toolbox in EEGLAB implements equivalent dipole model fitting tools by Robert Oostenveld from Fieldtrip (http://www.fieldtriptoolbox.org/). Dipole fitting tools have been integrated in the Neuroelectromagnetic Forward Head Modeling Toolbox (NFT) (Akalin Acar and Makeig 2010). These plus some novel distributed source localization methods will be put into a toolbox paralleling NFT, to be called the Neuroelectromagnetic Inverse Source modeling Toolbox (NIST).
1.8 Processing Data from Multiple Subjects or Sessions
EEGLAB supports across-subject analysis via a STUDY structure that points to a set of similar EEG datasets forming an experimental study. Currently, these datasets are typically epoched datasets (sets of data epochs similarly time locked to one or more sets of experimental events). EEGLAB study software can prepare and store a user-specified set of continuous (power spectrum) and event-related (ERP, ERSP, ITC, etc.) measures for each dataset and help the user to separate these measures into conditions, sessions, and/or subject groups. Typically, each dataset is associated with an ICA decomposition and a list of “brain” components to study, each with an equivalent dipole model. The study functions can then prepare a pair-wise distance measure between components based on component dipole (and/or scalp map) and specified measure distances. Users then can cluster the components using at least three clustering methods and can compute statistical contrasts across subjects/sessions using either parametric (Gaussian) or nonparametric (bootstrap) statistical methods. Clustering scalp channel signals, though less advised, is also supported.
Currently, users can create and process one or more 1 × N or N × M statistical designs for a given study. Thus, for example, given five different event-related measures for each subject in an experiment, the user can specify conditions 1–4 as forming a 2 × 2 design and/or can also compare conditions 2 versus 5 in another design, without needing to duplicate the STUDY structure and its associated measure files. Both within-subject and across-subject variable types are supported.
As in practice the range of experimental designs is much wider (than N × M); EEGLAB and some EEGLAB toolbox developers are now working with Cyril Pernet of the University of Glasgow to incorporate his LIMO toolbox into the core of EEGLAB study processing. It supports parametric and nonparametric statistics for a much wider range of designs (https://github.com/LIMO-EEG-Toolbox/limo_eeg) (Pernet et al. 2011).
1.9 Measure Projection
An alternate approach to component clustering is taken in the Measure Projection Toolbox (MPT) (Bigdely-Shamlo et al. 2013c). This toolbox focuses on comparing component source dynamics for a single measure at a time (e.g., ERPs) based on the location of the equivalent source dipole in a template brain. Each component dipole location is replaced by a 3-D Gaussian blur (representing location probability), and, after populating the template brain with source dipoles across a potentially large number of subjects, two operations are applied voxel-wise (i.e., template brain voxel-by-voxel). First, brain regions in which local dipole measures agree are identified, forming a measure consistency subspace. Next, voxels in this subspace are clustered using affinity clustering to form voxel domains with distinct measure time courses. Here the concept of measure domains in the template brain volume replaces the discrete component clusters produced by the default EEGLAB study processing. Users may choose either or both paths to use to characterize their study data.
1.10 CSA Clustering
Arthur Tsai of Academica Sinica, Taiwan, has recently developed an advanced approach to study source clustering (Tsai et al. 2013). This applies spatiotemporal ICA decomposition using EMSICA (Tsai et al. 2006) to EEG (or as readily, MEG) data from its projection back onto to the oriented subject cortex, modeled from a subject MR head image. The cortical surface models are then inflated and co-registered using tools available in FreeSurfer (Fischl et al. 1999). Finally, source clustering across subjects is performed in the 2-D cortical surface-aligned space rather than in 3-D template brain space (as in MPT and EEGLAB study functions). A CSA (Cortical Surface Alignment) EEGLAB plug-in is envisaged that will allow users to perform this potentially more accurate analysis when MR head images are available for the individual subjects in an EEG or MEG study.
2 MEEG Data Decomposition: An Empirical Data Example
For example purposes, we will illustrate the capabilities of the MEEG plug-in and other EEGLAB features using a simultaneously recorded multimodal (MEEG) MEG plus EEG dataset (Bledowski et al. 2012) that is jointly decomposed, in a single AMICA decomposition, to extract independent components accounting for both MEG and EEG data streams. The validity of the decomposition is based on the assumed linearity of the underlying electric and magnetic components of the electromagnetic field generated by the effective generators of the scalp-recorded (EEG) potentials and (MEG) flux. We use the NFT toolbox to create an EEG and MEG head model and use it to fit equivalent dipole models to the resulting independent component (IC) scalp maps. We focus here on describing the relations between MEG signal and EEG signal projections of the resulting ICs, including a first statistical examination using ICA of the degree to which radial EEG sources (as determined by an equivalent dipole model) are also visible in MEG.
2.1 Data Loading and Preprocessing
The epoched CTF dataset included time series data from 269 radial gradiometers (third-order synthetic) plus 56 EEG channels. Five separate runs from the same recording session were imported and merged into a single EEGLAB dataset of size 325 channels by 580 k time points. The MEEG toolbox enabled the selection of alignment across runs of the MEG data (e.g., projection onto the average across-run gradiometer locations using Fieldtrip ft_megrealign) as well as the choice (when appropriate) of synthetic gradiometer order. Field contributions from external sources were removed by computation of third-order gradients using contributions from reference sensors (Fife 1999). The resulting EEGLAB dataset included 324 channels and 136 6-s data epochs. These data were down sampled from 1200 to 600 Hz, and the EEG channels were average referenced. One EEG channel was dropped following these procedures to keep the data full rank.
2.2 Artifact Detection and Rejection
A range of artifact rejection options are available in EEGLAB, both automated and interactive data rejection or cleaning, as well as ICA-based artifact rejection. For the dataset used here, epochs containing large artifacts had previously been rejected based on visual inspection.
2.3 Independent Component Analysis
The MEEG data were analyzed using AMICA to find independent components across the modalities. ICA in general proceeds from the observation that the signal measured at any sensor is a linear mixture of multiple sources within the brain (Makeig et al. 1996). The goal of the algorithm is to learn an unmixing matrix across all channels that results in a complete decomposition of the data into maximally independent components (ICs). In single-modality MEG or EEG data, many ICs have dipolar patterns of projection onto the sensors (Delorme et al. 2012). In MEEG data decompositions, both the associated MEG and EEG scalp projection maps in clearly defined components may be dipolar. In such cases, the maps are near-orthogonal and the implied equivalent dipole locations and orientations near-identical (Liu et al. 1998), showing that ICA has identified the joint electromagnetic field associated with a single source process that may be located using its well-defined MEG and EEG projection patterns also returned by ICA. The AMICA (Adaptive Mixture ICA (Palmer et al. 2007), sccn.ucsd.edu/~jason/amica_web.html) algorithm used here is the blind source separation method that performed best in a recent comparative test of 22 linear decomposition algorithms – by both producing the greatest reduction of the strong mutual information present in the channel data and by finding the largest number of component processes with “dipolar” scalp maps compatible with the projection of a single cortical area or patch (Delorme et al. 2012).
The joint analysis of MEG and EEG data using independent component analysis is novel; to our knowledge it has not been previously reported. ICA itself, as a purely statistical method, has no notion of the type of signal it is decomposing or of the types of signal sources contributing independent information to the recorded source mixtures. Thus, to perform ICA decomposition of MEEG data, the MEG and EEG channel signals are simply concatenated into a dataset (here of 324 channels). The MEG and EEG portions of the data were individually sphered (a standard procedure to remove correlations and scale from data) before decomposition (Tukey and Tukey 1981). Sphering serves both to make the MEG and EEG signals numerically identical in size (avoiding μV versus fT scaling issues) and to remove correlations between sensors (a standard step prior to ICA that speeds the convergence of the algorithm). The result of the joint decomposition is a collection of maximally independent components, each with a pair of spatial topographies (scalp maps) representing the spatial projections of the source onto the MEG and EEG sensors, respectively, and a joint MEG/EEG time course of activation across the trials.
2.4 Forward and Inverse Source Modeling
The NFT toolbox was used to warp an MNI template 4-layer BEM model to the individual head shape defined by the EEG electrode locations. The EEG head model used the full BEM model, with forward solutions solved with METU-BEM (Akalin Acar and Gençer 2004). The MEG head model used the inner skull surface mesh of the BEM model to define a single-shell BEM model (Hämäläinen and Sarvas 1989). When individual anatomical MRIs are available, the NFT toolbox can use them to segment and create individual electrical and magnetic forward head models. NFT also generates lead field matrices for 3-D grid (FEM) source space or for a cortically constrained (BEM) source space, e.g., constructed using the FreeSurfer toolbox (surfer.nmr.mgh.harvard.edu). The head models and lead fields generated by the NFT toolkit can likewise be used for volumetric or cortically constrained inverse solutions in other data analysis packages. Dipoles were fit to all components automatically, with a separate dipole fit for the MEG and EEG IC topography. Each fit was characterized by its residual variance, as well as its direction with respect to the radial direction (as defined in relation to a best-fit sphere, fit to the scalp surface).
3 Results: ICA Analysis of MEEG Data
In Fig. 2, evoked responses of four components demonstrate ICAs tendency to isolate functionally distinct brain responses from the recorded mixture, and that this naturally generalizes to multimodal recordings. A visual cortex IC (a) follows onsets of visual stimuli. Note the associated dipolar and near-orthogonal MEG and EEG scalp maps. The evoked response of a somatomotor cortex IC (b) is primarily time locked to (before and after) participant button presses and again has near-orthogonal MEG and EEG scalp maps. A right frontal-cortex IC (c), whose spectrum had a broad peak in the theta band (not shown), produces increased theta band power (not shown here) during presentation of memorandum (1st) stimuli and subsequent (3rd) probe stimuli. Some of this theta burst energy was phase locked across trials; thus, the evoked response of this IC to the memoranda (1st stimuli) resembles a theta burst superimposed on a slower ERP base. Note the near-radial scalp pattern of the EEG scalp map and the corresponding lack of definition of the (weak) MEG IC projection (discussed further below). The ERP image plot for an IC accounting for eye blinks (d) shows that the participant blinked consistently during fixation intervals. Again, the MEG and EEG projections are well defined and consistent with sources in the eyes themselves and are near-orthogonal.
For EEG (Makeig et al. 1996), fMRI (McKeown et al. 1998), MEG (Ikeda and Toyama 2000), ECoG (Whitmer et al. 2010), and other biomedical data modalities, ICA has become a widely accepted approach that provides a powerful method for identifying and separating out separate information sources in multichannel data each of whose channel signals sums activity from more than one (often, not directly recorded) source.
Here we have demonstrated that ICA may at least complement other methods for jointly analyzing simultaneously recorded EEG and MEG data (Dale and Sereno 1993; Fuchs et al. 1998; Huang et al. 2007; Takada et al. 2000; Trujillo-Barreto et al. 2008). Its benefits may include improved source localization due to the recovery of dipole-like components with small source projections. Near-radial sources appear as those with poorly defined MEG projections and may be better located by inverting their simultaneously recorded and subsequently ICA-recovered electrical correlate. In addition, MEEG decomposition by ICA gives direct information on the relative scaling of MEG and EEG signals projected by cortical (and other) data sources. ICA decomposition of MEEG data should also allow principled examination of claims that MEG and EEG sources may sometimes have different spatial distributions. If and when this were the case, some class or classes of independent component processes returned by ICA applied to MEEG data should have very little EEG or MEG power. Here we showed that in our sample dataset the latter was the case for EEG processes with a net radial orientation, as expected from theory.
We believe the EEGLAB environment, now augmented with the MEEG plug-in incorporating data loading and handling functions from Fieldtrip, as well as custom handling of the MEEG data within EEGLAB, and now providing direct access to supercomputing resources through the Neuroscience Gateway (http://www.nsgportal.org/), is suitable for performing a range of custom MEG data analyses using available EEGLAB tools and its growing family of plug-in toolboxes. For students and researchers exploring new datasets, the EEGLAB GUI and palette of data visualization methods offer a ready way to explore data features and data quality, while its core support for data decomposition by advanced ICA methods including AMICA and further analyses using the IC component basis provide a powerful platform for information- and biophysics-based data modeling and statistical testing of experimental hypotheses.
This work was funded by a gift from The Swartz Foundation (Old Field, NY) and by the National Institutes of Health, USA, Grant R01 NS047293-09, and National Science Foundation, USA, Grant BCS-1460885.
- Bigdely-Shamlo N, Kreutz-Delgado K, Kothe C, Makeig SD (2013a) Towards an EEG search engine. In: IEEE global conference on signal and information processing (GlobalSIP), Austin, pp 25–28Google Scholar
- Bigdely-Shamlo N, Kreutz-Delgado K, Robbins K, Miyakoshi M, Westerfield M, Bel-Bahar T, Kothe CA, His J, Makeig SD (2013b) Hierarchical event descriptor (HED) tags for analysis of event-related EEG studies. In: IEEE global conference on signal and information processing (GlobalSIP), Austin, pp 1–4Google Scholar
- Kothe CA, Makeig SD (2010) BCILAB: a BCI/EEG research framework. In: Proceedings of the fourth international brain-computer interface meetingGoogle Scholar
- Makeig SD, Bell AJ, Jung T-P (1996) Independent component analysis of electroencephalographic data. Adv Neural Info Proc Syst 8:145–151Google Scholar
- Menninghaus E, Lütkenhöner B (1995) How silent are deep and radial sources in neuromagnetic measurements. In: Baumgartner C (ed) Biomagnetism: fundamental research and clinical applications. Elsevier Science, Vienna, pp 352–356Google Scholar
- Palmer JA (2006) Variational and scale mixture representations of non-Gaussian densities for estimation in the Bayesian linear model: sparse coding, independent component analysis, and minimum entropy segmentation. University of California, San DiegoGoogle Scholar
- Takada K, Nomura K, Ono Y, Kurosawa M, Ishiyama A, Kasai N, Nakasato N (2000) MEG/EEG hybrid method for source localization of a dipole with radial component. Papers of technical meeting on magnetics MAG-00:23–28Google Scholar