<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:14pt">Hi all,<br><br><br>I have a problem with CSWIG cable and ITKwrapping and I would be thankful if you could help. I sent similar post two weeks back when I wanted to test python and ITK on my 64bit machine. Since I realized that python2.5 and CSWIG and ITK on 64bit cannot get along with each other, I wanted to&nbsp; test it on my laptop (32bit). This time, it was compiled although it crashed once complaining about a bug in gcc but I resume compiling typing "make" again. After compilation was finished (it took hours !!), I add following lines to my .bashrc file:<br>&nbsp;&nbsp;&nbsp; PATH=/home/kayhan/bin/InsightToolkit-3.2.0/Wrapping/WrapITK/Python:$PATH<br>&nbsp;&nbsp;&nbsp; export PATH<br>&nbsp;&nbsp;&nbsp; export
 PYTHONPATH=/home/kayhan/bin/InsightToolkit-3.2.0/Wrapping/WrapITK/Python:$PYTHONPATH<br>&nbsp;&nbsp;&nbsp; export LD_LIBRARY_PATH=/home/kayhan/bin/InsightToolkit-3.2.0/bin:$LD_LIBRARY_PATH<br>&nbsp;&nbsp;&nbsp; Once I wanted to try it on python (ipython environment), these error messages turn out:<br>&nbsp;&nbsp;&nbsp; In [1]: import itk<br>&nbsp;&nbsp;&nbsp; In [2]: dim = 3<br>&nbsp;&nbsp;&nbsp; In [3]: PixelType = itk.UC<br>&nbsp;&nbsp;&nbsp; In [4]: Image = itk.image[P<br>&nbsp;&nbsp;&nbsp; PendingDeprecationWarning&nbsp; PixelType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; In [4]: Image = itk.image[PixelType, dim]<br>&nbsp;&nbsp;&nbsp; ---------------------------------------------------------------------------<br>&nbsp;&nbsp;&nbsp; &lt;type 'exceptions.TypeError'&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Traceback (most recent call last)<br><br>-
 Ignored:<br>&nbsp;&nbsp;&nbsp; /home/kayhan/&lt;ipython console&gt; in &lt;module&gt;()<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &lt;type 'exceptions.TypeError'&gt;: 'function' object is unsubscriptable<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; first I thought that there might be something wrong with ITKWrapping, therefore I add CSWIG path to PYTHONPATH variable and tried to check using itk through python using CSWIG, I got following:<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; kayhan@kayhan-laptop:~$ export PYTHONPATH=/home/kayhan/bin/InsightToolkit-3.2.0/Wrapping/CSwig/Python/:$PYTHONPATH<br>&nbsp;&nbsp;&nbsp; kayhan@kayhan-laptop:~$ python<br>&nbsp;&nbsp;&nbsp; Python 2.5.1 (r251:54863, May&nbsp; 2 2007, 16:56:35)<br>&nbsp;&nbsp;&nbsp; [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2<br>&nbsp;&nbsp;&nbsp; Type "help", "copyright", "credits" or "license" for more information.<br>&nbsp;&nbsp;&nbsp; &gt;&gt;&gt; from InsightToolkit import
 *<br>&nbsp;&nbsp;&nbsp; Traceback (most recent call last):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "&lt;stdin&gt;", line 1, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "/home/kayhan/bin/InsightToolkit-3.2.0/Wrapping/CSwig/Python/InsightToolkit.py", line 1, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from itkalgorithms import *<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "/home/kayhan/bin/InsightToolkit-3.2.0/Wrapping/CSwig/Python/itkalgorithms.py", line 1, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from itknumerics import *<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "/home/kayhan/bin/InsightToolkit-3.2.0/Wrapping/CSwig/Python/itknumerics.py", line 1, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from itkcommon import *<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "/home/kayhan/bin/InsightToolkit-3.2.0/Wrapping/CSwig/Python/itkcommon.py", line 1, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from
 vxlnumerics import *<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "/home/kayhan/bin/InsightToolkit-3.2.0/Wrapping/CSwig/Python 2.5.1 (r251:54863, May&nbsp; 2 2007, 16:56:35) Python 2.5.1 (r251:54863, May&nbsp; 2 2007, 16:56:35) Python/vxlnumerics.py", line 4, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from VXLNumericsPython import *<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "VXLNumericsPython.py", line 33, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from vcl_complex import *<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "vcl_complex.py", line 5, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; import _vcl_complex<br>&nbsp;&nbsp;&nbsp; ImportError: No module named _vcl_complex<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Do you think that there is something wrong with configuration or I should redo compilation or ...? By the way, here is my machine
 specification:<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Linux Ubuntu 7.04 (32bit)<br>&nbsp;&nbsp;&nbsp; gcc: version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)<br>&nbsp;&nbsp;&nbsp; ITK ver.: InsightToolkit-3.2.0<br>&nbsp;&nbsp;&nbsp; python ver.: Python 2.5.1 (r251:54863, May&nbsp; 2 2007, 16:56:35)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; I would be thankful if you reply me back.<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Regards,<br>&nbsp;&nbsp;&nbsp; Kayhan <br></div><br>

<hr size=1><a href="http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/">Never miss an email again!<br>Yahoo! Toolbar</a> alerts you the instant new Mail arrives.<a href="
http://us.rd.yahoo.com/evt=49937/*http://tools.search.yahoo.com/toolbar/features/mail/"> Check it out.</a></body></html>