mdreg.elastix.coreg_series#

mdreg.elastix.coreg_series(moving: ndarray, fixed: ndarray, spacing=1.0, downsample=1, log=False, progress_bar=False, method='bspline', **params)[source]#

Coregister two series of 2D images or 3D volumes.

Parameters:
  • moving (numpy.ndarray) – The moving image or volume, with dimensions (x,y,t) or (x,y,z,t).

  • fixed (numpy.ndarray) – The fixed target image or volume, in the same dimensions as the moving image.

  • spacing (array-like) – Pixel spacing in mm. This can be a single scalar if all dimensions are equal, or an array of 2 elements (for 2D data) or 3 elements ( for 3D data). Defaults to 1.

  • downsample (float) – Speed up the registration by downsampling the images with this factor. downsample=1 means no downsampling. This is the default.

  • log (bool) – Print a log during computations. Defaults to False.

  • progress_bar (bool) – Display a progress bar during coregistration. Defaults to False.

  • method (str) – Deformation method to use. Options are ‘bspline’, ‘affine’, ‘rigid’ or ‘translation’. Default is ‘bspline’.

  • params (dict) – Use keyword arguments to overrule any of the default parameters in the elastix template for the chosen method.

Returns:

  • coregistered (numpy.ndarray) – Coregistered series with the same dimensions as the moving image.

  • deformation (numpy.ndarray) – The deformation field with the same dimensions as moving, and one additional dimension for the components of the vector field. If moving has dimensions (x,y,t) and (x,y,z,t), then the deformation field will have dimensions (x,y,2,t) and (x,y,z,3,t), respectively.