ITK/Python Wrapping

From KitwarePublic
< ITK
Revision as of 17:14, 30 May 2007 by Sprevrha (talk | contribs) (Started the page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

  1. Python 2.4
  2. ITK CVS version posterior to July 10 2004 - I used 3.2.0
  3. 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:

  1. 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.
  1. Shared Libs ON
  2. ITK_CSWIG_PYTHON ON
  3. Set the python paths (Advanced Values), don't worry about PYTHON_DEBUG_LIBRARY
  4. 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



ITK: [Welcome | Site Map]