[Insight-users] Importing itk module generated by WrapITK is slow

Kent Williams kent at psychiatry.uiowa.edu
Tue Mar 28 17:02:24 EST 2006


I ran into the WRAP_rgb_unsigned_short problem with WrapITK and TCL 
Wrapping.  This is fixable with a simple patch, included below. I 
haven't checked it into ITK CVS yet because I guess we're supposed to be 
holding off on checkins.


cvs diff -c2 itkNumericTraits*
Index: itkNumericTraitsRGBPixel.cxx
===================================================================
RCS file: 
/cvsroot/Insight/Insight/Code/Common/itkNumericTraitsRGBPixel.cxx,v
retrieving revision 1.3
diff -c -2 -r1.3 itkNumericTraitsRGBPixel.cxx
*** itkNumericTraitsRGBPixel.cxx    9 Jan 2005 15:58:08 -0000    1.3
--- itkNumericTraitsRGBPixel.cxx    28 Mar 2006 21:59:34 -0000
***************
*** 22,25 ****
--- 22,27 ----
  const RGBPixel<unsigned char>  NumericTraits<RGBPixel<unsigned char> 
 >::Zero = RGBPixel<unsigned char>( NumericTraits<unsigned char>::Zero );
  const RGBPixel<unsigned char>  NumericTraits<RGBPixel<unsigned char> 
 >::One = RGBPixel<unsigned char>( NumericTraits<unsigned char>::One );
+ const RGBPixel<unsigned short>  NumericTraits<RGBPixel<unsigned short> 
 >::Zero = RGBPixel<unsigned short>( NumericTraits<unsigned short>::Zero );
+ const RGBPixel<unsigned short>  NumericTraits<RGBPixel<unsigned short> 
 >::One = RGBPixel<unsigned short>( NumericTraits<unsigned short>::One );
  
  } // end namespace itk
cvs diff: I know nothing about itkNumericTraitsRGBPixel.cxx.~1.3.~
Index: itkNumericTraitsRGBPixel.h
===================================================================
RCS file: /cvsroot/Insight/Insight/Code/Common/itkNumericTraitsRGBPixel.h,v
retrieving revision 1.8
diff -c -2 -r1.8 itkNumericTraitsRGBPixel.h
*** itkNumericTraitsRGBPixel.h    8 Aug 2005 19:18:22 -0000    1.8
--- itkNumericTraitsRGBPixel.h    28 Mar 2006 21:59:34 -0000
***************
*** 43,46 ****
--- 43,65 ----
   
  };
+ /** \class NumericTraits<RGBPixel<unsigned short> >
+  * \brief Define traits for type RGBPixel<unsigned char>.
+  * \ingroup DataRepresentation
+  */
+ template <>
+ class NumericTraits<RGBPixel<unsigned short> > {
+ public:
+   typedef RGBPixel<unsigned char> ValueType;
+   typedef RGBPixel<unsigned char> PrintType;
+   typedef RGBPixel<unsigned char> AbsType;
+   typedef RGBPixel<unsigned short> AccumulateType;
+   typedef RGBPixel<double> RealType;
+   typedef double           ScalarRealType;
+   typedef RGBPixel<float>  FloatType;
+   static const RGBPixel<unsigned short> ITKCommon_EXPORT Zero;
+   static const RGBPixel<unsigned short> ITKCommon_EXPORT One;
+   static ValueType ZeroValue() { return Zero; }
+  
+ };
 
  } // end namespace itk



More information about the Insight-users mailing list