#ifndef __itkGreaterImageFilter_h #define __itkGreaterImageFilter_h #include "itkBinaryFunctorImageFilter.h" #include "itkNumericTraits.h" namespace itk { /** \class GreaterImageFilter * \brief Implements the Greater logical operator pixel-wise between two images. * * This class is parametrized over the types of the two * input images and the type of the output image. * Numeric conversions (castings) are done by the C++ defaults. * * * The total operation over one pixel will be * * output_pixel = static_cast( input1_pixel > input2_pixel ) * * Where ">" is the equality operator in C++. * * \ingroup IntensityImageFilters Multithreaded */ namespace Functor { template< class TInput1, class TInput2=TInput1, class TOutput=TInput1 > class GREATER { public: GREATER() {}; ~GREATER() {}; bool operator!=( const GREATER & ) const { return false; } bool operator==( const GREATER & other ) const { return !(*this != other); } inline TOutput operator()( const TInput1 & A, const TInput2 & B) { return static_cast( A > B ); } }; } template class ITK_EXPORT GreaterImageFilter : public BinaryFunctorImageFilter > { public: /** Standard class typedefs. */ typedef GreaterImageFilter Self; typedef BinaryFunctorImageFilter > Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); #ifdef ITK_USE_CONCEPT_CHECKING /** Begin concept checking */ itkConceptMacro(Input1Input2OutputLogicalOperatorsCheck, (Concept::LogicalOperators)); /** End concept checking */ #endif protected: GreaterImageFilter() {} virtual ~GreaterImageFilter() {} private: GreaterImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace itk #endif