#ifndef __itkLessImageFilter_h #define __itkLessImageFilter_h #include "itkBinaryFunctorImageFilter.h" #include "itkNumericTraits.h" namespace itk { /** \class LessImageFilter * \brief Implements the Less 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 less than operator in C++. * * \ingroup IntensityImageFilters Multithreaded */ namespace Functor { template< class TInput1, class TInput2=TInput1, class TOutput=TInput1 > class LESS { public: LESS() {}; ~LESS() {}; bool operator!=( const LESS & ) const { return false; } bool operator==( const LESS & other ) const { return !(*this != other); } inline TOutput operator()( const TInput1 & A, const TInput2 & B) { return static_cast( A < B ); } }; } template class ITK_EXPORT LessImageFilter : public BinaryFunctorImageFilter > { public: /** Standard class typedefs. */ typedef LessImageFilter 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: LessImageFilter() {} virtual ~LessImageFilter() {} private: LessImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace itk #endif