[Insight-users] sorry, im again with wrappers

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Jul 27 03:55:32 EDT 2005


On Tue, 26 Jul 2005 19:11:14 +0200, Brad King <brad.king at kitware.com>  
wrote:

> Gaetan Lehmann wrote:
>>
>> Hi Brad,
>>
>> Since your fix in cableswig, I get a wrapping gap warning for
>> LabelStatisticsImageFilter (a some other classes) :
>>
>> Generating wrap_itkLabelStatisticsImageFilterPython.cxx
>> Warning
>> itk::Statistics::Histogram<double,1,itk::Statistics::DenseFrequencyContainer<float>
>>
>>
>>>
>> has a class hierarchy that has wrapping gaps.
>> The class hierarchy wrapping is as follows:
>> Not wrapped: itk::Statistics::Sample<(itk::FixedArray<(double,1)>)>
>>     Wrapped: itk::Object
>>     Wrapped: itk::LightObject
>>
>> I have wrapped itk::Statistics::Sample (see attached patch), and now I
>> get  another warning when building LabelStatisticsImageFilter :
>>
>> Generating wrap_itkLabelStatisticsImageFilterPython.cxx
>> :1: Warning(401): Nothing known about class
>> 'itk::Statistics::Sample<itk::FixedArray<double,1 > >'. Ignored.
>> :1: Warning(401): Maybe you forgot to instantiate
>> 'itk::Statistics::Sample<itk::FixedArray<double,1 > >' using %template.
>>
>> Sample builds without warning, but finally, I can't load InsightToolkit
>> module in python :
>>
>> 1> import InsightToolkit
>> ---------------------------------------------------------------------------
>> exceptions.ImportError                               Traceback (most
>> recent call last)
>>
>> /usr/lib/InsightToolkit/<console>
>>
>> /usr/lib/InsightToolkit/python/InsightToolkit.py
>> ----> 1 from itkalgorithms import *
>>       2 from itkio import *
>>
>> /usr/lib/InsightToolkit/python/itkalgorithms.py
>> ----> 1 from itkbasicfilters import *
>>       2 from itknumerics import *
>>       3 __itk_import_data__ = itkbase.preimport()
>>       4 from ITKAlgorithmsPython import *
>>       5 itkbase.postimport(__itk_import_data__)
>>
>> /usr/lib/InsightToolkit/python/itkbasicfilters.py
>>       2 __itk_import_data__ = itkbase.preimport()
>>       3 from ITKBasicFiltersAPython import *
>> ----> 4 from ITKBasicFiltersBPython import *
>>       5 from ITKBasicFiltersCPython import *
>>       6 itkbase.postimport(__itk_import_data__)
>>
>> /usr/lib/InsightToolkit/ITKBasicFiltersBPython.py
>>      78 from itkExpandImageFilter import *
>>      79 from itkIntensityWindowingImageFilter import *
>> ---> 80 from itkLabelStatisticsImageFilter import *
>>      81 from itkLaplacianRecursiveGaussianImageFilter import *
>>      82 from itkLaplacianSharpeningImageFilter import *
>>
>> /usr/lib/InsightToolkit/itkLabelStatisticsImageFilter.py
>>      56 import vnl_vector
>>      57 import vnl_vector_ref
>> ---> 58 import itkSample
>>      59 import itkImage_2D
>>      60 import ITKRegions
>>
>> /usr/lib/InsightToolkit/itkSample.py
>>       3 # This file is compatible with both classic and new-style  
>> classes.
>>       4
>> ----> 5 import _itkSample
>>       6
>>       7 def _swig_setattr(self,class_type,name,value):
>>
>> ImportError: No module named _itkSample
>>
>>
>>
>> Do you know why Sample is not wrapped and how it can be fixed ?
>
> By putting the fixedarray namespace inside the wrappers namespace you
> were telling CableSwig to try to wrap it.  Try the attached version.
> Don't forget to add it to wrap_ITKNumerics.cxx and CMakeLists.txt.
>

Thanks to point the fixedarray namespace location problem :-)
Sadely, it doesn't resolve the problem: _itkSample is no created. I still  
get the same messages.
Have you sucessfully wrapped the Sample class ?

-- 
Gaetan Lehmann <gaetan.lehmann at jouy.inra.fr>
Tel: +33 1 34 65 29 66
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
Web: http://voxel.jouy.inra.fr


More information about the Insight-users mailing list