Applies a parcellation atlas to a preprocessed BOLD image, returning
mean timeseries per ROI. Works with any boldR_atlas object – built-in
or custom – as long as the atlas is in the same template space as the BOLD.
Arguments
- bold
A
boldR_boldobject fromprepare_bold().- atlas
A
boldR_atlasobject fromload_atlas().- summary_fn
Function. Applied across voxels within each ROI at each timepoint. Default
mean. Common alternatives:median.- min_voxels
Integer. Minimum number of in-mask voxels an ROI must contain to be included in the output. ROIs below this threshold are returned with
NAtimeseries and a warning. Default10L.
Value
A list of class boldR_parcellated with components:
- timeseries
Numeric matrix, timepoints x ROIs. Column names are ROI labels from the atlas.
- roi_voxel_counts
Integer vector. Number of in-mask voxels per ROI.
- atlas
The
boldR_atlasobject used.- bold
The
boldR_boldobject used.- n_rois
Integer. Number of ROIs in output.
- n_timepoints
Integer. Number of timepoints.
Examples
if (FALSE) { # \dontrun{
fprep <- read_fmriprep("data/derivatives/fmriprep", subject = "01")
bold <- prepare_bold(fprep, tr = 2, drop_volumes = 4)
atlas <- load_atlas("schaefer100_7n")
parcel <- parcellate(bold, atlas)
dim(parcel$timeseries) # timepoints x 100
} # }