|This section is currently out-of-date and may contain errors but is retained for historical reference. For peer-reviewed, authoritative guidance on ITK, see The ITK Software Guide. Additional guidance can be found via the ITK Discourse.|
This section describes how to wrap ITK classes for being used from Python.
Step 1: Make sure the python headers are installed
Python will need to be installed along with the Python development headers (Python.h).
If you need to specify a specific Python version or a custom location of the headers, the following CMake configuration variables can be modified:
Step 2: Turn on Python wrapping in the ITK configuration
Turn ON the CMake configuration ITK_WRAP_PYTHON.
Step 3: Select the pixel types and dimensions to build
You can choose what pixel types and dimensions to build into the wrapped interface. There is a trade-off between the number of pixel types and images dimensions supported and the amount of compilation time required and the size of the wrapping libraries.
For the dimensions to support, set the CMake configuration variable ITK_WRAP_DIMS. This is a semi-colon delimited string containing the dimensions to support (Image dimensions, etc). The default is 2;3.
The pixel types to support are boolean variables in the pattern ITK_WRAP_<pixel type>. For instance,