Prepare regional data for MVPA analysis
prep_regional.Rd
This function processes the input data and prepares the regions for MVPA analysis by extracting voxel indices for each region of interest (ROI) specified in the region_mask.
Arguments
- model_spec
A model specification object.
- region_mask
A mask representing different regions in the brain image.
Value
A list containing information about the regions for further processing: * allrois: A vector of unique ROI labels. * region_vec: A vector representation of the region_mask. * region_set: A sorted vector of unique ROI labels in the region_mask. * vox_iter: A list containing voxel indices for each ROI. * lens: A vector containing the number of voxels in each ROI. * keep: A logical vector indicating if an ROI should be kept for analysis (those with more than one voxel).
Examples
# Create example inputs
model_spec <- list(dataset = "Example dataset")
region_mask <- matrix(c(rep(0, 5), rep(1, 5), rep(2, 5), rep(3, 5)), nrow = 5)
# Prepare regional data
regional_data <- prep_regional(model_spec, region_mask)
#> Error in model_spec$dataset$mask: $ operator is invalid for atomic vectors