check_physical_space_for_ants_image_pair#

petpal.utils.dimension.check_physical_space_for_ants_image_pair(image_1: ants.core.ANTsImage, image_2: ants.core.ANTsImage, tolerance: float = 0.01) bool#

Determines whether two ANTs images share the same physical space. This function works when comparing 4D-images with 3D-images, as opposed to ants.image_physical_space_consistency().

This function validates whether the direction matrices, spacing values, and origins of the two provided ANTs images are consistent, ensuring they reside in the same physical space.

Parameters:
  • image_1 (ants.core.ANTsImage) – The first ANTs image for comparison.

  • image_2 (ants.core.ANTsImage) – The second ANTs image for comparison.

  • tolerance (float) – Absolute tolerance for differences between components of the affine transform matrix for the two images. Default 0.01.

Returns:

boolTrue if both images share the same physical space, False otherwise.