Skip to content

Created a preprocessing pipeline according to PREP for python, using prep package. Additionally, includes subsequenct preprocessing steps, such as removal of ECG, EOG, and EMG artifacts with ICA

Notifications You must be signed in to change notification settings

marijnvanwingerden/TDBRAIN_preprocessing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Automatic preprocessing pipeline for the TDBRAIN dataset, using pyprep and MNE packages:

With pyprep package according to PREP Bidgely-Shamlo et al. 2015:

  1. Remove line-noise without committing to a filtering strategy (optional)
  2. Robustly reference the signal relative to an estimate of the 'true' average reference
  3. Detect and interpolate bad channels relative to this reference
    • Detection by:
      1. extreme amplitudes (deviation criterion)
      2. lack of correlation with any other channel (correlation criterion)
      3. lack of predictability by other channels (predictability/RANSAC criterion)
      4. unusual high frequency noise (noisiness criterion)

With MNE:

  1. Repair EOG, ECG, and EMG artifacts with ICA (fitting ICA to high-pass filtered copy of eeg data, but applying to unfiltered eeg data)
  2. Bandpass filter (1, 100)
  3. epoch data (optional)

Extra: The pipeline saves a .pdf file in the same directory as the preprocessed data to see the effect of the different preprocessing steps.

preprocess_pipeline.py:

Main file for running the pipeline. Takes the sourcepath of the directory containing the 'derivatives' folder of the TDBRAIN dataset. e.g:

python preprocess_pipeline.py 'D:\Documents\TD-BRAIN\TDBRAIN-dataset-derivatives\'

Can adjust preprocessing parameters below in the file.

preprocessing.py:

Contains the class which actually performs the preprocessing steps.

plotting.py

Contains the function and subfunctions to plot different diagnostics at different steps of the preprocessing pipeline.

About

Created a preprocessing pipeline according to PREP for python, using prep package. Additionally, includes subsequenct preprocessing steps, such as removal of ECG, EOG, and EMG artifacts with ICA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.3%
  • Python 0.7%