Using CMake for Configuring and Building ITK vs Using the Python Wrapper for journal paper ITK code.

Hi ITK discussion forum!

I’m new to ITK and am going through the ITK software guide in order to be able to try this code: https://github.com/midas-journal/midas-journal-154/tree/master/DiffeomorphicDemons-2009-06-Vercauteren-IJSource

Would experienced ITK users here be able to point me in the right direction? Will I be able to use the above DiffeomorphicDemons-2009-06-Vercauteren-IJSource code in both of the following ways?
a) the path of installing and using ITK via the CMake route (chapter 2 of the ITK Software Guide Book 1)
b) the path of installing and using ITK in Python (Section 3.7.1 of the ITK Software Guide Book 1)

I am asking because while I would prefer to work in a Python environment rather than learning how to use ITK via path (a) I can’t see how I’d go about using Python to access the DiffeomorphicDemons-2009-06-Vercauteren-IJSource code. Before I spend a few weeks on path (a) and learning how to use ITK without Python, I’d really appreciate some guidance from experienced people here.

Any other guidance on how to get up to speed in order to use the DiffeomorphicDemons-2009-06-Vercauteren-IJSource code will be much appreciated.

Many thanks!

To be able to use an ITK class from Python, it needs to be wrapped (e.g. itk::DiffeomorphicDemonsRegistrationFilter). I don’t know whether all the classes used in that example are wrapped for Python. Even if they are, translating 1000 lines of code to Python is far from trivial. I would suggest going the route a) to check whether this does what you want or expect. If it does, then you might consider translating the subset you need to Python.

1 Like

Hello @jzhangaps,

Possibly consider using SimpleITK which wraps various Demons filters, see this notebook for details.

1 Like