ffrprep.preproc.save_analysis_outputs

ffrprep.preproc.save_analysis_outputs(evoked, bids_root, subject, task, session=None, run=None, analysis_type='evoked', output_dir=None)[source]

Save analysis outputs to BIDS derivatives structure.

Parameters:
  • evoked (mne.Evoked or dict) – Either a single Evoked (treated as the combined output) or a structured payload with keys drawn from {"by_type", "combined", "diff"} (any subset). by_type is dict[str, Evoked] keyed by trial-type name; combined is a single mne.Evoked; diff is dict[tuple[str, str], Evoked] keyed by (A, B).

  • 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).

  • analysis_type (str) – Type of analysis output (‘evoked’, ‘spectrum’, etc.).

Returns:

output_paths – Paths to the saved files. Per-type entries use _desc-{analysis_type}{Cond}.fif; combined uses _desc-{analysis_type}.fif; diff uses _desc-{analysis_type}Diff{A}Vs{B}.fif.

Return type:

list of pathlib.Path