Video Navigator
- Startup Matlab (45s)
- Load a File (1m 39s)
- Filtering (2m 50s)
- Look for Bad Channels (4m 57s)
- Re-referencing (5m 40s)
- Eventlist (8m 39s)
- Binning (10m 12s)
- Visualizing the Trials (11m 20s)
- Epoching (13m 32s)
- Artifact Rejection: Simple Voltage Threshold (15m 00s)
- Artifact Rejection: Moving Window Peak-to-Peak Threshold (17m 48s)
- Merge Artifacts with Eventlist (19m 35s)
- Compute Average ERPs (20m 20s)
- Plot ERP Data (22m 02s)
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
Startup Matlab
Opening Matlab/EEGlab/ERPlab
- You will work between EEGlab & ERPlab to preprocess your data
- Click on Matlab icon
- Set the path folder “EEGLab_Current.”
- Home > Set Path > Add with Subfolders > Navigate to “EEGLab_Current”
- Save the current path if you can, if not click "Close"
- In main window type “eeglab” to start EEGLAB
- >> eeglab
- GUI comes up in small blue box
- 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.
- File > Load Existing Dataset > Select .set file
- You should have 2 files for each subject’s EEG data (.fdt and .set)
- 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)
- ERPLAB > Filter and Frequency Tools > Filters for EEG data
- Note: We will be using a Butterworth Filter
- Check “Remove mean value (DC bias) before filtering”
- 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
- Click on hi pass filter and fill in 0.1 Hz (auto-populates .20 for other value)
- Click on low pass filter and fill in 30 Hz (19.40 other value)
- Note: your filter might change depending on your component of interest
- 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.
- Plot > Channel Data (scroll)
- 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.
- ERPlab > EEG Channel Operations
- 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"
- This is the channel file that uses mastoids as reference and is in the "Data Processing Resource" Folder
- Select "Create new dataset" mode
- Run
- Save the .set file in EEGLAB
- 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
- ERPLAB > Event List > Create EEG Event List
- Yellow box will pop up > Continue
- Select "Add code -99 for boundary events"
- 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
- Create > Yellow box will pop up > "Overwrite them"
Binning
ERPLAB: Binlist
The binlist tells the software how to categorize the trials by condition
- ERP Lab > Assign bins (BINLISTER)
- “Load Bin Descriptor File from” > Browse > Select appropriate BDF file
- Read EVENTLIST from: select “Current dataset: [eg. 1001_P300_filt_chop_elist]”
- Write resulting EVENTLIST to:
- Check: “Warn if bins have already been assigned”
- Check: “Transfer EVENLIST info to EEG.event”
- 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)
- Run
Visualizing the Trials
ERPLAB: Bin Visualizer
Use Bin Visualizer to find out how many trials are in each condition/category
- ERPLAB > BDF Visualizer
- Load Event List > select previously saved event list for the subject (eg.“1001_P300_eventlist.txt”)
- Load BDF > select appropriate BDF file (eg. “BDF_P300 -mod.txt”)
- The BDF file is in the “Data Analysis Resource Files” Folder
- Analyze BDF
- Record total number of trials in each bin for each subject in lab “notebook” file (e.g. P300 Notebook.xls)
- 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
- ERPLAB > Extract Bin Based Epochs
- Note you will need to change the numbers in the box based on the experiment (e.g. P300)
- P3, the epoch time range is -200 800 with “pre” as the baseline
- MMN, the epoch time range is -200 800 with “pre” as the baseline
- N400, the epoch time range is -200 800 with “pre” as the baseline
- N2pc, the epoch time range is -200 600 with “pre” as the baseline
- Run
- Save .set file in EEGlab
- 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
- ERPLAB > Artifact detection in epoched data > Simple Voltage Threshold
- Period
- -200 600 (space between)
- Voltage Threshold 100
- Channels 1:29
- Mark Flag 1
- Accept
- Save marked file
- EEGlab, save file (e.g., 1001_P300_artifactsmarked.set
- Period
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
- ERPLAB > Artifact detection in epoched data > Moving window peak to peak threshold
- Period
-
- -150 150 (space between)
- Voltage Threshold 100
- Moving Window 300
- Channels: 33 and 34 (HEOG VEOG)
- Window Step 100
- Mark Flag 1
-
- Accept
- Save marked file
- EEGlab, save file (e.g., 1001_P300_eyesmarked.set)
- Check output in Matlab window
- Record/save the number and percent of trials accepted and excluded in the lab experiment “notebook” file (e.g. P300 Notebook.xls)
- EEGLAB > Plot Data Scroll > Check to see if blinks during stimulus presentation are marked (yellow)
- Period
Merge Artifacts with Eventlist
Merge Artifact flags from EEG lab and ERP lab into event list
- ERPLab > Artifact Detection in Epoched Data > Synchronize Artifact info in EEG and EVENTLIST
- Select Update in EEGLIST and EEG.reject
- 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
- ERPLAB > Compute Averaged ERPs
- 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
- Run > save ERPset GUI pops up
- Save the Dataset
- Select “Save ERP set as” and enter directory and filename (e.g., 1001_P300_ave.erp)
- 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.
- 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
- ERPLAB > Plot ERP > Plot ERP Wave Forms
- In Plotting GUI:
- Plot “all channels” and for the bins for that study.
- Note for some studies you have a lot of bins that are not relevant, use the following
- P300: 1:2
- N400: 1:2
- N2pc: 1:2
- MMN: 1:2
- You should be able to make a figure that shows each condition by channel
- 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).
- 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.
- 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).
- 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.
- 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!!!
- IF there is a bad channel, stop.
- Make sure to note the bad channel in the experiment “notebook” for that study (e.g. P300 Notebook.xls)
- 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).
- 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