mr2.algorithms.image_registration.register_images

mr2.algorithms.image_registration.register_images(fixed: Tensor, moving: Tensor, *, spline_downsampling_factors: Sequence[int] = (8, 4, 2), spline_window_sizes: Sequence[int] = (21, 15, 11), spline_control_point_spacings: Sequence[SpatialDimension[float]] = (SpatialDimension(24.0, 24.0, 24.0), SpatialDimension(16.0, 16.0, 16.0), SpatialDimension(12.0, 12.0, 12.0)), spline_regularization_weights: Sequence[float] = (0.2, 0.1, 0.05), weight: Tensor | None = None, affine_downsampling_factor: int = 4, affine_window_size: int = 11, affine_max_iterations: int = 20, affine_regularization_weight: float = 1e-4, spline_max_iterations: int = 40) → GridSamplingOp[source]

Run affine registration followed by a spline pyramid.

Parameters:
  • fixed (Tensor) – Fixed image.

  • moving (Tensor) – Moving image.

  • spline_downsampling_factors (Sequence[int], default: (8, 4, 2)) – Downsampling factors for the spline pyramid.

  • spline_window_sizes (Sequence[int], default: (21, 15, 11)) – Window sizes for the NCC similarity measure in the spline pyramid.

  • spline_control_point_spacings (Sequence[SpatialDimension[float]], default: (SpatialDimension(24.0, 24.0, 24.0), SpatialDimension(16.0, 16.0, 16.0), SpatialDimension(12.0, 12.0, 12.0))) – Spacings of the control points in the spline pyramid.

  • spline_regularization_weights (Sequence[float], default: (0.2, 0.1, 0.05)) – Regularization weights for the L2 regularization of the control points in the spline pyramid.

  • weight (Tensor | None, default: None) – Weight/mask tensor. If None, no weighting is applied.

  • affine_downsampling_factor (int, default: 4) – Downsampling factor for the affine registration.

  • affine_window_size (int, default: 11) – Window size for the NCC similarity measure in the affine registration.

  • affine_max_iterations (int, default: 20) – Maximum number of iterations of the LBFGS optimizer for the affine registration.

  • affine_regularization_weight (float, default: 1e-4) – Regularization weight for the L2 regularization of the affine matrix.

  • spline_max_iterations (int, default: 40) – Maximum number of iterations of the LBFGS optimizer for the spline pyramid.