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/09/26 12:05:05 $
00007   Version:   $Revision: 1.5 $
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   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkBoundedReciprocalImageFilter_h
00021 #define __itkBoundedReciprocalImageFilter_h
00022 
00023 #include "itkUnaryFunctorImageFilter.h"
00024 
00025 namespace itk
00026 {
00027   
00036 namespace Functor {  
00037   
00038 template< class TInput, class TOutput>
00039 class BoundedReciprocal
00040 {
00041 public:
00042   BoundedReciprocal() {};
00043   ~BoundedReciprocal() {};
00044   bool operator!=( const BoundedReciprocal & ) const
00045   {
00046     return false;
00047   }
00048   bool operator==( const BoundedReciprocal & other ) const
00049   {
00050     return !(*this != other);
00051   }
00052   inline TOutput operator()( const TInput & A )
00053   {
00054     return static_cast<TOutput>( 1.0 / ( 1.0 +  static_cast<double>(A) ) );
00055   }
00056 };
00057 }
00058 
00059 template <class TInputImage, class TOutputImage>
00060 class ITK_EXPORT BoundedReciprocalImageFilter :
00061     public
00062 UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00063                         Functor::BoundedReciprocal< 
00064   typename TInputImage::PixelType, 
00065   typename TOutputImage::PixelType> >
00066 {
00067 public:
00069   typedef BoundedReciprocalImageFilter  Self;
00070   typedef UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00071                                   Functor::BoundedReciprocal< 
00072     typename TInputImage::PixelType, 
00073     typename TOutputImage::PixelType>   
00074   >  Superclass;
00075   typedef SmartPointer<Self>   Pointer;
00076   typedef SmartPointer<const Self>  ConstPointer;
00077 
00079   itkNewMacro(Self);
00080 
00081 #ifdef ITK_USE_CONCEPT_CHECKING
00082 
00083   itkConceptMacro(InputConvertibleToDoubleCheck,
00084     (Concept::Convertible<typename TInputImage::PixelType, double>));
00085   itkConceptMacro(DoubleConvertibleToOutputCheck,
00086     (Concept::Convertible<double, typename TOutputImage::PixelType>));
00087 
00089 #endif
00090 
00091 protected:
00092   BoundedReciprocalImageFilter() {}
00093   virtual ~BoundedReciprocalImageFilter() {}
00094 
00095 private:
00096   BoundedReciprocalImageFilter(const Self&); //purposely not implemented
00097   void operator=(const Self&); //purposely not implemented
00098 
00099 };
00100 
00101 
00102 } // end namespace itk
00103 
00104 
00105 #endif
00106 

Generated at Sun Sep 23 12:03:11 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000