Last data update: 2014.03.03
|
R: makeVolume
makeVolume | R Documentation |
makeVolume
Description
Construct a BrainVolume instance, using default (dense) implementation
Usage
makeVolume(data = NULL, refvol, source = NULL, label = "",
indices = NULL)
Arguments
data |
an optional one- or three-dimensional vector or array
|
refvol |
an instance of class BrainVolume containing the reference space for the new volume.
|
source |
an optional instance of class BrainSource
|
label |
an optional character string
|
indices |
an optional 1d vector of indices in to the 3d space
|
Value
DenseBrainVolume instance
Examples
bspace <- BrainSpace(c(64,64,64), spacing=c(1,1,1))
dat <- array(rnorm(64*64*64), c(64,64,64))
bvol <- BrainVolume(dat,bspace, label="test")
bvol2 <- makeVolume(dat, bvol)
all.equal(as.array(bvol),as.array(bvol2))
data <- 1:10
indices = seq(1,1000, length.out=10)
bvol3 <- makeVolume(data,bvol,indices=indices)
sum(bvol3) == sum(data)
Results
|