psychopy_ext.fmri.Analysis.run_method

Analysis.run_method(subjids, runtype, rois, method='svm', values='raw', offset=None, dur=None, filename='RENAME.pkl', simds=None)[source]

A wrapper for running a specified analysis.

Process:
  1. Attempt to load stored results from the analysis that was done before. (stored in teh analysis folder in a file <method>_<values>_<subjid>.pkl

  2. If that fails, it’s probably because the analysis has not been performed yet or, in rare cases, because the data file is corrupt or missing. So a new analysis is initiated.

    1. First, Regions of Interest (ROIs) are loaded from PATHS['data_rois']
    2. If that is not possible, then ROIs are extracted from anatomical data using functional localizer data from SPM.
    3. Extracted ROIs are stored in PATHS['data_rois'].
    4. Finally, the specified analysis is performed.
Args:
  • subjids (str of list of str)

    Which participants should be analyzed

  • runtype (str)

    Which run type should be taken. Usually you have a few runs, such as main experimental runs and localizer runs. They should have be labeled data file

  • rois (list of dict)

    Names of ROIs to use, formatted with :func:~psychopy_ext.fmri.make_roi_pattern()

Kwargs:
  • method: {‘timecourse’, ‘univariate’, ‘signal’, ‘corr’, ‘svm’} (default: ‘svm’}

    Method to analyze data.

  • values: {‘raw’, ‘beta’, ‘t’}

    fMRI signal values to use. If ‘raw’, you have to pass offset and duration. If you intend to try a few different parameters for ‘raw’, e.g. a duration of 1 TR and 3 TRs, you may indicate that in the value parameter like values='raw_3' which will be useful in order not to confuse output files (they get prefixes based on the value name). e.g.:

    offset = {'V1': 4, 'V2': 4, 'V3': 4, 'LO': 3, 'pFs': 3}
    dur = 1