[Insight-users] TransformMeshFilter bug

Gavin Baker gavinb+xtk at cs.mu.OZ.AU
Wed Aug 3 06:29:24 EDT 2005


Hello,

I've discovered a weird bug in the itk::TransformMeshFilter that occurs only
under certain conditions (or rather with certain types).

I've reproduced it by making a few small changes to the regular unit test
itkTransformMeshFilterTest.  The diff is below.  It basically just involves
explicitly specifying the full mesh traits.

So before the changes, the test program works fine.  With the below changes,
the filter will go into an infinite loop on line 99, where it is
incrementing the output iterator:

 ++outputPoint;

That's as far as I've tracked it.  I suspect it has something to do with the
way the output points are allocated.

Can anyone shed some light on this?

Thanks - regards,

  :: Gavin

-- 
Gavin Baker                                      Complex Systems Group
http://www.cs.mu.oz.au/~gavinb             The University of Melbourne






--- /home/gavinb/projects/ITK/Insight/Testing/Code/BasicFilters/itkTransformMeshFilterTest.cxx  2003-09-11 00:30:08.000000000 +1000
+++ ../itkTransformMeshFilterTest.cxx   2005-08-03 20:21:32.359274363 +1000
@@ -19,22 +19,28 @@
 #endif
 
 #include <itkTransformMeshFilter.h>
+#include <itkDefaultDynamicMeshTraits.h>
 #include <itkMesh.h>
 #include <itkAffineTransform.h>
 
-int itkTransformMeshFilterTest(int, char* [] ) 
+int main(int, char* [] ) 
 {
 
   // Declare the mesh pixel type.
   // Those are the values associated 
   // with each mesh point. (not used on this filter test)
-  typedef int PixelType;
+  typedef float PixelType;
   
   // Declare the types of the Mesh
   // By default it is a 3D mesh using itk::Point<float,3>
   // on the vertices, and an itk::VectorContainter
   // as containter for points
-  typedef itk::Mesh<PixelType>  MeshType;
+  enum { Dimension = 3 };
+  
+  typedef itk::DefaultDynamicMeshTraits<
+      PixelType, Dimension, Dimension, PixelType, PixelType > MeshTraitsType;
+
+  typedef itk::Mesh<PixelType, Dimension, MeshTraitsType>  MeshType;
 
   // Declare the type for PointsContainer
   typedef MeshType::PointsContainer     PointsContainerType;


More information about the Insight-users mailing list