mdreg.elastix.coreg_series#

mdreg.elastix.coreg_series(moving: ndarray | Array, fixed: ndarray | Array, parallel=True, progress_bar=False, path=None, name='coreg', return_deformation=False, spacing=1.0, method='bspline', **params)[source]#

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

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

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

  • parallel (bool) – Set to True to parallelize the computations. Defaults to True.

  • progress_bar (bool) – Display a progress bar during coregistration. This is ignored if parallel is True. Defaults to False.

  • path (str, optional) – Path on disk where to save the results. If no path is provided, the results are not saved to disk. Defaults to None.

  • name (str, optional) – For data that are saved on disk, provide an optional filename. This argument is ignored if no path is provided.

  • return_deformation (bool) – If set to True, return the deformation field as a third return value.

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

  • 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. The default parameters can be found by printing mdreg.elastix.defaults().

Returns:

  • coreg (numpy.ndarray | zarr.Array) – Coregistered series with the same dimensions as the moving image.

  • transfo (list) – List of itk.elastixParameterObject with one transform per image in the series. The individuals transforms can be examined with print(transfo[k]).