xcp_d.utils.bids

Utilities for fmriprep bids derivatives and layout.

Most of the code is copied from niworkflows. A PR will be submitted to niworkflows at some point.

Functions

collect_data(bids_dir, input_type, ...[, ...])

Collect data from a BIDS dataset.

collect_participants(bids_dir[, ...])

Collect a list of participants from a BIDS dataset.

collect_run_data(layout, input_type, ...)

Collect data associated with a given BOLD file.

collect_surface_data(layout, participant_label)

Collect surface files from preprocessed derivatives.

get_entity(filename, entity)

Extract a given entity from a BIDS filename via string manipulation.

get_freesurfer_dir(fmri_dir)

Find FreeSurfer derivatives associated with preprocessing pipeline.

get_freesurfer_sphere(freesurfer_path, ...)

Find FreeSurfer sphere file.

get_preproc_pipeline_info(input_type, fmri_dir)

Get preprocessing pipeline information from the dataset_description.json file.

group_across_runs(in_files)

Group preprocessed BOLD files by unique sets of entities, ignoring run.

write_dataset_description(fmri_dir, xcpd_dir)

Write dataset_description.json file for derivatives.

Exceptions

BIDSError(message, bids_root)

A generic error related to BIDS datasets.

BIDSWarning

A generic warning related to BIDS datasets.