ffrprep.group.build_metrics_dictionary

ffrprep.group.build_metrics_dictionary(columns, *, response_window=(0.1, 0.2), harmonics=None, stimulus=None, n_trials_presented=None, min_usable_pct=None, min_snr=None, covariate_sources=None)[source]

Build a BIDS-style data dictionary for the group metrics TSV.

Parameters:
  • columns (sequence of str) – Column names of the saved metrics table, in order.

  • response_window – The options the metrics were computed with (as returned by _metric_options_from_args); descriptions embed the actual windows and thresholds so the dictionary documents the run.

  • harmonics – The options the metrics were computed with (as returned by _metric_options_from_args); descriptions embed the actual windows and thresholds so the dictionary documents the run.

  • stimulus – The options the metrics were computed with (as returned by _metric_options_from_args); descriptions embed the actual windows and thresholds so the dictionary documents the run.

  • n_trials_presented – The options the metrics were computed with (as returned by _metric_options_from_args); descriptions embed the actual windows and thresholds so the dictionary documents the run.

  • min_usable_pct – The options the metrics were computed with (as returned by _metric_options_from_args); descriptions embed the actual windows and thresholds so the dictionary documents the run.

  • min_snr – The options the metrics were computed with (as returned by _metric_options_from_args); descriptions embed the actual windows and thresholds so the dictionary documents the run.

  • covariate_sources (dict, optional) – {column: path} from merge_covariates(..., return_sources=True). A covariate’s description (and levels/units) is copied from the JSON sidecar next to its TSV (participants.json, phenotype/*.json) when present.

Returns:

{column: {"Description": ..., "Units": ...}} with one entry per column, in the order of columns. Unknown columns get a stub entry.

Return type:

dict