Admin functions

eeg_constsscript to set EEGLAB constants
eeg_globaldeclare global EEGLAB variables
eeg_helphelphow to use EEGLAB help.
eeg_helpmenuCall the help file for EEGLAB menus
eeg_optionseeglab option script
eeg_retreiveRetreive an EEG dataset from the global variable containing all datasets
eeg_storeStore the current dataset (global variable) into an global variable array
eeg_updatemenuUpdate EEGLAB menus based on values of global variables.
eeglabeeglab (Version 3.0) - Graphic user interface by Arnaud Delorme with Scott Makeig for the ICA EEG toolbox of Makeig et al. (now the eeglab toolbox) hosted 1997-2001 by the Computational Neuroscience Laboratory of Terrence J. Sejnowski at The Salk Institute, La Jolla. eeglab is hosted (2002-) by the Swartz Center for Computatational Neuroscience, Institute for Neural Computation, University of California San Diego (http://sccn.ucsd.edu/)
formaththelpSame as hthelp but does not crash under windows.
pop_delsetDelete a dataset into the global variable containing all datasets.
pop_editoptionsEdit eeglab options stored in the eeg_options Matlab file. With no argument, a window pops-up to query the user about option values.
pop_rejmenuMain menu for rejecting trials in an EEG dataset

Interactive (pop_) functions

eeg_checksetcheck consistency of dataset fields.
eeg_emptysetInitialize an EEG dataset structure with default values.
eeg_epochformatConvert the epoch information of a dataset from struct to array or vice versa.
eeg_eventformatConvert the event information of a dataset from struct to array or vice versa.
eeg_getepocheventReturn event field values for all events of one or more types
eeg_multieegplotProduce an eegplot() of a the average of an epoched dataset (with optional pre-labelling of specific trials).
eeg_rejmacroInternal eeglab macro for all pop_ functions that perform data rejection.
eeg_rejsuperposesuperpose rejections of a EEG dataset.
pop_averefConvert an EEG dataset to average reference.
pop_commentsDdd comments to an EEG dataset
pop_compareerpsCompare the (ERP) averages of two datasets.
pop_comppropplot the properties of an independent component. Need to run ICA before using this function.
pop_copysetCopy the current dataset into another dataset.
pop_crossfReturn estimates and plots of event-related (log) spectral coherence amplitudes.
pop_editeventfieldLoad/remove event fields in a dataset. If the EEG dataset is the only inputs, a window pops up to ask for the relevant parameter values.
pop_editeventvalsEdit events contained in a EEG dataset structure. If the dataset is the only input, a window pops up to ask the user for the relevant parameter values.
pop_editsetEdit dataset info.
pop_eegfiltfilter dataset
pop_eegplotmanual rejection of artifact in a dataset.
pop_eegthreshrejection of artifact in a dataset using thresholding (i.e. standard) method.
pop_envtopoenvtopo function for datasets. Enveloppe of EEG data visualization with head plots of specific components or components of maximum amplitude.
pop_epochepoching a continuous eeglab dataset.
pop_erpimagesimple erpimage of EEG channels or an independent components with a pop-up window if only two arguments.
pop_headplotplot spherically-splined EEG field map on a semi- realistic 3-D head model.
pop_icathreshmain menu for choosing threshold for component rejection in EEGLAB.
pop_importdataImport data from a Matlab variable or from a file.
pop_importepochExport epoch information to the event structure array of an EEG dataset. If the dataset is the only input, a window pops up to ask for the relevant parameter values.
pop_importeventImport events in a dataset. If the EEG dataset is the only inputs, a window pops up to ask for the relevant parameter values.
pop_importpresappend presentation file events into eeglab
pop_jointprobrejection of artifact in a dataset using joint probability (i.e. probability of activity).
pop_loadcntload a neuroscan CNT file (pop out window if no arguments).
pop_loaddatmerge a neuroscan DAT file with input dataset (pop out window if no arguments).
pop_loadeegload a neuroscan EEG file (pop out window if no arguments).
pop_loadsetload a dataset (pop out window if no arguments)
pop_loadwksload a new eeglab workspace (pop out window if no arguments).
pop_mergesetmerge two datasets. If only one argument is given a window pop out to ask for other arguments.
pop_plotdataplot average of EEG channels or an independent components.
pop_plottopoplot concatenated multichannel data epochs in a topographic format.
pop_readedfload a EDF EEG file (pop out window if no arguments).
pop_rejepochReject pre-labeled trials in a EEG dataset. Ask for confirmation and accept the rejection
pop_rejkurtrejection of artifact in a dataset using kurtosis of activity (i.e. to detect peaky distribution of activity).
pop_rejspecrejection of artifact in a dataset using thresholding of frequencies in the data.
pop_rejtrendDetect linear trends in EEG activity and reject the epoched trials based on the accuracy of the linear fit.
pop_resampleresample dataset (pop up window).
pop_rmbaseremove baseline from an epoched dataset.
pop_runicarun ica on a dataset
pop_savehsave history
pop_savesetsave a dataset structure
pop_savewkssave eeglab workspace (pop out window if no arguments).
pop_selectremove trials and channels from a dataset
pop_selectcompsDisplay components with button to vizualize their properties and label them for rejection.
pop_selecteventFind events in a EEG dataset. If the dataset is the only input, a window pops up to ask for the relevant parameter values.
pop_snapreadload an EEG SnapMaster file (pop out window if no arguments).
pop_spectopospectrum of selected channels with spectrum head plots at specific frequencies.
pop_subcompsubstract a selected components from a dataset.
pop_timefReturns estimates and plots of event-related (log) spectral perturbation (ERSP) and inter-trial coherence (ITC) changes timelocked to a set of input events in one data channel.
pop_timtopotimtopo function for datasets. Enveloppe of EEG data visualization with head plots at specific latencies.
pop_topoplotplot head of subjects with a pop-up window if only two arguments.

Signal processing functions

abspeakfind peak amps/latencies in each row of a single-epoch data matrix
arrowDraw a line with an arrowhead.
averefconvert common-reference EEG data to average reference
axcopymove, resize, or copy Matlab axes using the mouse
binicaRun stand-alone binary version of runica() from the Matlab command line. Saves time and memory. If stored in a file, data are not read into Matlab.
blockavemake block average of concatenated data sets of same size Each data set is assumed to be of size (chans,frames).
caliperMeasure a set of spatial components of a given data epoch relative to a reference epoch and decomposition.
cart2topoconvert xyz-cartesian channel coordinates to polar topoplot coordinates. Input data are points on a sphere around a given [x y z] center or around (0,0,0) {default}.
cbarDisplay full or partial colorbar, choose numeric range
cell2matconvert cell array to matrix
changeunitsTakes one or more points in one axes and gives its position in another axes. Useful for drawing lines between sbplots (see sbplot()).
chanprojmake a detailed plot of data returned from plotproj() for given channel. Returns the data plotted.
compdspDisplay standard info figures for a data decomposition Creates four figure windows showing: Component amplitudes, scalp maps, activations and activation spectra.
compheadsplot multiple topoplot() maps of ICA component topographies
compmapPlot multiple topoplot() maps of ICA component topographies Click on an individual map to view separately.
compplotplot a data epoch and maps its scalp topography at a given time
compsortreorder ICA components, first largest to smallest by the size of their maximum variance in the single-component projections, then (if specified) the nlargest component projections are reordered by the (within-epoch) time point at which they reach their max variance.
compvarproject selected components and compute the variance of the original signal they account for.
convolveconvolve two matrices (normalize by the sum of convolved elements to compensate for border effects).
copyaxishelper function for axcopy
covaryFor vectors, covary(X) returns the variance of X. For matrices, covary(X)is a row vector containing the variance of each column of X.
crossfReturns estimates and plot of event-related coherence (ERC) changes between data from two input channels. The lower panel gives the coherent phase difference between the processes. In this panel, for Ex. -90 degrees (blue) means xdata leads ydata by a quarter cycle. 90 degrees (orange) means ydata leads xdata by a quarter cycle. Click on each subplot to view separately and zoom in/out.
del2mapcompute the discrete laplacian of an EEG distribution.
dftfiltdiscrete Fourier filter
eegdrawsubroutine used by eegplotold() to plot data.
eegdrawgsubroutine used by eegplotgold() to plot data.
eegfilt(high|low|band)pass filter EEG data using two-way least-squares FIR filtering. Multiple data channels and epochs supported. (Requires the Signal Processing Toolbox)
eegmovieCompile and view a Matlab movie. Uses scripts eegplotold() and topoplot(). Use seemovie() to display the movie.
eegplotdisplay data in a horizontal scrolling fashion with gui controls (version 3).
eegplotdisplay data in a horizontal scrolling fashion with gui controls (version 3).
eegplot2eventconvert eegplot rejections into events compatible with eeglab format for continuous datasets.
eegplot2trialconvert eegplot rejections into trial and electrode rejections compatible with eeglab format.
eegplotgdisplay EEG data in a clinical format >> eegplotg('dataname', samplerate, 'chanfile', 'title', yscaling, range) 'dataname' : quoted name of a desktop global variable (see Ex. below) samplerate : EEG sampling rate in Hz (0 -> default 256 Hz) 'chanfile' : file of channel info in topoplot() style (0 -> channel numbers) 'title' : plot title string (0 -> 'eegplotg()') yscaling : initial y scaling factor (0 - default is 300) range : how many seconds to display in window (0 -> 10)
eegplotsdisplay data in a clinical format without scrolling >> eegplots(data, srate, 'chanfile', 'title', ... yscaling, epoch, linecolor,xstart,vertmark) data : data matrix (chans,frames) srate : EEG sampling rate in Hz (0 -> 256 Hz) 'chanfile' : file of channel info, topoplot() style, (0 -> chan nos) 'title' : plot title string {0 -> 'eegplots()'} yscaling : initial y scaling factor (0 -> 300) epoch : how many seconds to display in window (0 -> 10 sec) linecolor : color of eeg (0 -> 'y') xstart : start time of the data {0 -> 0} vertmark : vector of frames to mark with vertical lines {0 -> none}
eegrejreject eeg regions in continuous eeg data.
eegthreshclassical trial rejection rejection using a threshold on the raw signal
entropycalculation of entropy of a 1D, 2D or 3D array and rejection of odd last dimension values of the input data array using the discrete entropy of the values in that dimension (and using the probability distribution of all columns).
envreturn envelope of rows of a data matrix.
envprojplot envelopes of projections of selected ICA component projections against envelope of the original data
envtopoPlot a data epoch envelope with envelopes and scalp maps of specified components. Click on individual plots to examine separately (with zoom feature).
epochepoching continuous eeg data array.
erpaveperform epoch selection plus simple artifact rejection, baseline-zeroing, and/or block averaging
erpimageImage single-trial ERPs optionally sorted on and/or aligned to an input variable and smoothed by moving-average (Note: to return event-aligned data without plotting, use eventlock()). Click on axes to examine separately and zoom.
erpimagesimage multiple single-trial ERPs optionally sorted on an input variable and smoothed by moving-average Plot selected single channels in separate panels.
erpimoptMore erpimage input arguments For other erpimage input arguments, see: >> help erpimage
eventlockTime lock data epochs to specified event frames or event x-values. Use to timelock existing data epochs to reaction times or other events
eyelikecalculate a permutation matrix P and a scaling (diagonal) maxtrix S such that S*P*E is eyelike (so permutation acts on the rows of E). E must be a square matrix.
fastiffast if function.
floatreadRead matrix from float file ssuming four byte floating point number
floatwriteWrite data matrix to float file.
gabor2dgenerate a 2 dimensional gabor matrice.
gaussreturn a Gaussian window
gauss2dgenerate a 2 dimensional gaussian matrice
getallmenusget all submenus of a window or a menu and return a tree.
gettextThis function prints a dialog box on screen and waits for the user to enter a string. There is a cancel button which returns a value of [].
gradmapcompute the gradient of an EEG spatial distribution.
gradplotCompute the gradient of EEG scalp distribution(s) on a square grid
hhistory function.
headmovieRecord a Matlab movie of scalp data. Use seemovie() to display the movie.
headplotplot a spherically-splined EEG field map on a semi-realistic 3-D head model. Rotate head using left mouse button.
help2htmlconvert a Matlab m-file help-message header into an .html help file
hungarianSolve the assignment problem using the Hungarian method.
icasummary of the signal processing functions of the eeglab toolbox
icaactcompute ica activation waveforms = weights*sphere*(data-meandata)
icadefsfile of default filenames and constants to source in the ica /ERP package functions. Insert local dir reference below.
icademoa sample ica analysis script using the ICA/ERP package of Matlab functions distributed via http://www.sccn.ucsd.edu/eeglab
icaprojproject ica component activations through the associated weight matrices to reconstitute the observed data using only the selected ica components.
icavarproject ica component activations through the ica weight matrices to reconstitute the observed data using selected ica components. Returns time course of variance on scalp for each component.
inputguia comprehensive gui automatic builder. This function help to create GUI very fast without bothering about the positions of the elements. After creating a geometry, elements just place themselves into the predefined locations. It is especially usefull for figure where you intend to put text button and descriptions.
jaderblind separation of real signals using JADE (v1.5, Dec. 1997).
jointprobrejection of odd columns of a data array using joint probability of the values in that column (and using the probability distribution of all columns).
kurtreturn kurtosis of input data distribution
laplac2dgenerate a 2 dimensional gaussian matrice
lapplotCompute the discrete laplacian of EEG scalp distribution(s)
loadavgloading eeg average data file from Neuroscan into matlab.
loadcntLoad a Neuroscan continuous signal file.
loaddatloading neuroscan format data file into matlab.
loadeegload binary eeg file in neuroscan format.
loadelecLoad electrode names file for eegplot
loadtxtload ascii text file into numeric or cell arrays
logimagescmake an imagesc(0) plot with log y-axis values (ala semilogy())
logspecplot mean log power spectra of submitted data on loglog scale using plotdata() or plottopo() formats
makeelecsubroutine to make electrode file in eegplot
makehtmlfunction generating all the HTML files for files in specific directories
mat2cellconvert matrix to cell array
matcorrFind matching rows in two matrices and their corrs. Uses the Hungarian (default), VAM, or maxcorr assignment methods. (Follow with matperm() to permute and sign x -> y).
matpermtranspose and sign rows of x to match y (run after matcorr )
matselselect rows, columns, and epochs from given multi-epoch data matrix
movavPerform a moving average of data indexed by xvals. Supports use of a moving non-rectangular window. Can be used to resample a data matrix.
moveaxesmove, resize, or copy Matlab axes using the mouse
parsetxtparse text input into cell array
pcexpandexpand data using Principal Component Analysis (PCA) returns data expanded from a principal component subspace [compare pcsquash()]
pcsquashcompress data using Principal Component Analysis (PCA) into a principal component subspace. To project back into the original channel space, use pcexpand
perminvreturns the inverse permutation vector
phasecoherImplements inter-trial amp/coherence using Gaussian wavelets. Removes epoch means. Returns same data length as input frames. Plots results when nargin>6. Outputs have flat ends at data indices [1:halfwin] and [frames-halfwin:frames].
plotdataplot concatenated multichannel data epochs in two-column format
ploterpplot a selected multichannel data epoch on a common timebase
plotprojplot projections of one or more ica components along with the original data (returns the data plotted)
plottopoplot concatenated multichannel data epochs in a topographic format Uses a channel location file with the same format as topoplot() or else plots data on a rectangular grid of axes.
pophelpSame as hthelp but does not crash under windows.
posactMake runica() activations all RMS-positive. Adjust weights and inverse weight matrix accordingly.
projtopoplot projections of one or more ica components along with the original data in a 2-d topographic array. Returns the data plotted. Click on subplot to examine separately.
promaxperform Promax oblique rotation after orthogonal Varimax rotation of the rows of the input data. A method for linear decomposition by "rotating to simple structure."
qrtimaxperform Quartimax rotation of rows of a data matrix.
readedfread eeg data in EDF format.
readelpread electrode position in .elp file
readelpread electrode position in .elp file
readlocread polar electrode positions from ica toolbox .loc file See >> topoplot example for .loc file format.
readlocsread polar electrode positions from ica toolbox
readlocsoldRead electrode locations file in style of topoplot() or headplot. Output channel information is ordered by channel numbers.
realprobacompute the effective probability of the value in the sample.
rejkurtcalculation of kutosis of a 1D, 2D or 3D array and rejection of outliers values of the input data array using the discrete kutosis of the values in that dimension.
rejstatepochreject bad eeg trials based a statistical measure. Can be applied either to the raw eeg data or the ica component activity. This is an interactive function.
rejtrenddetect linear trends in EEG activity and reject the epoched trials based on the accuracy of the linear fit.
rmartRemove eye artifacts from EEG data using regression with multiple time lags. Each channel is first made mean-zero. After JL Kenemans et al., Psychophysiology 28:114-21, 1991.
rmbasesubtract basevector channel means from multi-epoch data matrix
rmsavereturn the RMS in each channel, epoch
runicaPerform Independent Component Analysis (ICA) decomposition of psychophysiological data using the infomax ica algorithm of Bell & Sejnowski (1995) with the natural gradient feature of Amari, Cichocki & Yang, the extended-ICA algorithm of Lee, Girolami & Sejnowski, PCA dimension reduction, and/or specgram() preprocessing (suggested by M. Zibulevsky).
runpcaperform principal component analysis (PCA) using singular value decomposition (SVD) using Matlab svd() or svds() >> inv(eigvec)*data = pc;
sbplotcreate axes in arbitrary subplot grid positions and sizes
seemoviesee an EEG movie produced by eegmovie
slideradd slider to a figure
snapreadRead data in Snap-Master Standard Binary Data File Format Reads Snap-Master header and data matrix (nchans,nframes). Ref: Users Guide, Snap-Master for Windows (1997) p. 4-19
spectopoPlot the mean log spectrum of a set of data epochs at all channels as a bundle of traces. At specified frequencies, plot the relative topographic distribution of power. Uses Matlab psd() from signal processing toolbox.
sph2topoConvert from a 3-column headplot file in spherical coordinates to a 3-column topoplot file in polar (not cylindrical) coords. Used for topoplot() and other 2-d topographic plotting programs. Assumes a spherical coordinate system in which horizontal angles has a range [-180,180] with zero pointing to the right ear. In the output polar coordinate system, zero points to the nose.
spherreturn the sphering matrix for given input data
spherrorcart2topo sub function to compute minimum distance of carthesian coordinates to a sphere
superguia comprehensive gui automatic builder. This function help to create GUI very fast without bothering about the positions of the elements. After creating a geometry, elements just place themselves into the predefined locations. It is especially usefull for figure where you intend to put text button and descriptions.
testicaTest the runica function's ability to separate synthetic sources. Use the input variables to estimate the (best) decomposition accuracy for a given data set size.
textguimake sliding vertical window. This window contain text with optional function calls at each line.
textscplaces text in screen coordinates and places a title at the top of the figure.
tftopoGenerates a figure that shows a selected ERSP or ITC image from a supplied set of nchans images, plus topoplot()'s of scalp distributions at sepcified time / frequency points. Inputs may be outputs of timef()
timefReturns estimates and plots of event-related (log) spectral perturbation (ERSP) and inter-trial coherence (ITC) changes timelocked to a set of input events in one data channel. * Uses either fixed-window, zero-padded FFTs (fastest), wavelet 0-padded DFTs (both Hanning-tapered), OR multitaper ('mtaper'). * For the wavelet and FFT methods, uutput frequency spacing is the lowest frequency (srate/winsize) divided by the padratio. NaN input values (such as returned by eventlock) are ignored. * If 'alpha' is given, then bootstrap statistics are computed (from a distribution of 'naccu' surrogate data epochs) and non-significant features of the output plots are zeroed out (i.e., plotted in green). * Given a 'topovec' topo vector and 'elocs' electrode location file, the figure also shows a topoplot() of the specified scalp map. * Note: Left-click on subplots to view them in separate windows.
timefdetailsdetails of the timef function parameters for time/frequency analysis of event-related 1-channel multi-epoch data.
timefrqprogressive Power Spectral Density estimates on a single EEG channel using out-of-bounds and muscle activity rejection tests. Uses Matlab FFT-based psd().
timtopoplot a data epoch and map its scalp topography at given times
topo2sphconvert a topoplot() style 2-D polar-coordinates channel locations file to a 3-D spherical-angle file for use with headplot
topoimageplot concatenated multichannel time/frequency images in a topographic format Uses a channel location file with the same format as topoplot() or else plots data on a rectangular grid of axes. Click on individual images to examine separately.
topoplotplot a topographic map of an EEG field as a 2-D circular view (looking down at the top of the head) using cointerpolation on a fine cartesian grid.
treeMake a hierarchical (tree-diagram) component plot. Use successive calls to this function to build the full plot.
tutorialBring up the ica / electrophysiology toolbox tutorial in a browser window (see docopt.m in the toolbox dir). Tutorial URL: http://www.sccn.ucsd.edu/tutorial/ Download: See http://www.sccn.ucsd.edu/ica.html
varimaxPerform orthogonal Varimax rotation on rows of a data matrix.
varsortreorder ica components, largest to smallest, by the size of their MEAN projected variance across all time points
zicaZ-transform of ica activations; useful for studying component SNR