mean-methods: Temporal Mean of a NeuroVec

mean-methodsR Documentation

Temporal Mean of a NeuroVec

Description

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

Usage

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

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

## S4 method for signature '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


neuroim2 documentation built on April 16, 2026, 5:07 p.m.