MorphologicalPerturbation
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 MorphologicalPerturbation(grow_mm: float | None = None, max_grow_mm: float = 1.0, roi: str | None = None, connectivity: int = 1)[source]
Bases:
objectUniformly grow or shrink every ROI (MIRP
perturbation_roi_adapt_size).This is the systematic component of inter-rater contour variability: one observer consistently traces slightly larger or smaller than another. It complements the Prior 2024 simulated-retest chain (which perturbs the image, not the contour). Only masks change; image intensities are untouched. Applied per foreground label so multi-label ROIs grow each region instead of merging them.
- Parameters:
grow_mm – Fixed physical radius in millimetres; positive dilates, negative erodes, zero is a no-op.
Nonesamples a signed radius fromUniform(-max_grow_mm, +max_grow_mm)per call.max_grow_mm – Sampling bound when
grow_mmis unset.roi – Restrict the perturbation to one mask key;
Noneperturbs all masks.connectivity – Structuring-element connectivity in
{1, 2, 3};1(6-connected) is the MIRP-like default.
Examples using habit.precision.MorphologicalPerturbation
/auto_examples/03_precision/plot_01_precise_features