EEGLAB Wikitorial
This tutorial was written by: Arnaud Delorme, and Scott Makeig
Many thanks to Hilit Serby, Nima Bigdely, and Toby Fernsler for additions and or edits. Thanks also to Payton Lin for capturing some images in earlier versions and to Micah
Richert, Yannick Marchand, Elizabeth Milne, and Stefen Debener for their detailed comments. In addition, thanks to Devapratim Sarma for converting and updating the
EEGLAB documentation to a WIKI.
Table of Contents
Getting Started.............................................................................................................................................................................................1
What is EEGLAB?........................................................................................................................................................................1
Why EEGLAB?.............................................................................................................................................................................1
Tutorial Outline.............................................................................................................................................................................1
EEGLAB Overview.......................................................................................................................................................................1
Distribution, documentation and support......................................................................................................................................2
I.Main Tutorial..............................................................................................................................................................................................3
Chapter 01: Loading Data in EEGLAB.......................................................................................................................................................4
Learning Matlab............................................................................................................................................................................4
Installing EEGLAB and tutorial files..............................................................................................................................................4
Starting Matlab and EEGLAB.......................................................................................................................................................5
Opening an existing dataset.........................................................................................................................................................6
Editing event values.....................................................................................................................................................................7
Sample experiment description....................................................................................................................................................7
About this dataset.........................................................................................................................................................................8
Scrolling through the data.............................................................................................................................................................8
Chapter 02: Channel Locations................................................................................................................................................................13
Importing channel location for the tutorial dataset......................................................................................................................13
Chapter 03: Plotting Channel Spectra and Maps....................................................................................................................................16
Plotting channel spectra and maps............................................................................................................................................16
Chapter 04: Preprocessing Tools............................................................................................................................................................17
Preprocessing tools....................................................................................................................................................................17
Chapter 05: Extracting Data Epochs........................................................................................................................................................21
Extracting epochs.......................................................................................................................................................................21
Chapter 06: Data Averaging......................................................................................................................................................................23
Data averaging...........................................................................................................................................................................23
Chapter 07: Selecting Data Epochs and Comparing..............................................................................................................................29
Selecting data epochs and plotting data averages.....................................................................................................................29
Chapter 08: Plotting ERP images.............................................................................................................................................................34
Plotting ERP images...................................................................................................................................................................34
Chapter 09: Decomposing Data Using ICA.............................................................................................................................................45
Independent Component Analysis of EEG data.........................................................................................................................45
Chapter 10: Working with ICA components............................................................................................................................................55
Rejecting data epochs by inspection using ICA.........................................................................................................................55
Plotting component spectra and maps.......................................................................................................................................55
Plotting component ERPs...........................................................................................................................................................57
Plotting component ERP contributions.......................................................................................................................................58
Component ERP-image plotting.................................................................................................................................................60
Chapter 11: Time / Frequency decomposition........................................................................................................................................62
Time/frequency decomposition...................................................................................................................................................62
Chapter 12: Multiple Datasets..................................................................................................................................................................66
Processing Multiple Datasets.....................................................................................................................................................66
Concluding remark on data tutorial.............................................................................................................................................67
II.Advanced Topics....................................................................................................................................................................................68
Chapter 01: Rejecting Artifacts................................................................................................................................................................69
Rejecting artifacts in continuous and epoched data...................................................................................................................69
Rejection based on independent data components...................................................................................................................80
i
Table of Contents
Chapter 02: Writing EEGLAB Scripts......................................................................................................................................................81
Why write EEGLAB Matlab scripts?...........................................................................................................................................81
Using dataset history to write EEGLAB scripts...........................................................................................................................81
Using EEGLAB session history to perform basic EEGLAB script writing...................................................................................85
Basic scripting examples............................................................................................................................................................88
Low level scripting......................................................................................................................................................................89
Chapter 03: Event Processing..................................................................................................................................................................93
Event Processing in the EEGLAB GUI.......................................................................................................................................93
Event processing from the Matlab command line.......................................................................................................................97
Chapter 04: Independent Component Clustering.................................................................................................................................104
EEGLAB Studysets and Independent Component Clustering: Overview.................................................................................104
Component Clustering..............................................................................................................................................................104
The STUDY creation and ICA clustering interfaces.................................................................................................................106
STUDY data visualization tools................................................................................................................................................124
Study statistics and visualization options.................................................................................................................................127
EEGLAB study data structures.................................................................................................................................................131
Command line STUDY functions..............................................................................................................................................136
III.Appendix..............................................................................................................................................................................................140
A01: Importing Continuous Epoched Data...........................................................................................................................................141
Importing continuous and epoched data..................................................................................................................................141
A02: Importing Event Epoch Info...........................................................................................................................................................150
Importing event and epoch information....................................................................................................................................150
A03: Importing Channel Locations........................................................................................................................................................157
Supported Electrode Data Formats..........................................................................................................................................157
Importing channel location........................................................................................................................................................157
Retrieving standardized channel locations...............................................................................................................................161
Importing measured 3-D channel locations information...........................................................................................................163
A04: Exporting Data................................................................................................................................................................................167
Supported Data Formats..........................................................................................................................................................167
Exporting data and ICA matrices..............................................................................................................................................167
A05: Data Structures...............................................................................................................................................................................170
EEGLAB Data Structures.........................................................................................................................................................170
A06: Maximizing Memory........................................................................................................................................................................174
Options to Maximize Memory and Disk....................................................................................................................................174
A07: Contributing to EEGLAB................................................................................................................................................................176
Adding capabilities to EEGLAB................................................................................................................................................176
A08: DIPFIT..............................................................................................................................................................................................180
DIPFIT plug-in: Equivalent dipole source localization of independent components.................................................................180
A09: Using custom MRI from individual subjects................................................................................................................................199
Normalizing an MR head image to the MNI brain template......................................................................................................199
A10: MI-clust............................................................................................................................................................................................203
The MI-clust Plug-in: Clustering independent components using mutual information..............................................................203
A11: BESA (outdated).............................................................................................................................................................................212
Equivalent dipole source localization of independent components using BESA......................................................................212
Visualizing dipole locations.......................................................................................................................................................215
A12: Quick Tutorial on Rejection...........................................................................................................................................................217
Quick tutorial on rejecting data artifacts with EEGLAB.............................................................................................................217
ii
Table of Contents
A13: Compiled EEGLAB..........................................................................................................................................................................219
Installation................................................................................................................................................................................219
Similarity between the compiled and the Matlab version..........................................................................................................219
What is not possible to do using the compiled version.............................................................................................................219
Frequently asked questions......................................................................................................................................................219
iii
Getting Started
What is EEGLAB?
EEGLAB is an interactive Matlab toolbox for processing continuous and event-related EEG, MEG and other electrophysiological data
using independent component analysis (ICA), time/frequency analysis, and other methods including artifact rejection. First developed
on Matlab 6.1 under Linux, EEGLAB runs on Matlab versions 6 (R13) and 7 (R14) under Linux or Unix, Windows, and Mac OS (Matlab
v6 or current v7 recommended).
Why EEGLAB?
EEGLAB provides an interactive graphic user interface (gui) allowing users to flexibly and interactively process their high-density EEG
and other dynamic brain data using independent component analysis (ICA) and/or time/frequency analysis (TFA), as well as standard
averaging methods. EEGLAB also incorporates extensive tutorial and help windows, plus a command history function that eases users'
transition from gui-based data exploration to building and running batch or custom data analysis scripts. EEGLAB offers a wealth of
methods for visualizing and modeling event-related brain dynamics. For experienced Matlab users, EEGLAB offers a structured
programming environment for storing, accessing, measuring, manipulating and visualizing event-related EEG, MEG, or other
electrophysiological data. For creative research programmers and methods developers, EEGLAB offers an extensible, open-source
platform through which they can share new methods with the world research community by contributing EEGLAB 'plug-in' functions that
appear automatically in the EEGLAB menu. For example, EEGLAB is also being used for analysis of MEG data in several laboratories;
EEGLAB plug-in functions might be created and released to perform specialized import/export, plotting and inverse source modeling for
MEG data.
Tutorial Outline
This tutorial will demonstrate (hands-on) how to use EEGLAB to interactively preprocess, analyze, and visualize the dynamics of
event-related EEG, MEG, or other electrophysiological data by operating on the tutorial EEG dataset eeglab_data.set which you may
download here (4Mb). With this dataset, you should be able to reproduce the sample actions discussed in the tutorial and get the same
(or equivalent) results as shown in the many results figures.
EEGLAB Overview
EEGLAB functions may be roughly divided into three layers designed to increase ease-of-use for different types of users. These three
layers are described below.
The EEGLAB graphic user interface (gui)
The EEGLAB gui is designed to allow non-experienced Matlab users to apply advanced signal processing techniques to their data.
However, more experienced users can also use the gui to save time in writing custom and/or batch analysis scripts in Matlab by
incorporating menu shortcuts and EEGLAB history functions.
Text files containing event and epoch information can be imported via the EEGLAB menu. The user can also use the menu to import
event and epoch information in any of several file formats (Presentation, Neuroscan, ASCII text file), or can read event marker
information from the binary EEG data file (as in, e.g., EGI, Neuroscan, and Snapmaster data formats). The menu then allows users to
review, edit or transform the event and epoch information. Event information can be used to extract data epochs from continuous EEG
data, select epochs from EEG data epochs, or to sort data trials to create ERP-image plots (Jung et al., 1999; Makeig et al., 1999).
EEGLAB also provides functions to compute and visualize epoch and event statistics.
New Matlab users may choose to interact only with the main EEGLAB window menu, first to import data into EEGLAB (in any of several
supported formats), and then to call any of a large number of available data processing and visualization functions by selecting
main-window menu items organized under seven headings:
File menu functions read/load and store/save datasets and studysets.•
Edit menu functions allow editing a dataset, changing its properties, reviewing and modifying its event and channel information
structures.
•
Tools menu functions extract epochs from continuous data (or sub-epochs from data epochs), perform frequency filtering,
baseline removal, and ICA, and can assist the user in performing semi-automated artifact data rejection based on a variety of
statistical methods applied to activity in the raw electrode channels or their independent components.
•
Plot menu functions allow users to visualize the data in a variety of formats, via (horizontally and vertically) scrolling displays
or as trial (ERP), power spectrum, event-related time/frequency averages, etc. A large number of visualization functions are
dedicated to the display and review of properties of scalp data channels and underlying independent data components. The
•
Getting Started Getting Started 1
评论0