rsatoolbox.io.fmriprep module

Tools to navigate output of fmriprep, the fmri preprocessing pipeline

class rsatoolbox.io.fmriprep.FmriprepRun(boldFile: BidsMriFile)[source]

Bases: object

Represents a single fmriprep BOLD run and metadata

boldFile: BidsMriFile
get_channel_descriptors(masked: bool = False) Dict[source]
get_confounds(cf_names: List[str] | None = None) DataFrame[source]

_summary_

Returns:

_description_

Return type:

DataFrame

get_data(masked: bool = False)[source]
get_dataset_descriptors() Dict[source]
get_events()[source]
get_mask() NDArray[source]
get_meta()[source]
get_obs_descriptors(collapse_by_trial_type: bool = False) Dict[source]
get_parcellation()[source]
get_parcellation_labels()[source]
property run
property ses
property sub
to_descriptors(collapse_by_trial_type: bool = False, masked: bool = False) Dict[source]

Get dictionary of dataset, observation and channel- level descriptors

Returns:

kwargs for DatasetBase with keys:

descriptors: sub, ses, run and task BIDS entities obs_descriptors: trial_type from BIDS events channel_descriptors: empty

Return type:

Dict

rsatoolbox.io.fmriprep.find_fmriprep_runs(bids_root_path: str, tasks: List[str] | None = None) List[FmriprepRun][source]

Find all sub/ses/task/run entries for which there is a preproc_bold file

rsatoolbox.io.fmriprep.make_design_matrix(events: DataFrame, tr: float, n_vols: int, confounds: DataFrame | None) Tuple[NDArray, NDArray, int][source]

Create a matrix of HRF-convolved predictors from BIDS events

Parameters:
  • events (DataFrame) – BIDS-style table of events

  • tr (float) – Time to repeat scan in seconds

  • n_vols (int) – duration of the matrix (max extend beyond design)

  • confounds (DataFrame) – A table of BOLD confounds

Returns:

NDArray: volumes * conditions NDArray: boolean mask to signifiy predictors vs confounds int: degrees of freedom

Return type:

Tuple of