- class pyprep.Reference(raw, params, ransac=True, channel_wise=False, max_chunk_size=None, random_state=None, matlab_strict=False)¶
Estimate the ‘true’ reference with all the bad channels interpolated.
This class implements the functionality of the performReference function as part of the PREP (preprocessing pipeline) for EEG data described in .
The raw data.
Parameters of PREP which include at least the following keys: -
Whether or not to use RANSAC for noisy channel detection in addition to the other methods in
NoisyChannels. Defaults to True.
Whether RANSAC should predict signals for chunks of channels over the entire signal length (“channel-wise RANSAC”, see max_chunk_size parameter). If
False, RANSAC will instead predict signals for all channels at once but over a number of smaller time windows instead of over the entire signal length (“window-wise RANSAC”). Channel-wise RANSAC generally has higher RAM demands than window-wise RANSAC (especially if max_chunk_size is
None), but can be faster on systems with lots of RAM to spare. Has no effect if not using RANSAC. Defaults to
The maximum number of channels to predict at once during channel-wise RANSAC. If
None, RANSAC will use the largest chunk size that will fit into the available RAM, which may slow down other programs on the host system. If using window-wise RANSAC (the default) or not using RANSAC at all, this parameter has no effect. Defaults to
The random seed at which to initialize the class. If random_state is an int, it will be used as a seed for RandomState. If None, the seed will be obtained from the operating system (see RandomState for details). Default is None.
Whether or not PyPREP should strictly follow MATLAB PREP’s internal math, ignoring any improvements made in PyPREP over the original code. Defaults to False.
Bigdely-Shamlo, N., Mullen, T., Kothe, C., Su, K. M., Robbins, K. A. (2015). The PREP pipeline: standardized preprocessing for large-scale raw analysis. Frontiers in Neuroinformatics, 9, 16.
Estimate the true signal mean and interpolate bad channels.
The maximum number of iterations of noisy channel removal to perform during robust referencing. Defaults to
- This function implements the functionality of the `performReference` function
- as part of the PREP pipeline on mne raw object.
This function calls
robust_referencefirst. Currently this function only implements the functionality of default settings, i.e.,
- static remove_reference(signal, reference, index=None)¶
Remove the reference signal from the original EEG signal.
This function implements the functionality of the removeReference function as part of the PREP pipeline on mne raw object.
The referenced EEG signal.
Detect bad channels and estimate the robust reference signal.
This function implements the functionality of the robustReference function as part of the PREP pipeline on mne raw object.