itkAndImageFilter.h
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 __itkAndImageFilter_h
00018 #define __itkAndImageFilter_h
00019
00020 #include "itkBinaryFunctorImageFilter.h"
00021 #include "itkNumericTraits.h"
00022
00023
00024 namespace itk
00025 {
00026
00046 namespace Functor {
00047
00048 template< class TInput1, class TInput2=TInput1, class TOutput=TInput1 >
00049 class AND
00050 {
00051 public:
00052 AND() {};
00053 ~AND() {};
00054 bool operator!=( const AND & ) const
00055 {
00056 return false;
00057 }
00058 bool operator==( const AND & other ) const
00059 {
00060 return !(*this != other);
00061 }
00062 inline TOutput operator()( const TInput1 & A, const TInput2 & B) const
00063 {
00064 return static_cast<TOutput>( A & B );
00065 }
00066 };
00067
00068 }
00069 template <class TInputImage1, class TInputImage2=TInputImage1, class TOutputImage=TInputImage1>
00070 class ITK_EXPORT AndImageFilter :
00071 public
00072 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00073 Functor::AND<
00074 typename TInputImage1::PixelType,
00075 typename TInputImage2::PixelType,
00076 typename TOutputImage::PixelType> >
00077
00078
00079 {
00080 public:
00082 typedef AndImageFilter Self;
00083 typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00084 Functor::AND<
00085 typename TInputImage1::PixelType,
00086 typename TInputImage2::PixelType,
00087 typename TOutputImage::PixelType> > Superclass;
00088 typedef SmartPointer<Self> Pointer;
00089 typedef SmartPointer<const Self> ConstPointer;
00090
00092 itkNewMacro(Self);
00093
00095 itkTypeMacro(AndImageFilter,
00096 BinaryFunctorImageFilter);
00097
00098 #ifdef ITK_USE_CONCEPT_CHECKING
00099
00100 itkConceptMacro(Input1Input2OutputLogicalOperatorsCheck,
00101 (Concept::LogicalOperators<typename TInputImage1::PixelType,
00102 typename TInputImage2::PixelType,
00103 typename TOutputImage::PixelType>));
00104
00106 #endif
00107
00108 protected:
00109 AndImageFilter() {}
00110 virtual ~AndImageFilter() {}
00111
00112 private:
00113 AndImageFilter(const Self&);
00114 void operator=(const Self&);
00115
00116 };
00117
00118 }
00119
00120
00121 #endif
00122