mne.preprocessing.apply_pca_obs#

mne.preprocessing.apply_pca_obs(raw: Raw, picks: list[str], *, qrs_times: ndarray, n_components: int = 4, n_jobs: int | None = None, copy: bool = True, verbose: bool | str | int | None = None) Raw[source]#

Apply the PCA-OBS algorithm to picks of a Raw object.

Uses the optimal basis set (OBS) algorithm from [1].

Parameters:
rawinstance of Raw

The raw data to process.

picksstr | array_like | slice | None

Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g., ['meg', 'eeg']) will pick channels of those types, channel name strings (e.g., ['MEG0111', 'MEG2623'] will pick the given channels. Can also be the string values 'all' to pick all channels, or 'data' to pick data channels. None (default) will pick all data channels (excluding reference MEG channels). Note that channels in info['bads'] will be included if their names or indices are explicitly provided.

qrs_timesndarray, shape (n_peaks,)

Array of times in the Raw data of detected R-peaks in ECG channel.

n_componentsint

Number of PCA components to use to form the OBS (default 4).

n_jobsint | None

The number of jobs to run in parallel. If -1, it is set to the number of CPU cores. Requires the joblib package. None (default) is a marker for ‘unset’ that will be interpreted as n_jobs=1 (sequential execution) unless the call is performed under a joblib.parallel_config context manager that sets another value for n_jobs.

copybool

If False, modify the Raw instance in-place. If True (default), copy the raw instance before processing.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns:
rawinstance of Raw

The modified raw instance.

Notes

New in v1.10.

References

Examples using mne.preprocessing.apply_pca_obs#

Repairing artifacts with SSP

Repairing artifacts with SSP

Principal Component Analysis - Optimal Basis Sets (PCA-OBS) removing cardiac artefact

Principal Component Analysis - Optimal Basis Sets (PCA-OBS) removing cardiac artefact