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

itkMaskNegatedImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMaskNegatedImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/09/27 11:36:40 $
00007   Version:   $Revision: 1.7 $
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 __itkMaskNegatedImageFilter_h
00018 #define __itkMaskNegatedImageFilter_h
00019 
00020 #include "itkBinaryFunctorImageFilter.h"
00021 #include "itkNumericTraits.h"
00022 
00023 
00024 namespace itk
00025 {
00026   
00053 namespace Functor {  
00054   
00055 template< class TInput, class TMask, class TOutput=TInput >
00056 class MaskNegatedInput
00057 {
00058 public:
00059   typedef typename NumericTraits< TInput >::AccumulateType AccumulatorType;
00060 
00061   MaskNegatedInput() {};
00062   ~MaskNegatedInput() {};
00063   bool operator!=( const MaskNegatedInput & ) const
00064   {
00065     return false;
00066   }
00067   bool operator==( const MaskNegatedInput & other ) const
00068   {
00069     return !(*this != other);
00070   }
00071   inline TOutput operator()( const TInput & A, const TMask & B)
00072   {
00073     if (B != NumericTraits< TMask >::Zero ) 
00074       {
00075       return NumericTraits< TOutput >::Zero;
00076       }
00077     else
00078       {
00079       return static_cast<TOutput>( A );
00080       }
00081   }
00082 }; 
00083 
00084 }
00085 template <class TInputImage, class TMaskImage, class TOutputImage=TInputImage>
00086 class ITK_EXPORT MaskNegatedImageFilter :
00087     public
00088 BinaryFunctorImageFilter<TInputImage,TMaskImage,TOutputImage, 
00089                          Functor::MaskNegatedInput< 
00090   typename TInputImage::PixelType, 
00091   typename TMaskImage::PixelType,
00092   typename TOutputImage::PixelType>   >
00093 
00094 
00095 {
00096 public:
00098   typedef MaskNegatedImageFilter  Self;
00099   typedef BinaryFunctorImageFilter<TInputImage,TMaskImage,TOutputImage, 
00100                                    Functor::MaskNegatedInput< 
00101     typename TInputImage::PixelType, 
00102     typename TMaskImage::PixelType,
00103     typename TOutputImage::PixelType>   
00104   >  Superclass;
00105   typedef SmartPointer<Self>   Pointer;
00106   typedef SmartPointer<const Self>  ConstPointer;
00107 
00109   itkNewMacro(Self);
00110 
00112   itkTypeMacro(MaskNegatedImageFilter, 
00113                BinaryFunctorImageFilter);
00114 
00115 #ifdef ITK_USE_CONCEPT_CHECKING
00116 
00117   itkConceptMacro(MaskEqualityComparableCheck,
00118     (Concept::EqualityComparable<typename TMaskImage::PixelType>));
00119   itkConceptMacro(InputConvertibleToOutputCheck,
00120     (Concept::Convertible<typename TInputImage::PixelType,
00121                           typename TOutputImage::PixelType>));
00122 
00124 #endif
00125 
00126 protected:
00127   MaskNegatedImageFilter() {}
00128   virtual ~MaskNegatedImageFilter() {}
00129 
00130 private:
00131   MaskNegatedImageFilter(const Self&); //purposely not implemented
00132   void operator=(const Self&); //purposely not implemented
00133 
00134 };
00135 
00136 } // end namespace itk
00137 
00138 
00139 #endif
00140 

Generated at Tue Jul 29 21:08:49 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000