Skip to content

Function: centroids()

ts
function centroids(x, method?): Map<number, [number, number, number]>;

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

Calculate centroids for each cluster.

Computes the centroid (center point) of each cluster using the specified method.

Parameters

x

ClusteredNeuroVol

Clustered volume

method?

string = 'center_of_mass'

Method for computing centroids ("center_of_mass" or "median")

Returns

Map<number, [number, number, number]>

Map of cluster labels to centroid coordinates

Released under the MIT License.