darsia.DiffeomorphicImageRegistration#
- class DiffeomorphicImageRegistration(img_dst, **kwargs)[source]#
Bases:
objectClass to detect the deformation between different images.
After all, DiffeomorphicImageRegistration is a wrapper using TranslationAnalysis.
Constructor for DiffeomorphicImageRegistration.
- Parameters:
- img_dst
darsia.Image Reference image, held fixed in the analysis (the destination).
- **kwargs
Registration parameters:
N_patches list of two int -- patches in x and y rel_overlap float -- relative patch overlap per direction max_features int -- max features in the feature detection tol float -- tolerance mask ndarray -- ROI in which features are considered
- img_dst
Methods
add(diffeomorphic_image_registration)Update the store translation by adding the translation of an external diffeomorphic image registration.
apply(img[, reverse])Apply computed transformation onto arbitrary image.
call_with_output(img[, ...])Determine the deformation pattern and apply diffeomorphism to the image aiming at matching the reference/destination (dst) image.
deduct(diffeomorphic_image_registration)Effectviely copy from external DiffeomorphicImageRegistration.
Return displacement in metric units on all pixels.
evaluate(coords[, reverse, units])Evaluate diffeormorphism in arbitrary points.
plot([scaling, mask])Plots diffeomorphism.
update_dst(img_dst)Update of dst image.
- add(diffeomorphic_image_registration)[source]#
Update the store translation by adding the translation of an external diffeomorphic image registration.
- Parameters:
- diffeomorphic_image_registration
darsia.DiffeomorphicImageRegistration Diffeomorphic image registraton object holding a translation analysis.
- diffeomorphic_image_registration
- apply(img, reverse=False)[source]#
Apply computed transformation onto arbitrary image.
- Parameters:
- img
np.ndarrayordarsia.Image Image.
- reversebool
Flag whether the translation is understood as from the test image to the baseline image, or reversed. The default is the latter.
- img
- Returns:
np.ndarray,optionalTransformed image, if input is array; no output otherwise.
- call_with_output(img, plot_patch_translation=False, return_patch_translation=False, mask=None)[source]#
Determine the deformation pattern and apply diffeomorphism to the image aiming at matching the reference/destination (dst) image.
This in the end only a wrapper for the translation analysis.
- Parameters:
- img
darsia.Image Test image.
- plot_patch_translationbool
Flag controlling whether the displacement is also visualized as vector field.
- return_patch_translationbool
Flag controlling whether the displacement in the patch centers is returned in the sense of img to dst, complying to the plot; default is False.
- mask
darsia.Image,optional Active mask.
- img
- deduct(diffeomorphic_image_registration)[source]#
Effectviely copy from external DiffeomorphicImageRegistration.
- Parameters:
- diffeomorphic_image_registration
darsia.DiffeomorphicImageRegistration Diffeomorphic image registration object holding a translation analysis.
- diffeomorphic_image_registration
- evaluate(coords, reverse=False, units='metric')[source]#
Evaluate diffeormorphism in arbitrary points.
- Parameters:
- coords
np.ndarray,ordarsia.Patches Coordinate array with shape num_pts x 2, or alternatively num_rows_pts x num_cols_pts x 2, identifying points in a mesh/patched image, or equivalently patch.
- reversebool
Flag whether the translation is understood as from the test image to the baseline image, or reversed. The default is the former latter.
- units
str Input and output units; “metric” default; otherwise assumed to be “pixel”.
- coords
- Returns:
np.ndarrayDeformation vectors for all coordinates.
- plot(scaling=1.0, mask=None)[source]#
Plots diffeomorphism.
- Parameters:
- scaling
float Scaling for vectors.
- mask
darsia.Image,optional Active set.
- scaling
- update_dst(img_dst)[source]#
Update of dst image.
- Parameters:
- img_dst
np.ndarray Image array.
- img_dst