I have a similarity metric that I’d like to use in ImageRegistrationMethod in itk python, is there any way to do so?
Yes. If it is an existing method in ITK, it can be used from Python with the ImageRegistrationMethod.
If it is a new method you created your self, you can quickly wrap it in Python, and create an installable Python Package. More information:
- The ITK Module Template. This will get you going with a skeleton module in two commands.
- The ITK Software Guide’s chapter on How to Create A Module. This includes instruction on how to add wrapping.
Please let us know if you have any questions.
actually my custom made metric is implemented in python. Do I still need to create an installable python package?
I was wondering if there is any update on this issue?
Is there any python callable (function) for the optimizer interface right now?
I don’t think it is that hard to implement. What do you think about an
itk.PythonImageRegistrationMetricv4 class? This class would be similar to itk.ImageToImageMetricv4, but it would have additional methods,
These methods would be passed Python functions that accept the
ImageToImageMetricv4 as an argument and would need to return required value and derivative values.
Any progress on this front?
I created this issue for tracking:
Note that we have similar functionality to define an image filter in Python: