Skip to content

Function: partition()

ts
function partition(
   x, 
   k, 
   method?, 
   mask?, 
   seed?): ClusteredNeuroVol;

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

Partition a volume into k regions using clustering.

Uses clustering algorithms to partition the brain volume into k distinct regions based on voxel values.

Parameters

x

NeuroVol

The volume to partition

k

number

Number of partitions/clusters

method?

string = 'kmeans'

Clustering method (currently only "kmeans")

mask?

LogicalNeuroVol

Optional mask to restrict clustering to specific voxels

seed?

number = 1

Returns

ClusteredNeuroVol

Clustered volume with partition labels

Released under the MIT License.