Skip to contents

Computes the voxel-wise mean across the 4th dimension (time), returning a 3D DenseNeuroVol or SparseNeuroVol.

Usage

# S4 method for class 'DenseNeuroVec'
mean(x, ...)

# S4 method for class 'SparseNeuroVec'
mean(x, ...)

# S4 method for class 'NeuroVec'
mean(x, ...)

Arguments

x

A NeuroVec object.

...

Ignored.

Value

A NeuroVol containing the temporal mean at each voxel.

Examples

bspace <- NeuroSpace(c(10, 10, 10, 20), c(1, 1, 1))
dat <- array(rnorm(10 * 10 * 10 * 20), c(10, 10, 10, 20))
vec <- DenseNeuroVec(dat, bspace)
mean_vol <- mean(vec)
dim(mean_vol)  # 10 10 10
#> [1] 10 10 10