ddmra.workflows.run_analyses

run_analyses(files, qc, out_dir='.', confounds=None, n_iters=10000, n_jobs=1, qc_thresh=0.2, window=1000)[source]

Run scrubbing, high-low motion, and QCRSFC analyses.

Parameters
  • files ((N,) list of nifti files) – List of 4D (X x Y x Z x T) images in MNI space.

  • qc ((N,) list of array_like) – List of 1D (T) numpy arrays with QC metric values per img (e.g., FD or respiration).

  • out_dir (str, optional) – Output directory. Default is current directory.

  • confounds (None or (N,) list of array-like, optional) – List of 2D (T) numpy arrays with confounds per img. Default is None (no confounds are removed).

  • n_iters (int, optional) – Number of iterations to run to generate null distributions. Default is 10000.

  • n_jobs (int, optional) – The number of CPUs to use to do the computation. -1 means ‘all CPUs’. Default is 1.

  • qc_thresh (float, optional) – Threshold for QC metric used in scrubbing analysis. Default is 0.2 (for FD).

  • window (int, optional) – Number of units (pairs of ROIs) to include when averaging to generate smoothing curve. Default is 1000.

Notes

This function writes out several files to out_dir: - analysis_values.tsv.gz: Raw analysis values for analyses.

Has four columns: distance, qcrsfc, scrubbing, and highlow.

  • smoothing_curves.tsv.gz: Smoothing curve information for analyses.

    Has four columns: distance, qcrsfc, scrubbing, and highlow.

  • null_smoothing_curves.npz:

    Null smoothing curves from each analysis. Contains three 2D arrays, where number of columns is same size and order as distance column in smoothing_curves.tsv.gz and number of rows is number of iterations for permutation analysis. The three arrays’ keys are ‘qcrsfc’, ‘highlow’, and ‘scrubbing’.

  • [analysis]_analysis.png: Figure for each analysis.