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

itkBoundedReciprocalImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkBoundedReciprocalImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/03/13 15:54:34 $
00007   Version:   $Revision: 1.4 $
00008 
00009   Copyright (c) 2002 Insight 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 __itkBoundedReciprocalImageFilter_h
00018 #define __itkBoundedReciprocalImageFilter_h
00019 
00020 #include "itkUnaryFunctorImageFilter.h"
00021 
00022 namespace itk
00023 {
00024   
00033 namespace Functor {  
00034   
00035 template< class TInput, class TOutput>
00036 class BoundedReciprocal
00037 {
00038 public:
00039   BoundedReciprocal() {};
00040   ~BoundedReciprocal() {};
00041   bool operator!=( const BoundedReciprocal & ) const
00042   {
00043     return false;
00044   }
00045   bool operator==( const BoundedReciprocal & other ) const
00046   {
00047     return !(*this != other);
00048   }
00049   inline TOutput operator()( const TInput & A )
00050   {
00051     return static_cast<TOutput>( 1.0 / ( 1.0 +  static_cast<double>(A) ) );
00052   }
00053 };
00054 }
00055 
00056 template <class TInputImage, class TOutputImage>
00057 class ITK_EXPORT BoundedReciprocalImageFilter :
00058     public
00059 UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00060                         Functor::BoundedReciprocal< 
00061   typename TInputImage::PixelType, 
00062   typename TOutputImage::PixelType> >
00063 {
00064 public:
00066   typedef BoundedReciprocalImageFilter  Self;
00067   typedef UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00068                                   Functor::BoundedReciprocal< 
00069     typename TInputImage::PixelType, 
00070     typename TOutputImage::PixelType>   
00071   >  Superclass;
00072   typedef SmartPointer<Self>   Pointer;
00073   typedef SmartPointer<const Self>  ConstPointer;
00074 
00076   itkNewMacro(Self);
00077 
00078 #ifdef ITK_USE_CONCEPT_CHECKING
00079 
00080   itkConceptMacro(InputConvertibleToDoubleCheck,
00081     (Concept::Convertible<typename TInputImage::PixelType, double>));
00082   itkConceptMacro(DoubleConvertibleToOutputCheck,
00083     (Concept::Convertible<double, typename TOutputImage::PixelType>));
00084 
00086 #endif
00087 
00088 protected:
00089   BoundedReciprocalImageFilter() {}
00090   virtual ~BoundedReciprocalImageFilter() {}
00091 
00092 private:
00093   BoundedReciprocalImageFilter(const Self&); //purposely not implemented
00094   void operator=(const Self&); //purposely not implemented
00095 
00096 };
00097 
00098 
00099 } // end namespace itk
00100 
00101 
00102 #endif
00103 

Generated at Fri Sep 8 02:46:20 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000