Learn R Programming

neuroim (version 0.0.6)

SparseBrainVolume-class: SparseBrainVolume

Description

Three-dimensional brain image, backed by a sparseVector for Matrix package

Construct a SparseBrainVolume instance

Usage

SparseBrainVolume(data, space, indices = NULL, source = NULL, label = "")

Arguments

data
a numeric vector
space
an instance of class BrainSpace
indices
a index vector indicating the 1-d coordinates of the data values
source
an instance of class BrainSource
label
a character string

Value

SparseBrainVolume instance

Slots

data
a sparseVector instance

Details

Image data is backed by Matrix::sparseVector.

Examples

Run this code
data <- 1:10
indices <- seq(1,1000, length.out=10)
bspace <- BrainSpace(c(64,64,64), spacing=c(1,1,1))
sparsevol <- SparseBrainVolume(data,bspace,indices=indices)
densevol <- BrainVolume(data,bspace,indices=indices)
sum(sparsevol) == sum(densevol)



Run the code above in your browser using DataLab