Skip to contents

Usage

mvpa_iterate(
  mod_spec,
  vox_list,
  ids = 1:length(vox_list),
  batch_size = as.integer(0.1 * length(ids)),
  verbose = TRUE,
  processor = NULL
)

Arguments

mod_spec

An MVPA model specification object containing the dataset to analyze, compute_performance (logical indicating whether to compute performance metrics), and return_predictions (logical indicating whether to return predictions)

vox_list

A list of voxel indices or coordinates defining each ROI to analyze

ids

Vector of identifiers for each ROI analysis. Defaults to 1:length(vox_list)

batch_size

Integer specifying number of ROIs to process per batch. Defaults to 10

verboseLogical indicating whether to print progress messages. Defaults to TRUE

processorOptional custom processing function. If NULL, uses default processor. Must accept parameters (obj, roi, rnum) and return a tibble.

A tibble containing results for each ROI with columns:

  • resultList column of analysis results (NULL if return_predictions=FALSE)

  • indicesList column of ROI indices used

  • performanceList column of performance metrics (if computed)

  • idROI identifier

  • errorLogical indicating if an error occurred

  • error_messageError message if applicable

  • warningLogical indicating if warning occurred

  • warning_messageWarning message if applicable

Performs multivariate pattern analysis (MVPA) across multiple regions of interest (ROIs) using batch processing and parallel computation. The function processes ROIs in batches to manage memory usage. For each batch: 1. Extracts ROI data from the dataset 2. Filters out ROIs with fewer than 2 voxels 3. Processes each ROI using either the default or custom processor 4. Combines results across all batches