spherical_roi_set | R Documentation |
This function generates multiple spherical ROIs simultaneously, centered at the provided
voxel coordinates. It is more efficient than calling spherical_roi
multiple times
when you need to create many ROIs.
spherical_roi_set(bvol, centroids, radius, fill = NULL, nonzero = FALSE)
bvol |
A |
centroids |
A matrix of voxel coordinates where each row represents a centroid (i,j,k) |
radius |
The radius in real units (e.g. millimeters) of the spherical ROIs |
fill |
Optional value(s) to store as data. If provided, must be either a single value or a vector with length equal to the number of ROIs |
nonzero |
If |
A list of ROIVolWindow
objects, one for each centroid
# Create a NeuroSpace object
sp1 <- NeuroSpace(c(10,10,10), c(1,2,3))
# Create multiple ROIs centered at different voxel coordinates
centroids <- matrix(c(5,5,5, 3,3,3, 7,7,7), ncol=3, byrow=TRUE)
rois <- spherical_roi_set(sp1, centroids, 3.5)
# Create ROIs with specific fill values
rois <- spherical_roi_set(sp1, centroids, 3.5, fill=c(1,2,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.