Skip to content

Function: splitReduce()

ts
function splitReduce(
   x, 
   fac, 
   FUN): NeuroVol;

Defined in: src/stats/stats.ts:379

Reduce a NeuroVec by applying a function across factor levels.

Splits the NeuroVec by factor levels and applies a reduction function to each voxel's time series within each level, returning a volume where each voxel contains the reduced value.

Parameters

x

NeuroVec

The 4D data to reduce

fac

| Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike>

Factor array with length equal to number of volumes

FUN

(values) => number

Function to apply to each voxel's values within a level

Returns

NeuroVol

Volume containing reduced values

Released under the MIT License.