random_searchlight: Create a spherical random searchlight iterator

View source: R/searchlight.R

random_searchlightR Documentation

Create a spherical random searchlight iterator

Description

This function generates a spherical random searchlight iterator, which can be used to analyze the local neighborhood of voxels within a given radius in a brain mask.

Usage

random_searchlight(mask, radius)

Arguments

mask

A NeuroVol object representing the brain mask.

radius

A numeric value specifying the radius of the searchlight sphere in voxel units.

Value

A list of ROIVolWindow objects, each representing a spherical searchlight region.

Examples

# Create a simple brain mask
mask <- array(TRUE, c(10, 10, 10))
mask[1, 1, 1] <- FALSE
mask <- LogicalNeuroVol(mask, NeuroSpace(c(10,10,10)))
# Generate random searchlight iterator with a radius of 2 voxels

## Not run: searchlights <- random_searchlight(mask, radius = 2)



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