bootstrap_searchlight: Create a spherical searchlight iterator that samples regions...

View source: R/searchlight.R

bootstrap_searchlightR Documentation

Create a spherical searchlight iterator that samples regions from within a mask

Description

This function generates a spherical searchlight iterator by sampling regions from within a brain mask. It creates searchlight spheres around random center voxels, allowing the same surround voxel to belong to multiple searchlight samples.

Usage

bootstrap_searchlight(mask, radius = 8, iter = 100)

Arguments

mask

A NeuroVol object representing the brain mask.

radius

A numeric value specifying the radius of the searchlight sphere in voxel units (default is 8).

iter

An integer specifying the total number of searchlights to sample (default is 100).

Details

Searchlight centers are sampled without replacement, but the same surround voxel can belong to multiple searchlight samples.

Value

A deferred_list object containing ROIVolWindow objects, each representing a spherical searchlight region sampled from within the mask.

Examples

# Load an example brain mask
mask <- read_vol(system.file("extdata", "global_mask.nii", package="neuroim2"))

# Generate a bootstrap searchlight iterator with a radius of 6 voxels
## Not run: 
searchlights <- bootstrap_searchlight(mask, radius = 6)

## End(Not run)


bbuchsbaum/neuroim2 documentation built on April 20, 2024, 4:20 p.m.