MsiHabitatFeatures

Note

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

class MsiHabitatFeatures[source]

Bases: object

Multiregional spatial interaction features of one subject’s habitat map.

MSI counts face-connected neighbour pairs between habitat classes (the spatial interaction matrix) and derives first-order border volumes and normalised second-order texture statistics from it. The formulas are the L0 kernels spatial_interaction_matrix() and msi_features_from_matrix(), numerically identical to the established v0.1 implementation.

The matrix size comes from the model’s habitat ids (via the map’s habitat_ids), not from the labels present in this subject, so every subject of the same model yields the same feature columns.

property spec: Spec

Return the algorithm specification.

__call__(subject: Subject, habitat_map: HabitatMap) → FeatureTable[source]

Compute the MSI feature family for one subject.

Parameters:
  • subject – Owning subject (labels suffice; intensities unused).

  • habitat_map – Habitat labels for that subject.

Returns:

One-row table of MSI features keyed by subject id.

Raises:

HABITAPIError – If the map declares no habitat ids.

Examples using habit.habitat_features.MsiHabitatFeatures