Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkOrImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkOrImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-01 14:36:31 $
00007   Version:   $Revision: 1.8 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkOrImageFilter_h
00018 #define __itkOrImageFilter_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 OR
00050 {
00051 public:
00052   OR() {};
00053   ~OR() {};
00054   bool operator!=( const OR & ) const
00055     {
00056     return false;
00057     }
00058   bool operator==( const OR & 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 OrImageFilter :
00071     public
00072 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage, 
00073                          Functor::OR< 
00074   typename TInputImage1::PixelType, 
00075   typename TInputImage2::PixelType,
00076   typename TOutputImage::PixelType>   >
00077 
00078 
00079 {
00080 public:
00082   typedef OrImageFilter             Self;
00083   typedef BinaryFunctorImageFilter<
00084     TInputImage1,TInputImage2,TOutputImage, 
00085     Functor::OR<typename TInputImage1::PixelType, 
00086                 typename TInputImage2::PixelType,
00087                 typename TOutputImage::PixelType> >
00088                                     Superclass;
00089   typedef SmartPointer<Self>        Pointer;
00090   typedef SmartPointer<const Self>  ConstPointer;
00091 
00093   itkNewMacro(Self);
00094 
00096   itkTypeMacro(OrImageFilter, 
00097                BinaryFunctorImageFilter);
00098 
00099 #ifdef ITK_USE_CONCEPT_CHECKING
00100 
00101   itkConceptMacro(Input1Input2OutputLogicalOperatorsCheck,
00102     (Concept::LogicalOperators<typename TInputImage1::PixelType,
00103                                typename TInputImage2::PixelType,
00104                                typename TOutputImage::PixelType>));
00105 
00107 #endif
00108 
00109 protected:
00110   OrImageFilter() {}
00111   virtual ~OrImageFilter() {}
00112 
00113 private:
00114   OrImageFilter(const Self&); //purposely not implemented
00115   void operator=(const Self&); //purposely not implemented
00116 
00117 };
00118 
00119 } // end namespace itk
00120 
00121 
00122 #endif
00123 

Generated at Mon Jul 12 2010 19:23:27 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000