Skip to content

EEG Preprocessing

Saurabh Steixner-Kumar edited this page Dec 21, 2021 · 1 revision

EEG Pre-processing

There is no consensus on the use of the preprocessing sequence and steps for the EEG recorded data. Since every experiment is different there are only general guidelines available. There two leading toolboxes used for EEG preprocessing are Fieldtrip and EEGLAB. There are others as well like the BBCI from Berlin, etc.

Should you use EEGLAB or Fieldtrip?

To have a better understanding of the two toolboxes and to use them interchangeably, EEGLAB has created an article that can be accessed by clicking Here.

In short, EEGLAB is more geared towards a graphical user interface and Fliedtrip is more geared towards scripting yourself. However, both these toolboxes use each other's functions for various tasks.

Getting the toolboxes

The toolboxes were created for usage with MATLAB, however, the Fieldtrip community is also developing it with python.

The link to the Fieldtrip toolbox is Here.

The link to the EEGLAB toolbox us Here.

Pipelines

Before using any pipelines, one should be careful and understand these are only guidelines and should not be followed blindly.

One of the most common pipelines used by the community is from Makoto. To access it click Here.

There is another EEG preprocessing pipeline that uses Fieldtrip and EEGLAB interchangeably and is specifically for the hyper-scanning setup. Originally created for the tiger task and can be accessed by clicking Here.

Custom trigger correction

  • Use the code from the sk_check_triggers script (from the supporting materials folder) to obtain the trigger numbers.

  • Make sure to have a list of all the triggers that you want to correct. This would typically include the triggers that signify a stimulus change on the screen. This would not include the triggers that signify a keypress from the participant because this can be corrected by the trigger before (which signified the stimulus change)

  • Now, obtain the photodiode trigger after the stimulus trigger to be corrected and add the difference of the two to the stimulus trigger. This makes sure that the trigger on the EEG file is corrected to the actual display of the stimulus on the screen.

  • Note, in case of a stimulus trigger missing, report this and skip this particular correction. In case of the photodiode trigger missing after the stimulus trigger; A smart way would be to take an average of all the differences of this type of stimulus trigger to the photodiode (calculated separately) and then add this average to the stimulus trigger.

  • This has to be dome to all the stimulus triggers.

Diary function

In the custom EEG preprocessing pipeline, I have used a diary function to log all the events that happen during the preprocessing. This is to ensure that if there is an error later, one can go back and check the logs.

In the script, the 'Logging' section uses this function and an example of the log can be seen in the file named 'example_log_tt_20190826_181450_enemy_session_1_vp30101_vp30301.txt'

Clone this wiki locally