[itk-python] Wrap ITK MatchCardinalityImageToImageMetric

Hi everyone,

I have been using ITK in the past and I recently started a python project. In this project I would like to use the MatchCardinalityImageToImageMetric metric. However, the metric has not been ported yet to python so I am trying to find out how this can be done.
I am new to ITK development so I am not sure I understand how to proceed and I would appreciate a bit of guidance.

Form what I gathered form other function, I wrote a .wrap file and uploaded is to GitHub (https://github.com/bdepalle/ITKMatchCardinalityImageToImageMetric/blob/master/itkMatchCardinalityImageToImageMetric.wrap).

I have looked into cookiecutter but I am not sure how to proceed from there and how to make it work with the itk package I installed with pip.

What am I missing here? Am I on the right track to get the metric I need in python? If so, what should I do next? If not, what should I do instead?

Thanks for you help,


Hello Baptiste,

Yes, in general, if you create a new class, Python packages can easily be generated and uploaded to PyPI by starting from the ITKModuleTemplate cookie-cutter.

This repository may be private (I cannot access the file), but since this class is already in ITK, you can contribute the wrapping configuration to its module wrapping directory. For more information on how to contribute a file, see our CONTRIBUTING.md.

After it is merged, the ITKPythonPackage ITK version is updated nightly, so you can build pre-release binaries until the next release.

Thanks for contributing to ITK!


1 Like