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

Open
thewtex opened this issue Nov 12, 2019 · 0 comments

Comments

@thewtex
Copy link
Member

@thewtex thewtex commented Nov 12, 2019

Description

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

https://discourse.itk.org/t/is-there-a-way-to-set-custom-metric-in-itk-registration-in-python/705/7

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:

https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/Python/PyUtils/itkPyImageFilter.h

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