Remove selected components from the signal. Given the unmixing matrix, transform the data, zero out all excluded components, and inverse-transform the data. This procedure will reconstruct M/EEG signals from which the dynamics described by the excluded components is
(
self,
inst,
include=None,
exclude=None,
n_pca_components=None,
start=None,
stop=None,
*,
on_baseline="warn",
verbose=None,
)
| 2173 | |
| 2174 | @verbose |
| 2175 | def apply( |
| 2176 | self, |
| 2177 | inst, |
| 2178 | include=None, |
| 2179 | exclude=None, |
| 2180 | n_pca_components=None, |
| 2181 | start=None, |
| 2182 | stop=None, |
| 2183 | *, |
| 2184 | on_baseline="warn", |
| 2185 | verbose=None, |
| 2186 | ): |
| 2187 | """Remove selected components from the signal. |
| 2188 | |
| 2189 | Given the unmixing matrix, transform the data, |
| 2190 | zero out all excluded components, and inverse-transform the data. |
| 2191 | This procedure will reconstruct M/EEG signals from which |
| 2192 | the dynamics described by the excluded components is subtracted. |
| 2193 | |
| 2194 | Parameters |
| 2195 | ---------- |
| 2196 | inst : instance of Raw, Epochs or Evoked |
| 2197 | The data to be processed (i.e., cleaned). It will be modified |
| 2198 | in-place. |
| 2199 | include : array_like of int |
| 2200 | The indices referring to columns in the ummixing matrix. The |
| 2201 | components to be kept. If ``None`` (default), all components |
| 2202 | will be included (minus those defined in ``ica.exclude`` |
| 2203 | and the ``exclude`` parameter, see below). |
| 2204 | exclude : array_like of int |
| 2205 | The indices referring to columns in the ummixing matrix. The |
| 2206 | components to be zeroed out. If ``None`` (default) or an |
| 2207 | empty list, only components from ``ica.exclude`` will be |
| 2208 | excluded. Else, the union of ``exclude`` and ``ica.exclude`` |
| 2209 | will be excluded. |
| 2210 | %(n_pca_components_apply)s |
| 2211 | start : int | float | None |
| 2212 | First sample to include. If float, data will be interpreted as |
| 2213 | time in seconds. If None, data will be used from the first sample. |
| 2214 | stop : int | float | None |
| 2215 | Last sample to not include. If float, data will be interpreted as |
| 2216 | time in seconds. If None, data will be used to the last sample. |
| 2217 | %(on_baseline_ica)s |
| 2218 | %(verbose)s |
| 2219 | |
| 2220 | Returns |
| 2221 | ------- |
| 2222 | out : same type as the input data |
| 2223 | The processed data. |
| 2224 | |
| 2225 | Notes |
| 2226 | ----- |
| 2227 | .. note:: Applying ICA may introduce a DC shift. If you pass |
| 2228 | baseline-corrected `~mne.Epochs` or `~mne.Evoked` data, |
| 2229 | the baseline period of the cleaned data may not be of |
| 2230 | zero mean anymore. If you require baseline-corrected |
| 2231 | data, apply baseline correction again after cleaning |
| 2232 | via ICA. A warning will be emitted to remind you of this |