searchlight_coords | R Documentation |
This function generates an exhaustive searchlight iterator that returns voxel coordinates for each searchlight sphere within the provided mask. The iterator visits every non-zero voxel in the mask as a potential center voxel.
searchlight_coords(mask, radius, nonzero = FALSE, cores = 0)
mask |
A |
radius |
A numeric value specifying the radius (in mm) of the spherical searchlight. |
nonzero |
A logical value indicating whether to include only coordinates with nonzero values in the supplied mask. Default is FALSE. |
cores |
An integer specifying the number of cores to use for parallel computation. Default is 0, which uses a single core. |
A deferred_list
object containing matrices of integer-valued
voxel coordinates, each representing a searchlight region.
# Load an example brain mask
mask <- read_vol(system.file("extdata", "global_mask.nii", package="neuroim2"))
# Generate an exhaustive searchlight iterator with a radius of 6 mm
## Not run:
searchlights <- searchlight_coords(mask, radius = 6)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.