PURSUE Data Processing Stream

Video Navigator

  1. Startup Matlab (45s)
  2. Load a File (1m 39s)
  3. Filtering (2m 50s)
  4. Look for Bad Channels (4m 57s)
  5. Re-referencing (5m 40s)
  6. Eventlist (8m 39s)
  7. Binning (10m 12s)
  8. Visualizing the Trials (11m 20s)
  9. Epoching (13m 32s)
  10. Artifact Rejection: Simple Voltage Threshold (15m 00s)
  11. Artifact Rejection: Moving Window Peak-to-Peak Threshold (17m 48s)
  12. Merge Artifacts with Eventlist (19m 35s)
  13. Compute Average ERPs (20m 20s)
  14. Plot ERP Data (22m 02s)

Startup Matlab

Opening Matlab/EEGlab/ERPlab

  1. You will work between EEGlab & ERPlab to preprocess your data
    1. Click on Matlab icon
  2. Set the path folder “EEGLab_Current.”
    1. Home > Set Path > Add with Subfolders > Navigate to “EEGLab_Current”
    2. Save the current path if you can, if not click "Close"
  3. In main window type “eeglab” to start EEGLAB
    1. >> eeglab
    2. GUI comes up in small blue box
  4. ERPlab should be a pull down menu at the top of the EEGLAB GUI

Load a File

EEGlab: Import .set Data Using GUI

Data straight from the system requires a plugin to load, however we are loading a file that has already been saved.

  1. File > Load Existing Dataset > Select .set file
    1. You should have 2 files for each subject’s EEG data (.fdt and .set)
    2. Note: Because this data has already been saved, it will not ask to name the file. If you use a file that has not been loaded you will need to save it as a name, and answer some default questions.

Filtering

ERPLAB: High & Low Pass Filter (remove drift and complete DC offset)

  1. ERPLAB > Filter and Frequency Tools > Filters for EEG data
    1. Note: We will be using a Butterworth Filter
  2. Check “Remove mean value (DC bias) before filtering”
    1. Note if you AC data you may not need to filter first, and you do not need to do this step, but with DC data (which PURSUE has) you must use this step
  3. Click on hi pass filter and fill in 0.1 Hz (auto-populates .20 for other value)
  4. Click on low pass filter and fill in 30 Hz (19.40 other value)
    1. Note: your filter might change depending on your component of interest
  5. Apply filter > click OK in pop up dataset info window

A window to save this file may pop up with an autopopulated _filt tag. This tells you what has been done to the data while working in the GUI. The pop up also gives you an opportunity to save it as a file. Click OK when you are done.

Look for Bad Channels

EEGlab: Plot

Examine the scrolling EEG data for any bad channels that we may need to make note of.

  1. Plot > Channel Data (scroll)
  2. Change the scale (bottom right) and use the navigation buttons between the Event Types button and the Chan. value to advance through the trials

Re-referencing

ERPLAB: Rename and reference the channels and create HEOG and VEOG channels

If you did not want to use formulas to do this step, you could use the EEGlab automated process to create and average reference, or you can choose specific channels.

We will be using EEG Channel Operations. If this is the first time you use this step, the window may be blank, however if you have used it before then it will autopopulate the formulas you used from the last use.

  1. ERPlab > EEG Channel Operations
  2. If needed (i.e. this is the first time using this; otherwise the settings should be up from the previous use), click on Load List and choose file "PURSUEmastoidref.txt"
    1. This is the channel file that uses mastoids as reference and is in the "Data Processing Resource" Folder
  3. Select "Create new dataset" mode
  4. Run
  5. Save the .set file in EEGLAB
    1. Check “Save it as a file:” and navigate to the correct location (that is, the subjects data analysis folder) and save the file (e.g., 1001_P300_filtref.set)

We recommend saving multiple steps as you go through the processing stream.

Eventlist

ERPLAB: Eventlist

The eventlist tells the software what the trigger codes mean in the data

  1. ERPLAB > Event List > Create EEG Event List
  2. Yellow box will pop up > Continue
  3. Select "Add code -99 for boundary events"
  4. Check "Export Event List to text file" > Browse or type in directory, ender filename which should indicate relevant experiment and subject number (e.g. "1001_P300_eventlist.txt") - This is a save step
  5. Create > Yellow box will pop up > "Overwrite them"

Binning

ERPLAB: Binlist

The binlist tells the software how to categorize the trials by condition

  1. ERP Lab > Assign bins (BINLISTER)
  2. “Load Bin Descriptor File from” > Browse > Select appropriate BDF file
  3. Read EVENTLIST from: select “Current dataset: [eg. 1001_P300_filt_chop_elist]”
  4. Write resulting EVENTLIST to:
    1. Check: “Warn if bins have already been assigned”
    2. Check: “Transfer EVENLIST info to EEG.event”
    3. Check “text file” to write evenlistbin file > set directory and save file with experiment name and subject number (eg.“1001_P300_eventlistbin.txt”) – this is a SAVE step for the .txt file (but not .set file)
  5. Run

Visualizing the Trials

ERPLAB: Bin Visualizer

Use Bin Visualizer to find out how many trials are in each condition/category

  1. ERPLAB > BDF Visualizer
  2. Load Event List > select previously saved event list for the subject (eg.“1001_P300_eventlist.txt”)
  3. Load BDF > select appropriate BDF file (eg. “BDF_P300 -mod.txt”)
    1. The BDF file is in the “Data Analysis Resource Files” Folder
  4. Analyze BDF
  5. Record total number of trials in each bin for each subject in lab “notebook” file (e.g. P300 Notebook.xls)
    1. Check that number of trials look correct, if they do proceed to next step for binning

Note: This is a check step that helps us determine if the bins have the amount of trials that we would expect.

Epoching

ERPLAB: Epoching

This segments the data to get rid of junk between trials/blocks and chops the continuous EEG data up into pieces that can be averaged and analyzed

  1. ERPLAB > Extract Bin Based Epochs
    1. Note you will need to change the numbers in the box based on the experiment (e.g. P300) 
    2. P3, the epoch time range is -200 800 with “pre” as the baseline
    3. MMN, the epoch time range is -200 800 with “pre” as the baseline
    4. N400, the epoch time range is -200 800 with “pre” as the baseline
    5. N2pc, the epoch time range is -200 600 with “pre” as the baseline
  2. Run
  3. Save .set file in EEGlab
    1. Save data in the appropriate data directory (e.g. 1001_P300_epoch.set)

Artifact Rejection: Simple Voltage Threshold

ERPLAB: Artifact Detection and Rejection #1- Flag and reject trials with blinks or other large artifacts across the epoch

  1. ERPLAB > Artifact detection in epoched data > Simple Voltage Threshold
    1.  Period
      1. -200 600 (space between)
      1. Voltage Threshold 100
      2. Channels 1:29
      3. Mark Flag 1
      4. Accept
    2. Save marked file
      1. EEGlab, save file (e.g., 1001_P300_artifactsmarked.set

Note: Keep track of how many trials are marked. If too many trials are lost to rejection you may want to adjust your threshold. You can go back to a dataset without _AR (artifact rejection flag) and redo artifact rejection from there.

Artifact Rejection: Moving Window Peak-to-Peak Threshold

ERPLAB: Artifact Detection and Rejection #2- Flag and reject trials with blinks, large eye movements, and other artifacts during stimulus presentation

  1. ERPLAB > Artifact detection in epoched data > Moving window peak to peak threshold
    1. Period
        1. -150 150 (space between)
      1. Voltage Threshold 100
      2. Moving Window 300
      3. Channels: 33 and 34 (HEOG VEOG)
      4. Window Step 100
      5. Mark Flag 1
    2. Accept
    3. Save marked file
      1. EEGlab, save file (e.g., 1001_P300_eyesmarked.set)
      2. Check output in Matlab window
        1. Record/save the number and percent of trials accepted and excluded in the lab experiment “notebook” file (e.g. P300 Notebook.xls)
      3. EEGLAB > Plot Data Scroll > Check to see if blinks during stimulus presentation are marked (yellow)

Merge Artifacts with Eventlist

Merge Artifact flags from EEG lab and ERP lab into event list

  1. ERPLab > Artifact Detection in Epoched Data > Synchronize Artifact info in EEG and EVENTLIST
  2. Select Update in EEGLIST and EEG.reject
  3. Click OK

Note: This makes sure that all of the data is together. You may want to save this.

Compute Average ERPs

ERPLAB: Average Trials for each condition within each subject

  1. ERPLAB > Compute Averaged ERPs
    1. With the artifact rejected data (includes both AR#1 and AR#2), now the subject’s data needs to be averaged for each experimental condition
  2. Run > save ERPset GUI pops up
  3. Save the Dataset
    1. Select “Save ERP set as” and enter directory and filename (e.g., 1001_P300_ave.erp)
    2. This is the file that will be averaged together with all the other subjects to create a grand average from which we will determine the ERP time window and channels to analyze.
      1. Note: You should now be able to view the subject’s data

Note: This is no longer a dataset, this is an .erp, which can be found under ERPsets

Plot ERP Data

ERPLAB: Plot averaged data for each subject

  1. ERPLAB > Plot ERP > Plot ERP Wave Forms
  2. In Plotting GUI:
    1. Plot “all channels” and for the bins for that study.
    2. Note for some studies you have a lot of bins that are not relevant, use the following
      1. P300: 1:2
      2. N400: 1:2
      3. N2pc: 1:2
      4. MMN: 1:2
  3. You should be able to make a figure that shows each condition by channel
    1. For the P300, you should see some peaks in electrodes CZ and PZ, you may see a P100 (roughly 100ms), an N200 (just before 200ms), and then the positive wave (roughly 300-600mss).
    2. For the N400 you should also see components in CZ and CPZ, with a N100 (roughly 100ms), P200 (roughly 150ms) and then a positive wave (200-400ms) for related pairs and no wave or negative for unrelated pairs.
    3. For the N2pc expect to see early components in the P07/P08 channels, a P100 (roughly 100ms) and a N100 (roughly 150-200ms) followed by a p200 (200-300ms).
    4. Finally, for the MMN you might see in CZ and CPZ an early P100 (a bit before 100ms), N100 (roughly 100ms), followed by a P200 (roughly 150ms). However, each participant will vary, so mostly just look to see if there are peaks and not too noisy.
  4. Save the plot for each subject (g. 1001_P300.fig)

Note: The plotting window is customizable, and you will need to change various setting s to optimize the plots for your data.

 

IF THERE IS CLEARLY BIG NOISE GO BACK!!!

  1. IF there is a bad channel, stop.
    1. Make sure to note the bad channel in the experiment “notebook” for that study (e.g. P300 Notebook.xls)
  2. IF there is no bad channel but the data is still very noisy go to step 10 and re-run  you artifact rejection with stricter parameters. However, if you make your parameters too strict you will not have enough trials for a good average (ideally at least more than 30 trials in most cases).
    1. Make sure to note the changes you made in your rejection parameters in the experiment “notebook” (e.g. P300 Notebook.xls). If you were unable to make the data any better through this methods note the quality of the data in the notebook.

Additional Information

PURSUE teaching modules provide instructors with everything they need to add EEG/ERP content in existing courses, teach a full semester course, or train research assistants in the lab. Follow this link to Lab Training Modules that can be used with tutorial videos.

Associated Teaching Modules: Lab Training Modules