Geometrical Interpolation

Overview

This module provides image transformation helpers used internally by DeformableMirror and the mis-registration algorithms to warp influence functions and OPD maps.

Selected API reference

OOPAO.tools.interpolateGeometricalTransformation.interpolate_image(image, transformation_matrix, output_shape=None)[source]

Apply a scikit-image geometric transformation matrix to a 2-D image.

Parameters:
  • image (numpy.ndarray) – Input 2-D image.

  • transformation_matrix (skimage.transform.GeometricTransform) – scikit-image AffineTransform or ProjectiveTransform object.

  • output_shape (tuple or None) – Output array shape. Default None (same as input).

Returns:

Transformed image.

Return type:

numpy.ndarray

OOPAO.tools.interpolateGeometricalTransformation.interpolate_cube(cube, transformation_matrix, output_shape=None, n_jobs=1)[source]

Apply a transformation to each slice of a 3-D cube (parallelised with joblib).

Parameters:
  • cube (numpy.ndarray) – Input array of shape (n_pix, n_pix, n_slices).

  • transformation_matrix (skimage.transform.GeometricTransform) – Transformation to apply.

  • output_shape (tuple or None) – Output shape per slice. Default None.

  • n_jobs (int) – Number of parallel jobs. Default 1.

OOPAO.tools.interpolateGeometricalTransformation.globalTransformation(image, misRegistration, pixelSize)

Apply a full MisRegistration (rotation + shift + scaling + anamorphosis) to an image.

Parameters:
  • image (numpy.ndarray) – Input 2-D image.

  • misRegistration (MisRegistration) – Transformation parameters.

  • pixelSize (float) – Physical pixel size in metres (used to convert shift from metres to pixels).