Orfeo Toolbox  3.16
itkVectorCastImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkVectorCastImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2008-10-17 16:30:53 $
7  Version: $Revision: 1.16 $
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 __itkVectorCastImageFilter_h
18 #define __itkVectorCastImageFilter_h
19 
22 
23 namespace itk
24 {
25 
41 namespace Functor {
42 
43 template< class TInput, class TOutput>
45 {
46 public:
49  bool operator!=( const VectorCast & ) const
50  {
51  return false;
52  }
53  bool operator==( const VectorCast & other ) const
54  {
55  return !(*this != other);
56  }
57  inline TOutput operator()( const TInput & A ) const
58  {
59  typedef typename TOutput::ValueType OutputValueType;
60 
61  TOutput value;
62  for( unsigned int k = 0; k < TOutput::Dimension; k++ )
63  {
64  value[k] = static_cast<OutputValueType>( A[k] );
65  }
66  return value;
67  }
68 };
69 }
70 
71 template <class TInputImage, class TOutputImage>
73  public
74 UnaryFunctorImageFilter<TInputImage,TOutputImage,
75  Functor::VectorCast< typename TInputImage::PixelType,
76  typename TOutputImage::PixelType> >
77 {
78 public:
82  TInputImage,TOutputImage,
83  Functor::VectorCast< typename TInputImage::PixelType,
84  typename TOutputImage::PixelType> > Superclass;
87 
89  itkNewMacro(Self);
90 
92  itkTypeMacro(VectorCastImageFilter,
94 
95 #ifdef ITK_USE_CONCEPT_CHECKING
96 
97  itkConceptMacro(InputHasNumericTraitsCheck,
99  itkConceptMacro(OutputHasNumericTraitsCheck,
101  itkConceptMacro(InputConvertibleToOutputCheck,
102  (Concept::Convertible<typename TInputImage::PixelType::ValueType,
103  typename TOutputImage::PixelType::ValueType>));
105 #endif
106 
107 protected:
110 
111 private:
112  VectorCastImageFilter(const Self&); //purposely not implemented
113  void operator=(const Self&); //purposely not implemented
114 
115 };
116 
117 } // end namespace itk
118 
119 
120 #endif

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