scallops.registration.itk.itk_align
- scallops.registration.itk.itk_align(fixed_image, moving_image, parameter_object, fixed_image_spacing=None, moving_image_spacing=None, output_directory=None, fixed_mask=None, moving_mask=None, initial_transform=None, landmarks=None, additional_fixed_image=None, additional_moving_image=None)
Align a moving image to a fixed image using ITK registration.
This function uses the ITK library to perform image registration, aligning a moving image to a fixed image.
- Parameters:
fixed_image (DataArray | ndarray) – The fixed image represented as an xarray DataArray.
moving_image (DataArray | ndarray) – The moving image represented as an xarray DataArray.
parameter_object (elastixParameterObject) – The ITK parameter object containing registration parameters.
fixed_image_spacing (None | tuple[float, float]) – Optional spacing information for the fixed image. If not provided, it is determined from the image metadata.
moving_image_spacing (None | tuple[float, float]) – Optional spacing information for the moving image. If not provided, it is determined from the image metadata.
output_directory (None | str) – Optional directory to save intermediate outputs. If None, no outputs are saved.
fixed_mask (DataArray | ndarray[uint8] | Array | None) – Optional fixed mask of 0’s and 1’s of type np.uint8
moving_mask (DataArray | ndarray[uint8] | Array | None) – Optional moving mask of 0’s and 1’s of type np.uint8
additional_fixed_image (DataArray | ndarray | None) – Optional labels for registration
additional_moving_image (DataArray | ndarray | None) – Optional labels for registration
initial_transform (str | None) – Optional path to initial transformation
landmarks (dict[str, ndarray[float]] | None) – Optional landmarks dictionary with keys ‘fixed_x’, ‘fixed_y’, ‘moving_x’, and ‘moving_y’ used to compute intial affine tranformation.
- Returns:
An ITK ElastixRegistrationMethod object representing the registration.
- Return type:
<itkTemplate itk::ElastixRegistrationMethod>