clearex.registration.linear

Functions

inspect_affine_transform(affine_transform)

Evaluate the affine transform and report it's decomposed parts.

register_image(moving_image, fixed_image[, ...])

Linear Image Registration.

transform_image(moving_image, fixed_image, ...)

Use a pre-existing affine transform to transform on a naive image to the coordinate space of the fixed_image.

clearex.registration.linear.register_image(moving_image, fixed_image, fixed_mask=None, moving_mask=None, registration_type='TRSAA', accuracy='high', verbose=False)

Linear Image Registration.

Perform an image registration between the moving image and the fixed image. Registration is by default performed via Translation -> Rigid -> Similarity -> Affine -> Affine.

Parameters:
  • moving_image (ants.core.ants_image.ANTsImage) – The moving image.

  • fixed_image (ants.core.ants_image.ANTsImage) – The image which the moving_image will be registered to. It remains fixed.

  • registration_type (str) – The type of registration method to use. Options include Translation, Rigid, Similarity, Affine, TRSAA, and more.

  • accuracy (str) – Used for the TRSAA registration type. Registration performed in a 4-level multiscale format. By default, it applies shrink factors of 8x4x2x1 and smoothing sigmas 3x2x1x0 (voxel units) over the four levels.

  • verbose (bool) – The verbosity of the registration routine, showing iteration index, duration, registration error, etc.

  • fixed_mask (_install_ants_stub.<locals>.ANTsImage | None) –

  • moving_mask (_install_ants_stub.<locals>.ANTsImage | None) –

Returns:

  • transformed_image (ants.core.ants_image.ANTsImage) – The registered image, moved to the coordinate space of the fixed image.

  • transform (ants.core.ants_transform.ANTsTransform) – The affine transform used in the transformation of the transformed_image.

Raises:

ValueError – If the fixed and moving images do not have the same number of dimensions, or if an unsupported registration type is specified.

Return type:

tuple[_install_ants_stub.<locals>.ANTsImage, _install_ants_stub.<locals>.ANTsTransform]

References

https://antspy.readthedocs.io/en/latest/registration.html

clearex.registration.linear.inspect_affine_transform(affine_transform)

Evaluate the affine transform and report it’s decomposed parts.

Parameters:

affine_transform (ants.core.ants_transform.ANTsTransform or str) – The affine transform to evaluate, or a path to a transform file.

Return type:

None

clearex.registration.linear.transform_image(moving_image, fixed_image, affine_transform)

Use a pre-existing affine transform to transform on a naive image to the coordinate space of the fixed_image. Performs histogram matching to the original.

Parameters:
  • moving_image (ants.core.ants_image.ANTsImage) – The image that will be transformed.

  • fixed_image (ants.core.ants_image.ANTsImage) – The stationary image.

  • affine_transform (ants.core.ants_transform.ANTsTransform) – The affine transform to apply to the moving_image.

Returns:

registered_image – The registered image.

Return type:

ants.core.ants_image.ANTsImage