Installing the ERP PCA Toolkit

Today I’m raising awareness of a phenomenally helpful tool in ERP Research called the ERP PCA Toolkit.  In short, the PCA toolkit allows you perform temporal, spatial, and complex (e.g. temporo-spatial) analyses on ERP data.  Shown in the figure below is a quick temporal-spatial PCA on some ERP data for a go/no-go task.  The PCA pulled out a temporal component that peaked at 774 milliseconds and a spatial component in the right parietal lobe (electrode 97 on an EGI Hydrocel Net).

If you’ve never used a PCA to help identify regions of temporal or spatial interest in your ERP data, I highly recommend using the PCA Toolkit.  I will post some R code in the future that will show how to do a PCA by hand, which helps explain the fundamental steps, but there is something to be said about the efficiency of using a Toolkit like this one to really see what your data has to offer.  It’s worth noting that while this is an ERP toolkit, I’ve had some luck using it on MEG data, though typically we use MEG to go straight to dipoles or activation in the brain (MSI).



One of the first hurdles of using any MATLAB toolbox is to get it installed correctly.  The PCA Toolkit uses routines from several different packages, including FieldTrip and EEGLAB.  You will want to get the most recent releases of both of these packages and the ERP PCA Toolkit before following the steps below to install the PCA Toolkit.  I usually put my MATLAB toolboxes in a Shared Folder, on Macs I prefer to use /Users/Shared/.

  1. Add PCA Toolkit to your path
    1. Add with Subfolders
  2. Add EEGLab to your path
    1. Add just the EEGLab folder, not the subfolders, EEGLab will take care of the rest of you!
    2. Remove the “slimmed down” FieldTrip install included in EEGLab by deleting the fileio and fieldtrip-partial directories in the “eeglab/external” folder
    3. Disable the “binary ICA” path by setting line 56 (or so) in eeglab/functions/sigprocfunc/icadefs.m to read ICABINARY = [];
  3. Add FieldTrip to your path
    1. Add just the folder.  Click Save, then type “ft_defaults” into the MATLAB console
    2. Go back to the Set Path dialogue and notice FieldTrip has added several things, click “Save”.

These instructions are direct from the “tutorial.pdf” file included in PCA Toolkit.  If you find the toolkit helpful, remember to 1) send an email to Dr. Joseph Dien and thank him for his excellent work and 2) cite the toolbox in your papers:

Dien, J. (2010). The ERP PCA Toolkit: An open source program for advanced statistical analysis of event-related potential data. Journal of Neuroscience Methods 187(1), 138-145.

Some examples of using PCA Toolkit coming in a later post.

Comments are closed.