ITK/Python Wrapping
From KitwarePublic
Jump to navigationJump to search
Python Wrapping
This section describes how to wrap ITK classes for being used from Python.
Since slight differences exist depending on the platform where the wrapping is done, this section will describe those platforms independently.
Microsoft Windows
In order to wrap ITK for Python under Microsoft Windows you must start by gathering the following materials - at least this is the configuration with which I succeeded
- Python 2.4
- ITK CVS version posterior to July 10 2004 - I used 3.2.0
- CableSwig- I used 2.2
It is convenient to use CSwig from CVS and to check it out inside the source tree of ITK. However this is not necessary as the path to CableSwig can be set in the CMake configuration for ITK.
CMake configuration:
- Compiler: I tried MS Visual Studio Express which failed. However, I think this because VS Express does not include the MS Windows SDK. I believe that installing that (free download from MS) and adding it to the "VC directories" paths correctly in VS Express will make it work. I have MS VC 2003 .NET as well, and both CableSwig and ITK compiled without errors.
- Shared Libs ON
- ITK_CSWIG_PYTHON ON
- Set the python paths (Advanced Values), don't worry about PYTHON_DEBUG_LIBRARY
- ITK_EXPLICIT_INSTANTATION must be off.
Open ALL_BUILD in MSVC, select the configuration you want (Release, RelWithDebugInfo etc) and build for a long time.
Linux