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

itkAbsImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAbsImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/11/05 17:54:23 $
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 __itkAbsImageFilter_h
00018 #define __itkAbsImageFilter_h
00019 
00020 #include "itkUnaryFunctorImageFilter.h"
00021 
00022 namespace itk
00023 {
00024   
00030 namespace Function {  
00031   
00032 template< class TInput, class TOutput>
00033 class Abs
00034 {
00035 public:
00036   Abs() {}
00037   ~Abs() {}
00038   inline TOutput operator()( const TInput & A )
00039   { return (TOutput)( ( A > 0 ) ? A : -A ); }
00040 }; 
00041 }
00042 
00043 template <class TInputImage, class TOutputImage>
00044 class ITK_EXPORT AbsImageFilter :
00045     public
00046 UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00047                         Function::Abs< 
00048   typename TInputImage::PixelType, 
00049   typename TOutputImage::PixelType>   >
00050 {
00051 public:
00053   typedef AbsImageFilter  Self;
00054   typedef UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00055                                   Function::Abs< typename TInputImage::PixelType, 
00056                                                  typename TOutputImage::PixelType> >  Superclass;
00057   typedef SmartPointer<Self>   Pointer;
00058   typedef SmartPointer<const Self>  ConstPointer;
00059 
00061   itkNewMacro(Self);
00062   
00063 protected:
00064   AbsImageFilter() {}
00065   virtual ~AbsImageFilter() {}
00066 
00067 private:
00068   AbsImageFilter(const Self&); //purposely not implemented
00069   void operator=(const Self&); //purposely not implemented
00070 
00071 };
00072 
00073 } // end namespace itk
00074 
00075 
00076 #endif

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