Orfeo Toolbox  3.16
itkPixelBuilder.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkPixelBuilder.h,v $
5  Language: C++
6  Date: $Date: 2010-04-05 18:05:48 $
7  Version: $Revision: 1.65 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkPixelBuilder_h
18 #define __itkPixelBuilder_h
19 
21 
22 namespace itk
23 {
24 
29 template <typename T>
31 {
32 public:
33  // Default implementation
34  static void Zero( T & pixel,unsigned int)
35  {
36  pixel = itk::NumericTraits<T>::Zero;
37  }
38 
39  static void RefZero( T & pixel,const T &)
40  {
41  pixel = itk::NumericTraits<T>::Zero;
42  }
43 };
44 
45 // Partial specialisation for VariableLengthVector
46 template <typename T>
48 {
49 public:
50  static void Zero(VariableLengthVector<T>& pixel, unsigned int nbComp)
51  {
52  pixel.SetSize(nbComp,true);
53  pixel.Fill(itk::NumericTraits<T>::Zero);
54  }
55 
56  static void RefZero(VariableLengthVector<T>& pixel, const VariableLengthVector<T>& refPixel )
57  {
58  pixel.SetSize(refPixel.Size(),true);
59  pixel.Fill(itk::NumericTraits<T>::Zero);
60  }
61 };
62 } // End namespace itk
63 
64 #endif // __itkPixelBuilder_h

Generated at Sun Jun 16 2013 00:00:31 for Orfeo Toolbox with doxygen 1.8.3.1