segmentation
The segmentation and classification label universes.
Which biomarker labels exist, which of them a given metric is meaningful for, and how each is displayed and coloured. Several distinct index spaces live here and must not be conflated — see the comments on the individual maps.
Module
Functions
extract_segmentation_area
def extract_segmentation_area( segmentation_areas: typing.Any, label: str, *, absent: float | None = 0.0,) ‑> float | None:Look up one segmentation-mask area from a per-scan areas mapping.
Arguments
segmentation_areas: Per-scan{label: area}mapping, or a non-mapping sentinel when the model returned no segmentation data for the scan.label: Segmentation-mask label to look up (e.g."hard_drusen").absent: Value returned when the mapping is present but lackslabel(or holdsNonefor it). PassNoneto mark a missing label as unknown rather than a measured zero.
Returns
The area as a float; absent (uncoerced) when the label is missing or
its value is None; None when segmentation_areas is not a mapping.