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

itkNotImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkNotImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007-09-27 11:36:41 $
00007   Version:   $Revision: 1.6 $
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 __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 )
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<TInputImage,TOutputImage, 
00083                                    Functor::NOT< 
00084     typename TInputImage::PixelType, 
00085     typename TOutputImage::PixelType>   
00086   >  Superclass;
00087   typedef SmartPointer<Self>   Pointer;
00088   typedef SmartPointer<const Self>  ConstPointer;
00089 
00091   itkNewMacro(Self);
00092 
00094   itkTypeMacro(NotImageFilter, 
00095                UnaryFunctorImageFilter);
00096 
00097 #ifdef ITK_USE_CONCEPT_CHECKING
00098 
00099   itkConceptMacro(InputConvertibleToOutputCheck,
00100     (Concept::Convertible<typename TInputImage::PixelType,
00101                           typename TOutputImage::PixelType>));
00102   itkConceptMacro(InputNotOperatorCheck,
00103     (Concept::NotOperator<typename TInputImage::PixelType>));
00104 
00106 #endif
00107 
00108 protected:
00109   NotImageFilter() {}
00110   virtual ~NotImageFilter() {}
00111 
00112 private:
00113   NotImageFilter(const Self&); //purposely not implemented
00114   void operator=(const Self&); //purposely not implemented
00115 
00116 };
00117 
00118 } // end namespace itk
00119 
00120 
00121 #endif
00122 

Generated at Mon Apr 14 13:49:43 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000