prep_regional: Prepare regional data for MVPA analysis

View source: R/regional.R

prep_regionalR Documentation

Prepare regional data for MVPA analysis

Description

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.

Usage

prep_regional(model_spec, 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)

bbuchsbaum/rMVPA documentation built on April 28, 2024, 6:30 a.m.