Description
While chugging along on the PyPREP/MatPREP comparison unit tests, I had a thought about the PyPREP API: since there are more-or-less three distinct stages to the PREP pipeline (adaptive line noise removal, robust re-referencing, interpolation of remaining bad channels), what if the PrepPipeline
object had separate methods for each of these? The fit()
method would still exist, but just run all of these in sequence.
Separate methods would be handy for situations like my own, where I basically copy/pasted the guts of fit()
into my own script in order to do progress messages and plotting between CleanLine and robust referencing. Also for my script the project lead wanted the option to ignore bad channels instead of interpolating them, so I had to write extra code to revert interpolation and the names of bad channels instead of having the option to not interpolate in the first place.
Here's my basic proposal for PrepPipeline
methods:
fit
: Performs the whole PREP pipeline, like ususalremove_line_noise
: Performs adaptive line noise removal.robust_reference
: Performs robust re-referencing without interpolation. Will default to printing a warning ifremove_line_noise
isn't done first.interpolate_bads
: Interpolates any remaining bad channels and adjusts the average reference accordingly.
Let me know what you think!
EDIT: With the addition of #96, a PR addressing this issue should also add MATLAB comparison tests for final bad channel interpolation.