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.
- picks
str
| 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 ininfo['bads']
will be included if their names or indices are explicitly provided.- qrs_times
ndarray
, shape (n_peaks,) Array of times in the Raw data of detected R-peaks in ECG channel.
- n_components
int
Number of PCA components to use to form the OBS (default 4).
- n_jobs
int
|None
The number of jobs to run in parallel. If
-1
, it is set to the number of CPU cores. Requires thejoblib
package.None
(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1
(sequential execution) unless the call is performed under ajoblib.parallel_config
context manager that sets another value forn_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 andmne.verbose()
for details. Should only be passed as a keyword argument.
- rawinstance of
- Returns:
- rawinstance of
Raw
The modified raw instance.
- rawinstance of
Notes
New in v1.10.
References
Examples using mne.preprocessing.apply_pca_obs
#
Principal Component Analysis - Optimal Basis Sets (PCA-OBS) removing cardiac artefact