Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkNotImageFilter_h
00018 #define __itkNotImageFilter_h
00019
00020 #include "itkUnaryFunctorImageFilter.h"
00021 #include "itkNumericTraits.h"
00022
00023
00024 namespace itk
00025 {
00026
00046 namespace Functor {
00047
00048 template< class TInput, class TOutput=TInput >
00049 class NOT
00050 {
00051 public:
00052 NOT() {};
00053 ~NOT() {};
00054 bool operator!=( const NOT & ) const
00055 {
00056 return false;
00057 }
00058 bool operator==( const NOT & other ) const
00059 {
00060 return !(*this != other);
00061 }
00062 inline TOutput operator()( const TInput & A ) const
00063 {
00064 return static_cast<TOutput>( !A );
00065 }
00066 };
00067
00068 }
00069 template <class TInputImage, class TOutputImage>
00070 class ITK_EXPORT NotImageFilter :
00071 public
00072 UnaryFunctorImageFilter<TInputImage,TOutputImage,
00073 Functor::NOT<
00074 typename TInputImage::PixelType,
00075 typename TOutputImage::PixelType> >
00076
00077
00078 {
00079 public:
00081 typedef NotImageFilter Self;
00082 typedef UnaryFunctorImageFilter<
00083 TInputImage,TOutputImage,
00084 Functor::NOT<
00085 typename TInputImage::PixelType,
00086 typename TOutputImage::PixelType>
00087 > Superclass;
00088 typedef SmartPointer<Self> Pointer;
00089 typedef SmartPointer<const Self> ConstPointer;
00090
00092 itkNewMacro(Self);
00093
00095 itkTypeMacro(NotImageFilter,
00096 UnaryFunctorImageFilter);
00097
00098 #ifdef ITK_USE_CONCEPT_CHECKING
00099
00100 itkConceptMacro(InputConvertibleToOutputCheck,
00101 (Concept::Convertible<typename TInputImage::PixelType,
00102 typename TOutputImage::PixelType>));
00103 itkConceptMacro(InputNotOperatorCheck,
00104 (Concept::NotOperator<typename TInputImage::PixelType>));
00105
00107 #endif
00108
00109 protected:
00110 NotImageFilter() {}
00111 virtual ~NotImageFilter() {}
00112
00113 private:
00114 NotImageFilter(const Self&);
00115 void operator=(const Self&);
00116
00117 };
00118
00119 }
00120
00121
00122 #endif
00123