HabitatMap

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 HabitatMap(subject_id: str, label_array: ndarray, geometry: Geometry, model_id: str, habitat_ids: Tuple[int, ...], provenance: Provenance)[source]

Bases: object

Habitat label image for one subject.

subject_id

Owning subject.

Type:

str

label_array

Habitat id per voxel; 0 denotes background.

Type:

numpy.ndarray

geometry

Grid label_array refers to.

Type:

habit.contracts.geometry.Geometry

model_id

Identifier of the HabitatModel that assigned these labels. Without it, habitat ids from different runs are not comparable, which is the most common silent error in habitat studies.

Type:

str

habitat_ids

Habitat ids the model can assign, in canonical order. Note that a given subject need not contain all of them.

Type:

Tuple[int, …]

provenance

How this map was produced.

Type:

habit.contracts.provenance.Provenance

See also

habit.viz.plot_habitat_overlay

Publication overlay of this map on anatomy.

habit.contracts.HabitatModel

Definition that assigned these labels.

__post_init__() → None[source]

Coerce the label array and canonicalise the habitat id tuple.

__init__(subject_id: str, label_array: ndarray, geometry: Geometry, model_id: str, habitat_ids: Tuple[int, ...], provenance: Provenance) → None

Examples using habit.contracts.HabitatMap

Quickstart: Python API

Quickstart: Python API

Quickstart: YAML

Quickstart: YAML