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

itkSquareImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSquareImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:28:57 $
00007   Version:   $Revision: 1.4 $
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 __itkSquareImageFilter_h
00018 #define __itkSquareImageFilter_h
00019 
00020 #include "itkUnaryFunctorImageFilter.h"
00021 
00022 namespace itk
00023 {
00024   
00031 namespace Function {  
00032   
00033 template< class TInput, class TOutput>
00034 class Square
00035 {
00036 public:
00037   typedef typename NumericTraits<TInput>::RealType RealType;
00038   Square() {}
00039   ~Square() {}
00040   inline TOutput operator()( const TInput & A )
00041   {
00042     const RealType ra = static_cast<RealType>( A );
00043     return static_cast<TOutput>( ra * ra );
00044   }
00045 }; 
00046 }
00047 template <class TInputImage, class TOutputImage>
00048 class ITK_EXPORT SquareImageFilter :
00049     public
00050 UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00051                         Function::Square< typename TInputImage::PixelType, 
00052                                           typename TOutputImage::PixelType>   >
00053 {
00054 public:
00056   typedef SquareImageFilter  Self;
00057   typedef UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00058                                   Function::Square< typename TInputImage::PixelType, 
00059                                                     typename TOutputImage::PixelType> >  Superclass;
00060   typedef SmartPointer<Self>   Pointer;
00061   typedef SmartPointer<const Self>  ConstPointer;
00062 
00064   itkNewMacro(Self);
00065   
00066 protected:
00067   SquareImageFilter() {}
00068   virtual ~SquareImageFilter() {}
00069 
00070 private:
00071   SquareImageFilter(const Self&); //purposely not implemented
00072   void operator=(const Self&); //purposely not implemented
00073 
00074 };
00075 
00076 } // end namespace itk
00077 
00078 
00079 #endif

Generated at Thu May 25 00:06:52 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000