[Insight-users] [Patch] Checker pattern size

Gavin Baker gavinb+xtk at cs.mu.OZ.AU
Mon May 23 01:42:29 EDT 2005


Hi,

The itkCheckerBoardImageFilter will produce 4 boxes in each dimension,
regardless of the image size, and there is no way of changing this.

Included below is a trivial patch to allow specifying the number of
checker boxes per dimension. The default behaviour is still the same,
and it has been tested and works fine.

Thanks,

  :: Gavin

-- 
Gavin Baker                                      Complex Systems Group
http://www.cs.mu.oz.au/~gavinb             The University of Melbourne
-------------- next part --------------
Index: itkCheckerBoardImageFilter.h
===================================================================
RCS file: /cvsroot/Insight/Insight/Code/BasicFilters/itkCheckerBoardImageFilter.h,v
retrieving revision 1.2
diff -u -r1.2 itkCheckerBoardImageFilter.h
--- itkCheckerBoardImageFilter.h        2 May 2005 02:24:39 -0000       1.2
+++ itkCheckerBoardImageFilter.h        23 May 2005 05:38:02 -0000
@@ -71,7 +71,18 @@
 
   /** Connect one of the operands for checker board */
   void SetInput2( const TImage * image2);
-
+    
+  /** Specifies the number of checker boxes per dimension */
+  void SetCheckerPattern( unsigned int p )
+  {
+    m_CheckerPattern.Fill( p );
+  }
+
+  /** Specifies the number of checker boxes per dimension */
+  unsigned int GetCheckerPattern()
+  {
+    return m_CheckerPattern[0];
+  }
 
 protected:
   CheckerBoardImageFilter();


More information about the Insight-users mailing list