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:
numpy.ndarray
- A rigid transform matrix.numpy.ndarray
- Transformed moving image.numpy.ndarray
- Transformed moving mask.float
- Dice overlap.
- Return type:
Examples
>>> from tiatoolbox.tools.registration.wsi_registration import prealignment >>> transform, transformed_image, transformed_mask, dice_overlap = prealignment( ... fixed_thumbnail, moving_thumbnail, fixed_mask, moving_mask ... )