habit.habitat_model: fit and assign habitats

Built-in habitat model fitters and their registry.

User guide: Habitat domain API · Habitat Guide Fitting a cohort habitat model. Component names: Habitat Spec component catalog.

Classes

HabitatModelFitter

Fit the population-level habitat definition.

KMeansHabitatModelFitter

Learn population habitats by k-means over pooled supervoxel features.

GmmHabitatModelFitter

Learn population habitats by a Gaussian mixture over pooled features.

HabitatModelFitterRegistry

Name-to-implementation registry for cohort-level habitat model fitters.

HabitatAssigner

Assign habitat labels to one subject using a fitted model.

NearestCentroidAssigner

Assign each supervoxel to the habitat of its nearest centroid.

HabitatAssignerRegistry

Name-to-implementation registry for per-subject habitat assigners.

ConnectedComponentPostprocess

Clean tiny connected components inside an ROI label map.

Functions

build_connected_component_postprocess

Build a postprocess operator from a Spec, or None when unset.