00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkCompose2DCovariantVectorImageFilter_h
00018 #define __itkCompose2DCovariantVectorImageFilter_h
00019
00020 #include "itkBinaryFunctorImageFilter.h"
00021 #include "itkCovariantVector.h"
00022
00034 namespace itk
00035 {
00036
00037 namespace Function {
00038
00039 template< class TInput >
00040 class Compose2DCovariantVector
00041 {
00042 public:
00043 typedef CovariantVector<TInput,2> OutputType;
00044 Compose2DCovariantVector() {}
00045 ~Compose2DCovariantVector() {}
00046 bool operator!=( const Compose2DCovariantVector & ) const
00047 {
00048 return false;
00049 }
00050 bool operator==( const Compose2DCovariantVector & other ) const
00051 {
00052 return !(*this != other);
00053 }
00054 inline OutputType operator()( const TInput & s1,
00055 const TInput & s2 )
00056 {
00057 OutputType v;
00058 v[0] = s1;
00059 v[1] = s2;
00060 return v;
00061 }
00062 };
00063 }
00064
00065 template <typename TInputImage,
00066 typename TOutputImage=
00067 Image< CovariantVector< ITK_TYPENAME TInputImage::PixelType,2 >,
00068 ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00069 class ITK_EXPORT Compose2DCovariantVectorImageFilter :
00070 public
00071 BinaryFunctorImageFilter<TInputImage,TInputImage,
00072 TOutputImage,
00073 Function::Compose2DCovariantVector< ITK_TYPENAME TInputImage::PixelType > >
00074 {
00075 public:
00077 typedef Compose2DCovariantVectorImageFilter Self;
00078 typedef BinaryFunctorImageFilter<TInputImage,TInputImage,
00079 TOutputImage,
00080 Function::Compose2DCovariantVector<
00081 ITK_TYPENAME TInputImage::PixelType >
00082 > Superclass;
00083 typedef SmartPointer<Self> Pointer;
00084 typedef SmartPointer<const Self> ConstPointer;
00085
00086 typedef typename Superclass::OutputImageType OutputImageType;
00087
00089 itkNewMacro(Self);
00090
00091 #ifdef ITK_USE_CONCEPT_CHECKING
00092
00093 itkConceptMacro(InputHasNumericTraitsCheck,
00094 (Concept::HasNumericTraits<typename TInputImage::PixelType>));
00095
00097 #endif
00098
00099 protected:
00100 Compose2DCovariantVectorImageFilter() {}
00101 virtual ~Compose2DCovariantVectorImageFilter() {}
00102
00103 private:
00104 Compose2DCovariantVectorImageFilter(const Self&);
00105 void operator=(const Self&);
00106
00107
00108 };
00109
00110 }
00111
00112
00113 #endif
00114