ffrprep.preproc.save_preprocessing_outputs

ffrprep.preproc.save_preprocessing_outputs(epochs, bids_root, subject, task, session=None, run=None, output_dir=None)[source]

Save preprocessing outputs to BIDS derivatives structure.

Parameters:
  • epochs (mne.Epochs or dict[str, mne.Epochs]) – Epoched data to save. When a dict is passed (one key per trial type), one BIDS file is written per condition with the _desc-preproc{Condition}_epo.fif filename pattern, and the per-file sidecar carries a Condition field.

  • bids_root (str or pathlib.Path) – Path to the BIDS dataset root directory.

  • subject (str) – Subject label (without ‘sub-’ prefix).

  • task (str) – Task label (without ‘task-’ prefix). Required for BIDS compliance.

  • session (str, optional) – Session label (without ‘ses-’ prefix).

  • run (str or int, optional) – Run label (without ‘run-’ prefix).

Returns:

output_path – Single Path for scalar Epochs input; list of Paths (one per condition) for dict input.

Return type:

pathlib.Path or list[pathlib.Path]