[Insight-users] Compile itk with python bindings

Simon Su newsgroup4ssu at gmail.com
Sun Feb 21 18:24:59 EST 2010


Hello,

I manage to compile itk but the default compilation didn't have python
bindings included.  What would be the preferred way to get python bindings
compiled into itk? cswig? or wrapitk?

I tried to compile CableSwig by doing a co of the source and place it in the
InsightToolkit-3.14.0-src/Utilities directory but it failed to build. So I
built CableSwig on the side and pointed CableSwig_DIR variable to where I
installed it. Then after much trial and error, turning on different cmake
flags and recompile itk, I got it to compile. I also believe I have the both
WRAP_ITK_PYTHON and ITK_CSWIG_PYTHON flags set to on.

At the end, I have these

itk-3.14.0/vis.Linux-2.6.18-128.1.1.el5.x86_64.gcc-4.1.2.release/lib/InsightToolkit/python
directory which contains the following files

InsightToolkit.py  itkbase.py   itkbasicfilters.py  itkdata.py
itknumerics.py  vxlnumerics.py
itkalgorithms.py   itkbase.pyc  itkcommon.py        itkio.py
itktesting.py

I have PYTHONPATH set to that directory also.

When I do import itk in python shell, I can't find module named itk.

Am I missing anything or shall I do import itkbase instead of itk?

Thanks,
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100221/4d971d93/attachment.htm>


More information about the Insight-users mailing list