IndexLookupVol-class | R Documentation |
A three-dimensional brain image class that serves as a map between 1D grid indices
and a table of values. This class is primarily used in conjunction with the
SparseNeuroVec
class to efficiently represent and access
sparse neuroimaging data.
This function creates an IndexLookupVol object, which represents a lookup volume for efficient indexing of voxels in a 3D brain image space.
IndexLookupVol(space, indices)
space |
A |
indices |
An integer vector containing the 1D indices of the voxels in the grid. |
The IndexLookupVol class extends NeuroVol
and provides a
mechanism for efficient lookup and mapping of sparse 3D neuroimaging data. It
stores only the indices of non-zero voxels and their corresponding mappings,
allowing for memory-efficient representation of large, sparse brain images.
An object of class IndexLookupVol
representing the index lookup volume.
space
A NeuroSpace
object representing the 3D space of the brain image.
indices
An integer vector containing the 1D indices of the non-zero voxels in the grid.
map
An integer vector containing the mapping between the 1D indices and the table of values.
This class inherits methods from NeuroVol
. Additional
methods specific to index lookup and mapping operations may be available.
SparseNeuroVec-class
for the primary class that utilizes IndexLookupVol.
NeuroVol-class
for the base volumetric image class.
IndexLookupVol
, NeuroSpace
# Create a NeuroSpace object
space <- NeuroSpace(dim = c(2L, 2L, 2L), origin = c(0, 0, 0), spacing = c(1, 1, 1))
# Create a 3D mask
mask <- array(c(TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE), dim = c(2, 2, 2))
# Create indices and map for the IndexLookupVol
indices <- which(mask)
map <- seq_along(indices)
# Create an IndexLookupVol object
ilv <- new("IndexLookupVol", space = space, indices = as.integer(indices), map = map)
# Access the indices
print(ilv@indices)
# Access the map
print(ilv@map)
## Not run:
space <- NeuroSpace(c(64, 64, 64), c(1, 1, 1), c(0, 0, 0))
indices <- sample(1:262144, 10000) # Random selection of 10000 voxels
ilv <- IndexLookupVol(space, indices)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.