Identify fMRIPrep-Derived Outputs for a NIfTI File
Source:R/bids_functions.R
get_fmriprep_outputs.Rd
Given the path to a preprocessed NIfTI file from fMRIPrep or fMRIPost, this function identifies and returns associated derivative files in the same directory. This includes the corresponding brain mask, confound regressors, ICA-AROMA melodic mixing matrix, AROMA classification metrics, and a list of rejected noise components (if available).
Value
A named list containing the following elements:
- bold
The input BOLD file path (returned if found).
- brain_mask
The corresponding brain mask file (or
NULL
if not found).- confounds
The path to the confounds
.tsv
file (orNULL
).- melodic_mix
Path to the melodic mixing matrix from ICA-AROMA (if present).
- aroma_metrics
Path to the AROMA classification metrics file (if present).
- noise_ics
A vector of rejected ICA components based on AROMA classification (or
NULL
).- prefix
A string encoding the core BIDS identifier used to construct expected filenames.
Details
This function assumes filenames follow BIDS Derivatives conventions and uses the
extracted BIDS entities to reconstruct expected filenames via construct_bids_filename()
.
The function checks for two possible confounds files (desc-confounds_timeseries.tsv
and
desc-confounds_regressors.tsv
), and attempts to resolve AROMA-rejected ICs from the
AROMA classification metrics file (_desc-aroma_metrics.tsv
) if present.