rigid_transform_image

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

rigid_transform_image(image: sitk.Image, shift_voxels: Sequence[float], angle_degrees: float, axis: str = 'z', interpolator: str = 'bspline', default_value: float = 0.0) → sitk.Image[source]

Translate then rotate in ONE resample (MIRP ≥ 2 affine composition).

Prior et al. 2024 used MIRP 1.2.0, which applied translation and rotation as two successive interpolations. Composing them avoids a second B-spline pass. Content mapping is translate-then-rotate about the image centre, matching HABIT’s default chain order.

Parameters:
  • image – Source image.

  • shift_voxels – Translation in VOXEL units, SimpleITK (x, y, z).

  • angle_degrees – Rotation angle in degrees (paper default 0.5).

  • axis – Axis to rotate around: "x", "y" or "z".

  • interpolator – "bspline" (paper default), "linear" or "nearest" (required for label masks).

  • default_value – Intensity for voxels mapped outside the source.

Returns:

The rigidly perturbed image on image’s grid.

Raises:

ValueError – If shift_voxels is not length 3 or axis is unknown.