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_dirandica_exclusions_fileare given.ica_solutions_dir (str, optional) – Directory of precomputed ICA solutions in the legacy
{dir}/as01a/as01a-ica.fiflayout, for a solution computed outside thederivatives/pyavstree. Only used if both this andica_exclusions_fileare given; otherwise the shippedderivatives/pyavsICA 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:
- Raises:
FileNotFoundError – If ICA solution file is not found
ValueError – If ICA solution is incompatible with data