SliceExtentPerturbation
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 SliceExtentPerturbation(grow_slices: int = 0, shrink_slices: int = 0, max_slices: int = 0, roi: str | None = None)[source]
Bases:
objectAdd or remove whole axial slices at the superior/inferior ROI ends.
Models z-axis delineation variability: observers often agree in-plane but differ on the first and last slice they call tumour. Only the
z(first) axis is touched. Only masks change.Provide fixed
grow_slices/shrink_slices(applied to each end), or setmax_slices > 0to draw a random per-end count in[-max_slices, +max_slices](positive grows, negative shrinks). Whenmax_slicesis set the fixed counts are ignored.- Parameters:
grow_slices – Slices to append at each occupied end (copy of the nearest occupied slice’s labels).
shrink_slices – Occupied slices to remove at each end.
max_slices – Bound for random per-end counts;
0uses the fixed counts.roi – Restrict the perturbation to one mask key;
Noneperturbs all masks.