apply_xfm_ants#
- petpal.preproc.register.apply_xfm_ants(input_image_path: str, ref_image_path: str, out_image_path: str, xfm_paths: list[str], copy_meta: bool = False, **kwargs) ants.ANTsImage#
Applies existing transforms in ANTs or ITK format to an input image, onto a reference image. This is useful for applying the same transform on different images to atlas space, for example.
- Parameters:
input_image_path (str) – Path to image on which transform is applied.
ref_image_path (str) – Path to image to which transform is applied.
out_image_path (str) – Path to which the transformed image is saved.
xfm_paths (list[str]) – List of transforms to apply to image. Must be in ANTs or ITK format, and can be affine matrix or warp coefficients.
copy_meta (bool) – If True, copies metadata file read from input_image_path as the metadata for new image out_image_path.
- Returns:
xfm_img (ants.ANTsImage) – The input image transformed with an ANTs transform file.