extract_graph_features_for_labels

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.

extract_graph_features_for_labels(label_array: ndarray, labels: Sequence[int], *, options: HabitatGraphFeatureOptions | None = None, **kwargs: Any) → Dict[str, float][source]

Extract graph features after restricting the habitat map to selected labels.

Keyword arguments that match HabitatGraphFeatureOptions fields may be passed directly; see extract_graph_features() for the options / kwargs merge rules.

Parameters:
  • label_array – Already segmented habitat map.

  • labels – Habitat labels to keep. Other labels are set to background.

  • options – Graph construction and metric options. When None, a default instance is built (optionally from kwargs).

  • **kwargs – Optional field overrides for HabitatGraphFeatureOptions.

Returns:

Flat feature dictionary for the selected labels.

Return type:

Dict[str, float]