LatentNeuroVec-class | R Documentation |
a class that stores a represents a 4-dimensional array as a set of basis functions (dictionary) and corresponding set of loadings (coefficients).
This function constructs a LatentNeuroVec object from a basis, associated loadings, a NeuroSpace instance, a mask, and an optional offset.
LatentNeuroVec(basis, loadings, space, mask, offset = NULL)
basis |
A numeric n-by-k matrix containing the latent vectors forming the reduced space. |
loadings |
A numeric p-by-k matrix of p loadings. |
space |
A NeuroSpace instance defining the dimensions, spacing, origin, axes, and transformation of the neuroimaging space. |
mask |
A 3D logical array, 1D logical vector, or an instance of LogicalNeuroVol class representing the brain mask. |
offset |
An optional numeric 1-by-p offset vector. If not provided, it defaults to a zero vector. |
A new LatentNeuroVec
instance representing the latent neuroimaging vectors.
basis
the matrix of bases, were each column is a basis vector.
loadings
the sparseMatrix
of loadings
offset
an offset vector
LatentNeuroVec(basis, loadings, space, mask, offset = NULL)
bspace <- NeuroSpace(c(2,2,2,10), c(1,1,1)) mask <- array(rnorm(2*2*2) > -100, c(2,2,2)) mat <- matrix(rnorm(sum(mask)), 10, sum(mask)) pres <- prcomp(mat) svec <- LatentNeuroVec(pres$x, pres$rotation, bspace, mask, offset=colMeans(mat)) svec2 <- SparseNeuroVec(mat, bspace, mask) length(indices(svec)) == sum(mask) all.equal(svec2[1:prod(dim(mask))], svec[1:prod(dim(mask))])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.