[Insight-developers] Wrapping QuadEdgeMesh - build problems

alex gouaillard alexandre_gouaillard at hms.harvard.edu
Sat May 16 08:50:43 EDT 2009


Hi gaethan,

thanks for taking the time to hold my hand through the (itk)Wrapping  
process. I wouldn't say that I'm autonomous yet, but I understood  
enough not to be afraid anymore to dive into this process. I think I  
will start by wrapping the levelset classes we just moved to ITK and  
that will be available in 3.14 (ITK pi as sean put it).

I loved the features of the new wrapitk (that you call usually the  
unstable one). Specifically, the automatic, on the fly, documentation  
extraction is very nice (and revealed a lot of obsolete documentation  
in QuadEdgeMesh that I will fix ... soon.)

Looking forward to meet you again tuesday, with curtis at the OME user  
meeting. I'm also very exited about investigating curtis C++ wrapping  
for bio-formats, and I know you share my excitement.

cheers.

alex.


On May 16, 2009, at 12:30 PM, Gaëtan Lehmann wrote:

>
> Hi,
>
> Alex was in my lab last wednesday, and we began to wrap the
> QuadEdgeMesh stuff in WrapITK. This is a quite complex set of classes,
> which is highlighting some problems both in WrapITK and ITK. I'm
> taking the WrapITK's problem — here are the other ones:
>
> * I get an error in the method void
> itk::MapContainer::Reserve(ElementIdentifier):
>
>   /Users/glehmann/src/Insight/Code/Common/itkMapContainer.txx: In
> member function ‘void itk::MapContainer<TElementIdentifier,
> TElement>::Reserve(TElementIdentifier) [with TElementIdentifier =
> itk::Mesh<double, 3u, itk::QuadEdgeMeshTraits<double, 3u, bool, bool,
> float, float> >::BoundaryAssignmentIdentifier, TElement = long
> unsigned int]’:
>   /Users/glehmann/src/contrib-itk/quadmesh/build/Wrapping/
> wrap_itkBinaryMask3DMeshSourcePython.cpp:22596:   instantiated from  
> here
>   /Users/glehmann/src/Insight/Code/Common/itkMapContainer.txx:248:
> error: conversion from ‘long unsigned int’ to non-scalar type
> ‘itk::Mesh<double, 3u, itk::QuadEdgeMeshTraits<double, 3u, bool, bool,
> float, float> >::BoundaryAssignmentIdentifier’ requested
>
> The problematic code is:
>
>   template <typename TElementIdentifier, typename TElement>
>   void
>   MapContainer< TElementIdentifier , TElement >
>   ::Reserve(ElementIdentifier sz)
>   {
>     ElementIdentifier curSize = this->Size();
>     while ( curSize < sz )
>       {
>       this->CreateIndex(curSize);
>       curSize = this->Size();
>       }
>   }
>
> Either that code, which tries to convert a number to a class, or the
> type used for TElementIdentifier (itk::Mesh<double, 3u,
> itk::QuadEdgeMeshTraits<double, 3u, bool, bool, float, float>
>> ::BoundaryAssignmentIdentifier), is wrong here.
> Any idea about how to fix that?
>
>
>
> * The macro itkCellCommonTypedefs( celltype ) in itkCellInterface.h
> provides some common typedefs for the cell types, but also a New()
> method, which makes swig generate invalid code.
>
>          SelfAutoPointer   New(void) {                 \
>                 SelfAutoPointer ptr( new celltype );   \
>                 ptr.TakeOwnership();                   \
>                 return ptr;                            \
>                 }                                      \
>
> This New() method looks quite strange to me, because it is not static,
> and thus already require an object to be used. Also, I tried to simply
> comment that method in the macro (and in itkQuadEdgeMeshLineCell.h/
> txx), and it works - no code seems to use it.
> So, is it a good fix to simply drop that method?
>
>
>
> * The method itk::AutoPointer::Print produce an error when built
>
>   /usr/local/include/InsightToolkit/Common/itkAutoPointer.h: In
> member function ‘TObjectType*
> itk::AutoPointer<TObjectType>::Print(std::ostream&) const [with
> TObjectType = itk::CellInterface<double,
> itk::QuadEdgeMeshCellTraitsInfo<3, float, float, long unsigned int,
> long unsigned int, unsigned char, itk::QuadEdgeMeshPoint<float, 3u,
> itk::GeometricalQuadEdge<long unsigned int, long unsigned int, bool,
> bool, true> >, itk::MapContainer<long unsigned int,
> itk::QuadEdgeMeshPoint<float, 3u, itk::GeometricalQuadEdge<long
> unsigned int, long unsigned int, bool, bool, true> > >, std::set<long
> unsigned int, std::less<long unsigned int>,
> std::allocator<std::_Bit_type> >, itk::GeometricalQuadEdge<long
> unsigned int, long unsigned int, bool, bool, true> > >]’:
>   /usr/local/include/InsightToolkit/Common/itkAutoPointer.h:189:
> error: ‘class itk::CellInterface<double,
> itk::QuadEdgeMeshCellTraitsInfo<3, float, float, long unsigned int,
> long unsigned int, unsigned char, itk::QuadEdgeMeshPoint<float, 3u,
> itk::GeometricalQuadEdge<long unsigned int, long unsigned int, bool,
> bool, true> >, itk::MapContainer<long unsigned int,
> itk::QuadEdgeMeshPoint<float, 3u, itk::GeometricalQuadEdge<long
> unsigned int, long unsigned int, bool, bool, true> > >, std::set<long
> unsigned int, std::less<long unsigned int>,
> std::allocator<std::_Bit_type> >, itk::GeometricalQuadEdge<long
> unsigned int, long unsigned int, bool, bool, true> > >’ has no member
> named ‘Print’
>
>   ObjectType *Print (std::ostream& os) const
>     {
>     // This prints the object pointed to by the pointer
>     (*m_Pointer).Print(os);
>     os << "Owner: " << m_IsOwner << std::endl;
>     return m_Pointer;
>     }
>
> the itk::CellInterface class doesn't define a Print method, so the
> Print method in AutoPointer seems to be wrong. What is the better fix
> - drop the Print method in itk::AutoPointer, or adding a Print method
> in all the cell classes?
>
> * The template are very complex to instantiate. There is a lot of
> template parameters to give. It would be great to simplify the
> instantiation by providing good enough default values.
>
> Thanks again Alex for your presentation. My colleagues were very
> impressed by your project and your work :-)
>
> Gaëtan
>
>
> -- 
> 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  http://www.mandriva.org
> http://www.itk.org  http://www.clavier-dvorak.org
>
> <PGP.sig><ATT00001.txt>



More information about the Insight-developers mailing list