[Insight-users] WrapITK and python : FFT computation

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Tue Apr 4 04:58:30 EDT 2006


Hi,

I think you have set WRAP_rgb_unsigned_int to ON. Right ?
The problem comes from a bug in ITK, firstly reported by Kent, but sadely  
not fixed yet in CVS.
Zach, can you push the patch sent by Kent some days ago in the ITK cvs  
repository ?

Just turn  WRAP_rgb_unsigned_int to OFF and rebuild, and it should fix the  
problem.

Thanks,

Gaetan

On Tue, 04 Apr 2006 06:37:27 +0200, Zachary Pincus <zpincus at stanford.edu>  
wrote:

> 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



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-users mailing list