View source: R/neurohypervec.R
NeuroHyperVec | R Documentation |
Constructor for NeuroHyperVec class
NeuroHyperVec(data, space, mask)
data |
A matrix or three-dimensional array containing the data. |
space |
A |
mask |
A mask volume (array, vector, or |
A new NeuroHyperVec
object.
NeuroSpace
, LogicalNeuroVol
# Create a 5D space (10x10x10 spatial, 2 trials, 2 features)
space <- NeuroSpace(c(10,10,10,2,2))
# Create a mask for the spatial dimensions
space3d <- NeuroSpace(c(10,10,10))
mask_data <- array(TRUE, dim=c(10,10,10)) # All voxels active
mask <- LogicalNeuroVol(mask_data, space3d)
# Create data in the format expected by NeuroHyperVec:
# 3D array with dimensions [features x trials x voxels]
n_features <- 2
n_trials <- 2
n_voxels <- sum(mask_data) # 1000 voxels
data_array <- array(rnorm(n_features * n_trials * n_voxels),
dim = c(n_features, n_trials, n_voxels))
# Create the NeuroHyperVec object
hvec <- NeuroHyperVec(data_array, space, mask)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.