RigidPerturbation
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 RigidPerturbation(shift_voxels: Sequence[float] | None = None, shift_fraction: float = 0.5, random_signs: bool = True, angle_degrees: float = 0.5, axis: str = 'z', interpolator: str = 'bspline', random_sign: bool = False, warp_masks: bool = True)[source]
Bases:
objectSub-voxel translation and small-angle rotation in ONE resample.
MIRP ≥ 2 composes the geometric pair into a single affine so the image is not B-spline interpolated twice. Prior et al. 2024 used MIRP 1.2.0 (two resamples); use
prior2024_retest_perturbation()withsingle_resample=False(default) to match that paper, orsingle_resample=Truefor this component.- Parameters:
shift_voxels – Fixed voxel shift;
Noneusesshift_fraction.shift_fraction – MIRP
perturbation_translation_fractionin[0, 1](paper-style default 0.5).random_signs – Randomize the sign of each translation axis.
angle_degrees – In-plane rotation in degrees (paper: 0.5).
axis – Rotation axis (paper:
"z").interpolator – Intensity interpolator (paper:
"bspline").random_sign – Randomize the rotation sense.
warp_masks – When True, apply the same rigid move to every ROI. Prior 2024 extraction keeps the original mask (False).