estimate_bspline_transform¶

estimate_bspline_transform(fixed_image, moving_image, fixed_mask, moving_mask, **kwargs)[source]¶

Estimate B-spline transformation.

This function performs registration using the SimpleITK toolkit. We employed

a deformable registration using a multi-resolution B-spline approach. B-spline registration uses B-spline curves to compute the deformation field mapping pixels in a moving image to corresponding pixels in a fixed image.

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

  • moving_image (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.

  • **kwargs (dict) –

    Key-word arguments for B-spline parameters.
    grid_space (float):

    Grid_space (mm) to decide control points.

    scale_factors (list):

    Scaling factor of each B-spline per level in a multi-level setting.

    shrink_factor (list):

    Shrink factor per level to change the size and complexity of the image.

    smooth_sigmas (list):

    Standard deviation for gaussian smoothing per level.

    num_iterations (int):

    Maximal number of iterations.

    sampling_percent (float):

    Fraction of image used for metric evaluation.

    learning_rate (float):

    Step size along traversal direction in parameter space.

    convergence_min_value (float):

    Value for checking convergence together with energy profile of the similarity metric.

    convergence_window_size (int):

    Number of similarity metric values for estimating the energy profile.

Returns:

2D deformation transformation represented by a grid of control points.

Return type:

BSplineTransform

Examples

>>> from tiatoolbox.tools.registration.wsi_registration import (
...     estimate_bspline_transform, apply_bspline_transform
... )
>>> bspline_transform = estimate_bspline_transform(
...     fixed_gray_thumbnail, moving_gray_thumbnail, fixed_mask, moving_mask,
...     grid_space=50.0, sampling_percent=0.1,
... )
>>> bspline_registered_image = apply_bspline_transform(
...     fixed_thumbnail, moving_thumbnail, bspline_transform
... )