[Insight-users] Re: How to Wrapper the ImageToHistogramGenerator Class

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Jun 15 05:07:01 EDT 2005


Hi Brad,
Hi Marcelo,

There are several problem :

+ cable swig seems to have problem with itk::Statistics namespace

Here is the error I get :

Building object file wrap_itkImageToHistogramGeneratorPython.o...
/home/glehmann/itk/itk-mima2/build/Wrapping/CSwig/Numerics/wrap_itkImageToHistogramGeneratorPython.cxx:  
In function `PyObject*  
_wrap_itkImageToHistogramGeneratorUS2_Pointer_GetPointer(PyObject*,  
PyObject*)':
/home/glehmann/itk/itk-mima2/build/Wrapping/CSwig/Numerics/wrap_itkImageToHistogramGeneratorPython.cxx:927:  
error: `itk::Statistics' has not been declared
.....

with the wrapper :

#include "itkImage.h"

#ifdef CABLE_CONFIGURATION
#include "itkCSwigImages.h"
#include "itkCSwigMacros.h"
#include "itkScalarImageToHistogramGenerator.h"

namespace _cable_
{
   const char* const group = ITK_WRAP_GROUP(itkImageToHistogramGenerator);
   namespace wrappers
   {
	typedef  
itk::Statistics::ScalarImageToHistogramGenerator<image::US2>::ScalarImageToHistogramGenerator  
itkImageToHistogramGeneratorUS2;
	typedef  
itk::Statistics::ScalarImageToHistogramGenerator<image::US2>::Pointer::SmartPointer  
itkImageToHistogramGeneratorUS2_Pointer;
   }
}
#endif


Is there something to do to avoid this problem, Brad ?


+ ITK_WRAP_OBJECT1 can't be used for statistics, so you need to write your  
own macro (it's easy, look at itkCSwigMacros.h) or to write typedef by  
hand :-/

+ ImageToHistogramGenerator can't be used with image::F2






On Tue, 14 Jun 2005 20:49:31 +0200, Oliveira Marcelo  
<marceloitk at yahoo.com.br> wrote:

> Hi users and Gaetan,
>
> Gaetan will be a pleasure integrate my wrappers in
> your branch
> (http://voxel.jouy.inra.fr/darcs/itk-mima2). Tanx for
> your wrappers.
>
> Ive been trying to wrapper the class
> ImageToHistogramGenerator. Following the hints of
> Gaetan and the http://www.itk.org/Wiki/ITK_Scripting
>
> i wrote the wrap_itkImageToHistogramGenerator.cxx
> I dont know what i do with TImageType.
>
> #include "itkImage.h"
> #include "itkImageToHistogramGenerator.h"
>
> #ifdef CABLE_CONFIGURATION
> #include "itkCSwigMacros.h"
> #include "itkCSwigImages.h"
>
> namespace _cable_
> {
>   const char* const group =
> ITK_WRAP_GROUP(itkImageToHistogramGenerator);
>   namespace wrappers
>   {
>     ITK_WRAP_OBJECT1(ImageToHistogramGenerator,
> image::F2, itkImageToHistogramGeneratorF2);
>     ITK_WRAP_OBJECT1(ImageToHistogramGenerator,
> image::F3, itkImageToHistogramGeneratorF3);
>  }
> }
>
> #endif
>
>
> And i got the errors:
>
> local/oliveiramc/Doutorado/Insight_bin/Wrapping/CSwig/Numerics:
> building default_target
> Building wrap_itkImageToHistogramGenerator.xml from
> /local/oliveiramc/Doutorado/Insight_bin/Wrapping/CSwig/Numerics/wrap_itkImageToHistogramGenerator.xml...
> /local/oliveiramc/Doutorado/Insight/Wrapping/CSwig/Numerics/wrap_itkImageToHistogramGenerator.cxx:31:
> error: syntax
>    error before `::' token
> /local/oliveiramc/Doutorado/Insight/Wrapping/CSwig/Numerics/wrap_itkImageToHistogramGenerator.cxx:31:
> error: syntax
>    error before `::' token
> /local/oliveiramc/Doutorado/Insight/Wrapping/CSwig/Numerics/wrap_itkImageToHistogramGenerator.cxx:32:
> error: syntax
>    error before `::' token
> /local/oliveiramc/Doutorado/Insight/Wrapping/CSwig/Numerics/wrap_itkImageToHistogramGenerator.cxx:32:
> error: syntax
>    error before `::' token
> make[5]: ***
> [/local/oliveiramc/Doutorado/Insight_bin/Wrapping/CSwig/Numerics/wrap_itkImageToHistogramGenerator.xml]
> Error 1
>
>
>
>
>
> 	
> 	
> 		
> ____________________________________________________
> Yahoo! Mail, cada vez melhor: agora com 1GB de espaço grátis!  
> http://mail.yahoo.com.br



-- 
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