searchlight: Create a clustered searchlight iterator

View source: R/searchlight.R

clustered_searchlightR Documentation

Create a clustered searchlight iterator

Description

This function generates a searchlight iterator that iterates over successive spatial clusters in an image volume. It allows for the exploration of spatially clustered regions within the provided mask by using either a pre-defined clustered volume or performing k-means clustering to generate the clusters.

Usage

clustered_searchlight(mask, cvol = NULL, csize = NULL)

Arguments

mask

A NeuroVol object representing the brain mask, containing valid central voxels for the roving searchlight.

cvol

An optional ClusteredNeuroVol instance representing pre-defined clusters within the mask. If provided, the 'csize' parameter is ignored.

csize

An optional integer specifying the number of clusters to be generated using k-means clustering (ignored if cvol is provided).

Value

A deferred_list object containing ROIVol objects, each representing a clustered region within the image volume.

Examples

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

# Generate a clustered searchlight iterator with 5 clusters
## Not run: 
clust_searchlight <- clustered_searchlight(mask, csize = 5)

## End(Not run)


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