prealignment#

prealignment(fixed_img, moving_img, fixed_mask, moving_mask, dice_overlap=0.5, rotation_step=10)[source]#

Coarse registration of an image pair.

This function performs initial alignment of a moving image with respect to a fixed image. This can be used as a prealignment step before final refinement.

Parameters:
  • fixed_img (numpy.ndarray) – A fixed image.

  • moving_img (numpy.ndarray) – A moving image.

  • fixed_mask (numpy.ndarray) – A binary tissue mask for the fixed image.

  • moving_mask (numpy.ndarray) – A binary tissue mask for the moving image.

  • dice_overlap (float) – Dice ratio used for the selection of the best transformation matrix.

  • rotation_step (int) – Rotation_step defines an increment in the rotation angles.

Returns:

  • class:numpy.ndarray: A rigid transform matrix.

  • class:numpy.ndarray: Transformed moving image.

  • class:numpy.ndarray: Transformed moving mask.

  • float: Dice overlap

Return type:

tuple