Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class to enable a custom image similarity metric defined in Python #1411

thewtex opened this issue Nov 12, 2019 · 0 comments


Copy link

@thewtex thewtex commented Nov 12, 2019


Enable creation of a custom similarity metric in Python. See the discussion here:

Expected behavior

A convenient way to define an image similarity metric in Python that re-uses the ITK image registration frame, i.e. optimizers, transformations, multi-resolution capabilities, regularization.

Actual behavior

The registration metric must be implemented in C++.

Additional Information

Possible implementation:

An itk.PythonImageRegistrationMetricv4 class would be similar to itk.ImageToImageMetricv4, but it would have additional methods,

  • GetValuePythonCallback
  • GetDerivativePythonCallback
  • GetValueAndDerivativePythonCallback

These methods would be passed Python functions that accept the ImageToImageMetricv4 as an argument and would need to return required value and derivative values.

See also the class for defining a custom ITK filter in Python:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.