habitat_ith_dispersion

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

habitat_ith_dispersion(label_array: ndarray) → Dict[int, float][source]

Per-habitat ITH (dispersion) on the same formula as ith_score().

For habitat i with voxel count S_i, largest component S_i,max, and n_i connected regions:

d_i = 1 - (S_i,max / n_i) / S_i

The global ITH score is the volume-weighted mean of these values. A single connected blob scores 0; many small fragments approach 1.

Parameters:

label_array – Integer habitat labels, 0 denoting background.

Returns:

Mapping of habitat id to dispersion in [0, 1). Habitats absent from the array do not appear. An empty map returns {}.

Examples using habit.kernels.habitat_ith_dispersion

Quickstart: Python API

Quickstart: Python API