Description Usage Arguments Value Examples
Generic function to extract a sub-vector from a BrainVector
object.
1 2 3 4 5 6 7 |
x |
four-dimensional image |
i |
the indices of the volume(s) to extract |
... |
additional arguments |
a BrainVector
object that is a sub-vector of the supplied object.
1 2 3 4 5 6 7 8 9 10 11 12 | bvec <- BrainVector(array(rnorm(24*24*24*24), c(24,24,24,24)), BrainSpace(c(24,24,24,24), c(1,1,1)))
vec <- subVector(bvec,1:2)
all.equal(2, dim(vec)[4])
vec <- subVector(bvec, c(1,3,5,7))
all.equal(4, dim(vec)[4])
mask <- LogicalBrainVolume(rep(TRUE, 24*24*24), BrainSpace(c(24,24,24), c(1,1,1)))
svec <- SparseBrainVector(array(rnorm(24*24*24*24), c(24,24,24,24)),
BrainSpace(c(24,24,24,24), c(1,1,1)), mask)
vec <- subVector(svec, c(1,3,5))
all.equal(3, dim(vec)[4])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.