[Insight-users] WrapITK and python : FFT computation

Zachary Pincus zpincus at stanford.edu
Tue Apr 4 00:37:27 EDT 2006


Hello Vincent -

It looks like WrapITK isn't pulling in the  
itk::NumericTraits<itk::RGBPixel> object from libITKCommon.so. This  
is odd...

Before you updated WrapITK, things loaded fine, but now 'import itk'  
fails? Hmm, trouble. Maybe Gaetan has some concrete ideas.

For now, the easiest temporary solution is to disable the use of RGB  
pixels from WrapITK in the configure step and rebuild. This is of  
course relatively unsatisfactory, however.

As to how to solve the deeper problem -- why isn't the proper numeric  
traits for RGB pixels linked in -- there are a few things to try.

First, what version of ITK are you using?

Next, it should be the case that libITKCommon.so (or whatever the  
shared library suffix is on your system) should contain a symbol for  
NumericTraits<itk::RGBPixel>::Zero. We can check this. Find  
libITKCommon.so and run objdump (or whatever tool you use for listing  
library entries), and grep for NumericTraits -- do any of the  
resulting symbols deal with RGBPixels?

Next, we'll want to make sure that _ITKCommonAPython.so links to  
libITKCommon.so. If you could run ldd on _ITKCommonAPython.so to see  
what it is linking in, that might help.

If your copy of libITKCommon.so has a numeric traits entry for  
RGBPixel and _ITKCommonAPython.so links to that library, then we've  
got a more obscure linker problem reminiscent of some that we've been  
having on windows. One solution for that is to comment out the  
ConstantBoundaryCondition block in WrapITK/CommonA/ 
wrap_itkImageBoundaryConditions.cmake. Hopefully we'll come up with a  
better solution.

Zach



On Apr 3, 2006, at 7:40 AM, Vincent Page wrote:

> Hi, and thanks Gaetan and Zach for the work done,
>
>
> As you proposed, I downloaded and test.
> I used FFTImageFilter.py as the test and
> here is what I end up with :
> -----------------------------------------
> Traceback (most recent call last):
>  File "FFTImageFilter.py", line 5, in ?
>    import itk
>  File "/usr/local/lib/InsightToolkit/WrapITK/Python/itk.py", line  
> 19, in ?
>    itkBase.LoadModule(module, globals())
>  File "/usr/local/lib/InsightToolkit/WrapITK/Python/itkBase.py",  
> line 53, in LoadModule
>    LoadModule(dep, namespace)
>  File "/usr/local/lib/InsightToolkit/WrapITK/Python/itkBase.py",  
> line 53, in LoadModule
>    LoadModule(dep, namespace)
>  File "/usr/local/lib/InsightToolkit/WrapITK/Python/itkBase.py",  
> line 61, in LoadModule
>    if not swigModuleName in sys.modules: module = loader.load 
> (swigModuleName)
>  File "/usr/local/lib/InsightToolkit/WrapITK/Python/itkBase.py",  
> line 162, in load
>    return imp.load_module(name, fp, pathname, description)
>  File "/usr/local/lib/InsightToolkit/WrapITK/Python-SWIG/ 
> ITKCommonAPython.py", line 5, in ?
>    import _ITKCommonAPython
> ImportError: /usr/local/lib/InsightToolkit/WrapITK/Python-SWIG/ 
> _ITKCommonAPython.so: undefined symbol:  
> _ZN3itk13NumericTraitsINS_8RGBPixelItEEE4ZeroE
> -----------------------------------------
>
> The system is a mandrake 10.2 community, with a x86_64 architecture.
> I re compiled the whole WrapITK...
> Any idea to fix this ?
>
>
> Vincent.
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list