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

itkAndImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAndImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/12/06 20:58:24 $
00007   Version:   $Revision: 1.1 $
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 __itkAndImageFilter_h
00018 #define __itkAndImageFilter_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 AND
00050 {
00051 public:
00052   AND() {};
00053   ~AND() {};
00054   inline TOutput operator()( const TInput1 & A, const TInput2 & B)
00055   {
00056     return static_cast<TOutput>( A & B );
00057   }
00058 }; 
00059 
00060 }
00061 template <class TInputImage1, class TInputImage2, class TOutputImage>
00062 class ITK_EXPORT AndImageFilter :
00063     public
00064 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage, 
00065                          Functor::AND< 
00066   typename TInputImage1::PixelType, 
00067   typename TInputImage2::PixelType,
00068   typename TOutputImage::PixelType>   >
00069 
00070 
00071 {
00072 public:
00074   typedef AndImageFilter  Self;
00075   typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage, 
00076                                    Functor::AND< 
00077     typename TInputImage1::PixelType, 
00078     typename TInputImage2::PixelType,
00079     typename TOutputImage::PixelType>   
00080   >  Superclass;
00081   typedef SmartPointer<Self>   Pointer;
00082   typedef SmartPointer<const Self>  ConstPointer;
00083 
00085   itkNewMacro(Self);
00086   
00087 protected:
00088   AndImageFilter() {}
00089   virtual ~AndImageFilter() {}
00090 
00091 private:
00092   AndImageFilter(const Self&); //purposely not implemented
00093   void operator=(const Self&); //purposely not implemented
00094 
00095 };
00096 
00097 } // end namespace itk
00098 
00099 
00100 #endif

Generated at Wed May 24 22:45:39 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000