00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkCosImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/01/15 19:35:58 $ 00007 Version: $Revision: 1.15 $ 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 __itkCosImageFilter_h 00018 #define __itkCosImageFilter_h 00019 00020 #include "itkUnaryFunctorImageFilter.h" 00021 #include "vnl/vnl_math.h" 00022 00023 namespace itk 00024 { 00025 00044 namespace Functor { 00045 00046 template< class TInput, class TOutput> 00047 class Cos 00048 { 00049 public: 00050 Cos() {}; 00051 ~Cos() {}; 00052 inline TOutput operator()( const TInput & A ) 00053 { 00054 return static_cast<TOutput>(cos( static_cast<double>(A)) ); 00055 } 00056 }; 00057 00058 } 00059 template <class TInputImage, class TOutputImage> 00060 class ITK_EXPORT CosImageFilter : 00061 public 00062 UnaryFunctorImageFilter<TInputImage,TOutputImage, 00063 Functor::Cos< 00064 typename TInputImage::PixelType, 00065 typename TOutputImage::PixelType> > 00066 { 00067 public: 00069 typedef CosImageFilter Self; 00070 typedef UnaryFunctorImageFilter<TInputImage,TOutputImage, 00071 Functor::Cos< typename TInputImage::PixelType, 00072 typename TOutputImage::PixelType> > Superclass; 00073 typedef SmartPointer<Self> Pointer; 00074 typedef SmartPointer<const Self> ConstPointer; 00075 00077 itkNewMacro(Self); 00078 00079 protected: 00080 CosImageFilter() {} 00081 virtual ~CosImageFilter() {} 00082 00083 private: 00084 CosImageFilter(const Self&); //purposely not implemented 00085 void operator=(const Self&); //purposely not implemented 00086 00087 }; 00088 00089 } // end namespace itk 00090 00091 00092 #endif