class braindecode.preprocessing.Preprocessor(fn, *, apply_on_array=True, **kwargs)

Preprocessor for an MNE Raw or Epochs object.

Applies the provided preprocessing function to the data of a Raw or Epochs object. If the function is provided as a string, the method with that name will be used (e.g., ‘pick_channels’, ‘filter’, etc.). If it is provided as a callable and apply_on_array is True, the apply_function method of Raw and Epochs object will be used to apply the function on the internal arrays of Raw and Epochs. If apply_on_array is False, the callable must directly modify the Raw or Epochs object (e.g., by calling its method(s) or modifying its attributes).

fn: str or callable

If str, the Raw/Epochs object must have a method with that name. If callable, directly apply the callable to the object.


Ignored if fn is not a callable. If True, the apply_function of Raw and Epochs object will be used to run fn on the underlying arrays directly. If False, fn must directly modify the Raw or Epochs object.


Keyword arguments to be forwarded to the MNE function.



Examples using braindecode.preprocessing.Preprocessor