rb643 / resting_state_eeg

8 stars 6 forks source link

Resting State EEG with Python MNE

These scripts are to be used for fully-automated pre-processing of resting state EEG data that was recorded on a 64-channel BioSemi ActiveTwo system with external electrode 6 (placed on the mastoid) as a reference electrode. It assumes trigger codes are used for eyes-closed and eyes-open segments and presently only uses eyes-closed segments. The currently assumed pre-processing steps are as follows:

  1. Trials and triggers codes are read and only eyes-closed segments are selected
  2. Very basic pre-processing includes: demeaning, detrending, low-pass filter below 60Hz, re-referencing to mastoid reference, bandpass filtering of possible 50Hz line-noise and resampling to 256Hz.
  3. Optional visual inspection after basic pre-processing
  4. Optional reconstruction of noisy channels (though only use this if a channel is absolutely rubbish!)
  5. Optional removal of noise using ICA decomposition
  6. Segmenting continuous recording into 4-second segments to be used for WPLI analyses later on
  7. Autoreject bad epochs prior to WPLI analyses
  8. Calculate the weighted phase lag index using multi-taper fast fourier transform for each of the 4 frequency bands separately

What assumptions are made

What scripts do what

There is one main notebook that runs the whole pre-processing pipeline (https://github.com/rb643/resting_state_eeg/blob/master/rsEEG_preproc_ica_autoreject.ipynb) which runs:

  1. Basic pre-processing, filtering and auto-reject on segments and channels
  2. Plots basic QC by showing number of rejected epochs (out of a total of 28) and the individual connectivity distributions
  3. Runs cluster based non-parametric permutation group comparisons (https://www.ncbi.nlm.nih.gov/pubmed/17517438)
  4. Runs basic graph metrics on thresholded matrices (MST + 10%)

Dependencies

There are a few external scripts/toolboxes that this notebook depend upon:

Notes:

Still to do