makeVolume: makeVolume

Description Usage Arguments Value Examples

View source: R/BrainVolume.R

Description

Construct a BrainVolume instance, using default (dense) implementation

Usage

1
2
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

1
2
3
4
5
6
7
8
9
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)

neuroim documentation built on May 2, 2019, 1:04 p.m.