Skip to content

Function: randomSearchlight() ​

ts
function randomSearchlight(
   mask, 
   radius, 
   options?): ROIVolWindow[];

Defined in: src/searchlight/searchlight.ts:269

Create a spherical random searchlight iterator.

This function generates a spherical random searchlight iterator for analyzing local neighborhoods of voxels within a given radius in a brain mask. The algorithm randomly selects centers and removes all voxels within the searchlight from future consideration.

Centers are drawn from a seedable generator: pass options.seed (or options.rng) for a reproducible set of searchlights. Without either, each call draws a fresh seed, so successive calls give different searchlights.

Parameters ​

mask ​

| NeuroVol | LogicalNeuroVol

A NeuroVol object representing the brain mask

radius ​

number

The radius of the searchlight sphere (in mm)

options? ​

RandomSearchlightOptions = {}

Randomness control: seed or rng

Returns ​

ROIVolWindow[]

Array of ROIVolWindow objects

Released under the MIT License.