PyPrep is my attempt at translating the “PREP” (PREprocessing Pipeline) for EEG data into Python. The original implementation is only available in Matlab and intended for cleaning raw EEG data as a first standardized step before working with it.
Out of all functionalities that PREP offers, I particularly liked the “findNoisyChannels” function. With it, the EEG data are subjected to several robust tests to tease out channels that contain noise:
- Contains n/a values or is flat over an extended period?
- Abnormal deviations of amplitude i.e., too much or too little?
- Low correlation with other channels?
- Not well predicted by other channels? (yes, this is different from 3. see the code)
As mentioned before, with PyPrep there is now a Python implementation of this function, which works closely with MNE-Python, the arguably most popular software package for EEG analysis in Python.
As of May 2018, the “findNoisyChannels” function is the only part of the PREP that I implemented in Python (contributions welcome!) however, there is one more thing:
The original PREP does not implement a robust screening of noisy epochs; so I implemented another function borrowed from FASTER, which is yet another preprocessing pipeline for EEG data (they really like their acronyms).
In conclusion, PyPrep currently offers two convenient functions for automatically cleaning your EEG data in a conservative and robust way.