autods_pet.imaging.registration#

Rigid PET-to-CT registration using SimpleElastix.

Registers a PET image onto the CT grid (same spacing, origin, direction, and size as CT) using mutual information with a rigid transform.

autods_pet.imaging.registration.rigid_register_pet_to_ct(ct, pet, log_to_console=False, report_path=None)[source]#

Rigidly register pet onto the ct grid.

Parameters:
  • ct (Image) – CT image (fixed / reference frame).

  • pet (Image) – PET image (moving).

  • log_to_console (bool (default: False)) – If True, print Elastix iteration logs to stdout.

  • report_path (Path | None (default: None)) – If set, Elastix writes TransformParameters.0.txt to report_path.parent and it is renamed to report_path.

Returns:

PET resampled onto the CT grid (float64).

Return type:

Image

autods_pet.imaging.registration.apply_transform(moving, transform_path, nearest_neighbor=False)[source]#

Apply a saved Elastix transform to an image using transformix.

Parameters:
  • moving (Image) – Image to transform.

  • transform_path (Path) – Path to the Elastix TransformParameters text file.

  • nearest_neighbor (bool (default: False)) – If True, use nearest-neighbor interpolation (for binary masks).

Returns:

Transformed image.

Return type:

Image