Maps a set of values to regions/parcels in an atlas object. This can be used to visualize data (like statistics or measurements) across atlas regions.
Arguments
- x
An atlas object to map values onto
- vals
Numeric vector of values to map to atlas regions. Length should match the number of regions in the atlas
- thresh
Optional numeric vector of length 2 specifying (min, max) thresholds for the mapped values. Values outside this range will be clamped.
- ...
Additional arguments passed to methods
- pos
Logical. If `TRUE`, values are thresholded using raw values; otherwise the absolute values are used.
Examples
if (FALSE) { # \dontrun{
# Load the aseg atlas
atlas <- get_aseg_atlas()
vals <- rnorm(length(atlas$orig_labels))
# Map values with a threshold of -2 to 2
mapped <- map_atlas(atlas, vals, thresh = c(-2, 2))
} # }