eelbrain.pipeline.RawICA

class eelbrain.pipeline.RawICA(source, task=None, method='extended-infomax', random_state=0, fit_kwargs=None, cache=False, **kwargs)

ICA raw pipe

Parameters:
  • source (str) – Name of the raw pipe to use for input data.

  • task (str | Sequence[str] | None) – Task(s) to use for estimating ICA components. Can be omitted when the experiment has exactly one task.

  • method (str) – Method for ICA decomposition (default: 'extended-infomax'; see mne.preprocessing.ICA).

  • random_state (int) – Set the random state for ICA decomposition to make results reproducible (default 0, see mne.preprocessing.ICA).

  • fit_kwargs (dict[str, Any]) – A dictionary with keyword arguments that should be passed to mne.preprocessing.ICA.fit(). This includes reject={'mag': 5e-12, 'grad': 5000e-13, 'eeg': 300e-6} unless a different value for reject is specified here.

  • cache (bool) – Cache the resulting raw files (default False).

  • ... – Additional parameters for mne.preprocessing.ICA.

Notes

This preprocessing step estimates one set of ICA components per subject, using the data specified in the task parameter. If the experiment has exactly one task, task can be omitted. The selected components are then removed from all data tasks during this preprocessing step, regardless of whether they were used to estimate the components or not.

Use Pipeline.make_ica_selection() for each subject to select ICA components that should be removed. The arguments to that function determine what data is used to visualize the component time courses.

This step merges bad channels from all tasks.

Examples

Some ICA examples:

class Experiment(Pipeline):

    raw = {
        '1-40': RawFilter('raw', 1, 40),
        # Extended infomax with PCA preprocessing
        'ica': RawICA('1-40', n_components=0.99),
        # Fast ICA
        'fastica': RawICA('1-40', 'task', 'fastica', n_components=0.9),
        # Change thresholds for data rejection using fit_kwargs
        'ica-rej': RawICA('1-40', 'task', 'fastica', fit_kwargs=dict(
            reject={'mag': 5e-12, 'grad': 5000e-13, 'eeg': 500e-6},
        )),
    }