read_habitat_map

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.

read_habitat_map(path: str | Path, *, subject_id: str, habitat_ids: Sequence[int], model_id: str = 'extract') → HabitatMap[source]

Load one habitat label map from disk into a HabitatMap.

Parameters:
  • path – NRRD / NIfTI / MetaImage path written by habit get-habitat.

  • subject_id – Owning subject id.

  • habitat_ids – Canonical habitat ids the extractors should emit columns for (usually 1..n_habitats).

  • model_id – Model identifier recorded on the map; extract from precomputed maps uses a placeholder because the original model file may be absent.

Returns:

In-memory habitat map with geometry taken from the file metadata.