Analysis.__init__(paths, tr, info=None, rp=None, fmri_prefix='swa*', fix=0, rois=None, offset=None, dur=None, condlabel='cond', durlabel='dur')[source]

For conducting functional magnetic resonance imaging analyses.


  1. For beta- and t-values, analyses were done is SPM.
  2. Functional runs named as func_<runno>, anatomicals named as struct<optional extra stuff>, behavioral data files (or files with condition assignments) as <something>_<runno>_<runtype>.csv
  3. Beta-values model every condition, including fixation. But t-values are computed as each conditions versus a fixation.
  • paths (dict of str:str pairs)

    A dictionary of paths where data is stored. Expected to have at least the following keys:

    • ‘analysis’ (for storing analysis outputs),
    • ‘data_behav’ (behavioral data with condition labels),
    • ‘data_fmri’,
    • ‘rec’ (for ROIs from surface reconstruction in Caret or so),
    • ‘data_rois’ (for storing the extracted signals in these ROIs)
  • tr (int or float)

    Time of repetition during the fMRI scan. Usually 1, 2, or 3 seconds. This information is not reliably coded in NIfTI files, so you need to define it yourself.

  • info (dict, default: None)

    All parameters related to participant information

  • rp (dict, default: None)

    All runtime parameters that you want to be able to access from GUI or CLI. Expected to have at least:

    • no_output
    • verbose
    • force
  • fmri_prefix (str, default: ‘swa*’)

    Prefix of SPM output functional scans that you want to analyze.

  • fix (int or str, default: 0)

    Label to identify fixation condition.

  • rois (list of str)

    A list of ROIs to analyze. See make_roi_pattern() for accepted formats.

  • offset (int or dict)

    E.g., {‘V1’: 4, ‘V2’: 4, ‘V3’: 4, ‘LO’: 3, ‘pFs’: 3}

  • dur (int or dict)

    Same format as ‘offset’.

  • condlabel (str, default: ‘cond’)

    Name of the column in your data file where condition number of each trial is kept.

  • durlabel (str, default: ‘dur’)

    Name of the column in your data file where duration of each trial is kept.