Skip to content

Function: splitBlocks()

ts
function splitBlocks(
   x, 
   indices, 
   blockIds): (
  | NeuroVol
  | NeuroVec)[];

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

Split a NeuroVol or NeuroVec into blocks using indices.

Creates separate volumes/vectors for each unique block ID, where each block contains only the data from voxels with that block ID.

Parameters

x

| NeuroVol | NeuroVec

The data to split

indices

| Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>

1D indices into the data array

blockIds

Int32Array

Block ID for each index (same length as indices)

Returns

( | NeuroVol | NeuroVec)[]

List of blocks, one for each unique block ID

Released under the MIT License.