pyavs.apply_precomputed_ica

pyavs.apply_precomputed_ica(raw: mne.io.Raw, subject_id: int, session: int, data_path: str | None = None, ica_solutions_dir: str | None = None, ica_exclusions_file: str | None = None, verbose: bool = True) mne.io.Raw[source]

Apply precomputed ICA solution to MEG data.

This function loads a precomputed ICA solution and applies it to the MEG data, following standard MEG preprocessing methodology.

Parameters:
  • raw (mne.io.Raw) – MEG raw data

  • subject_id (int) – Subject ID

  • session (int) – Session number

  • data_path (str, optional) – Path to the avs-public data root. If None, uses configured data path. Ignored if ica_solutions_dir and ica_exclusions_file are given.

  • ica_solutions_dir (str, optional) – Directory of precomputed ICA solutions in the legacy {dir}/as01a/as01a-ica.fif layout, for a solution computed outside the derivatives/pyavs tree. Only used if both this and ica_exclusions_file are given; otherwise the shipped derivatives/pyavs ICA solution is used.

  • ica_exclusions_file (str, optional) – JSON file of component exclusions matching ica_solutions_dir.

  • verbose (bool, optional) – Whether to print progress information (default: True)

Returns:

MEG data with precomputed ICA applied

Return type:

mne.io.Raw

Raises: