Automatic preprocessing pipeline for the TDBRAIN dataset, using pyprep and MNE packages:
With pyprep package according to PREP Bidgely-Shamlo et al. 2015:
- Remove line-noise without committing to a filtering strategy (optional)
- Robustly reference the signal relative to an estimate of the 'true' average reference
- Detect and interpolate bad channels relative to this reference
- Detection by:
- extreme amplitudes (deviation criterion)
- lack of correlation with any other channel (correlation criterion)
- lack of predictability by other channels (predictability/RANSAC criterion)
- unusual high frequency noise (noisiness criterion)
- Detection by:
With MNE:
- Repair EOG, ECG, and EMG artifacts with ICA (fitting ICA to high-pass filtered copy of eeg data, but applying to unfiltered eeg data)
- Bandpass filter (1, 100)
- 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.
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.
Contains the class which actually performs the preprocessing steps.
Contains the function and subfunctions to plot different diagnostics at different steps of the preprocessing pipeline.