ITK/Python Wrapping: Difference between revisions

From KitwarePublic
< ITK
Jump to navigationJump to search
(Started the page)
 
Line 22: Line 22:
# ITK_CSWIG_PYTHON ON
# ITK_CSWIG_PYTHON ON
# Set the python paths (Advanced Values), don't worry about PYTHON_DEBUG_LIBRARY
# Set the python paths (Advanced Values), don't worry about PYTHON_DEBUG_LIBRARY
# TK_INTERNAL_PATH is the path to tkWinInt.h - this file is found in the source distro of Tcl/Tk.
# ITK_EXPLICIT_INSTANTATION must be off.
# 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.
Open ALL_BUILD in MSVC, select the configuration you want (Release, RelWithDebugInfo etc) and build for a long time.


=== Linux ===
=== Linux ===


{{ITK/Template/Footer}}
{{ITK/Template/Footer}}

Revision as of 17:33, 30 May 2007

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. TK_INTERNAL_PATH is the path to tkWinInt.h - this file is found in the source distro of Tcl/Tk.
  5. 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]