[Insight-developers] help with wrapping wrap_itkWatershedImageFilter

Charl P. Botha c.p.botha at ewi.tudelft.nl
Fri, 5 Mar 2004 18:50:07 +0100


--Boundary-00=_P3LSApWCeAdp/tg
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Dear developers,

I'm trying to wrap the itkWatershedImageFilter class.  After having created 
the attached wrap_itkWatershedImageFilter.cxx file in the Wrapping/CSwig/
Algorithms directory and having made the changes shown in the attached diff 
file, I get the following build errors on Debian Stable, g++ 2.95.4:

Building wrap_itkWatershedImageFilter.xml from  /home/cpbotha/DoNotBackup/
build/Insight-gcc/Wrapping/CSwig/Algorithms/
wrap_itkWatershedImageFilter.xml...
In file included from /home/cpbotha/DoNotBackup/build/Insight/Code/Algorithms/
itkWatershedBoundary.h:30,
from /home/cpbotha/DoNotBackup/build/Insight/Code/Algorithms/
itkWatershedSegmenter.h:25,
from /home/cpbotha/DoNotBackup/build/Insight/Code/Algorithms/
itkWatershedImageFilter.h:26,
from /home/cpbotha/DoNotBackup/build/Insight/Wrapping/CSwig/Algorithms/
wrap_itkWatershedImageFilter.cxx:18:
/home/cpbotha/DoNotBackup/build/Insight/Code/Common/itk_hash_map.h:112: error: 
ISO C++ forbids declaration of `select1st' with no type
/home/cpbotha/DoNotBackup/build/Insight/Code/Common/itk_hash_map.h:112: error: 
template-id `select1st<pair<const Key, T> >' used as a declarator
/home/cpbotha/DoNotBackup/build/Insight/Code/Common/itk_hash_map.h:112: error: 
syntax error before `;' token

Does anyone have any ideas?  As far as I can see, "select1st" is declared in 
the stl_function.h on my system.  "functional", which includes 
stl_function.h, is included somewhere in the itk_hash_map.h hierachy.

Thanks,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/

--Boundary-00=_P3LSApWCeAdp/tg
Content-Type: text/x-diff;
  charset="us-ascii";
  name="wrap_itkWatershedImageFilterMeta.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="wrap_itkWatershedImageFilterMeta.diff"

? wrap_itkWatershedImageFilter.cxx
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/Insight/Insight/Wrapping/CSwig/Algorithms/CMakeLists.txt,v
retrieving revision 1.15
diff -u -r1.15 CMakeLists.txt
--- CMakeLists.txt	18 Feb 2004 14:47:41 -0000	1.15
+++ CMakeLists.txt	5 Mar 2004 17:45:10 -0000
 at  at  -20,6 +20,7  at  at 
     wrap_itkShapeDetectionLevelSetImageFilter
     wrap_itkCurvesLevelSetImageFilter
     wrap_itkNarrowBandCurvesLevelSetImageFilter
+    wrap_itkWatershedImageFilter
 )
 
 SET(MASTER_INDEX_FILES "${WrapITK_BINARY_DIR}/VXLNumerics/VXLNumerics.mdx"
Index: wrap_ITKAlgorithms.cxx
===================================================================
RCS file: /cvsroot/Insight/Insight/Wrapping/CSwig/Algorithms/wrap_ITKAlgorithms.cxx,v
retrieving revision 1.7
diff -u -r1.7 wrap_ITKAlgorithms.cxx
--- wrap_ITKAlgorithms.cxx	6 Nov 2003 22:24:13 -0000	1.7
+++ wrap_ITKAlgorithms.cxx	5 Mar 2004 17:45:10 -0000
 at  at  -40,7 +40,8  at  at 
     ITK_WRAP_GROUP(itkCurvesLevelSetImageFilter),
     ITK_WRAP_GROUP(itkNarrowBandCurvesLevelSetImageFilter),
     ITK_WRAP_GROUP(itkMattesMutualInformationImageToImageMetric),
-    ITK_WRAP_GROUP(itkRecursiveMultiResolutionPyramidImageFilter)
+    ITK_WRAP_GROUP(itkRecursiveMultiResolutionPyramidImageFilter),
+    ITK_WRAP_GROUP(itkWatershedImageFilter)
   };
 }
 #endif

--Boundary-00=_P3LSApWCeAdp/tg
Content-Type: text/x-c++src;
  charset="us-ascii";
  name="wrap_itkWatershedImageFilter.cxx"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="wrap_itkWatershedImageFilter.cxx"

/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile$
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

  Copyright (c) Insight Software Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#include "itkImage.h"
#include "itkWatershedImageFilter.h"

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

namespace _cable_
{
  const char* const group = ITK_WRAP_GROUP(itkWatershedImageFilter);
  namespace wrappers
  {
    ITK_WRAP_OBJECT1(WatershedImageFilter, image::F2, itkWatershedImageFilterF2);
    ITK_WRAP_OBJECT1(WatershedImageFilter, image::F3, itkWatershedImageFilterF3);
  }
}

#endif

--Boundary-00=_P3LSApWCeAdp/tg--