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: 2005/04/30 12:35:39 $
00007   Version:   $Revision: 1.2 $
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 >
00056 class MaskNegatedInput
00057 {
00058 public:
00059   typedef typename NumericTraits< TInput >::AccumulateType AccumulatorType;
00060 
00061   MaskNegatedInput() {};
00062   ~MaskNegatedInput() {};
00063   inline TOutput operator()( const TInput & A, const TMask & B)
00064   {
00065     if (B != NumericTraits< TMask >::Zero ) 
00066       {
00067       return NumericTraits< TOutput >::Zero;
00068       }
00069     else
00070       {
00071       return static_cast<TOutput>( A );
00072       }
00073   }
00074 }; 
00075 
00076 }
00077 template <class TInputImage, class TMaskImage, class TOutputImage>
00078 class ITK_EXPORT MaskNegatedImageFilter :
00079     public
00080 BinaryFunctorImageFilter<TInputImage,TMaskImage,TOutputImage, 
00081                          Functor::MaskNegatedInput< 
00082   typename TInputImage::PixelType, 
00083   typename TMaskImage::PixelType,
00084   typename TOutputImage::PixelType>   >
00085 
00086 
00087 {
00088 public:
00090   typedef MaskNegatedImageFilter  Self;
00091   typedef BinaryFunctorImageFilter<TInputImage,TMaskImage,TOutputImage, 
00092                                    Functor::MaskNegatedInput< 
00093     typename TInputImage::PixelType, 
00094     typename TMaskImage::PixelType,
00095     typename TOutputImage::PixelType>   
00096   >  Superclass;
00097   typedef SmartPointer<Self>   Pointer;
00098   typedef SmartPointer<const Self>  ConstPointer;
00099 
00101   itkNewMacro(Self);
00102   
00103 protected:
00104   MaskNegatedImageFilter() {}
00105   virtual ~MaskNegatedImageFilter() {}
00106 
00107 private:
00108   MaskNegatedImageFilter(const Self&); //purposely not implemented
00109   void operator=(const Self&); //purposely not implemented
00110 
00111 };
00112 
00113 } // end namespace itk
00114 
00115 
00116 #endif

Generated at Wed May 24 23:37:27 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000