00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 bool operator!=( const Cos & ) const
00053 {
00054 return false;
00055 }
00056 bool operator==( const Cos & other ) const
00057 {
00058 return !(*this != other);
00059 }
00060 inline TOutput operator()( const TInput & A )
00061 {
00062 return static_cast<TOutput>(cos( static_cast<double>(A)) );
00063 }
00064 };
00065
00066 }
00067 template <class TInputImage, class TOutputImage>
00068 class ITK_EXPORT CosImageFilter :
00069 public
00070 UnaryFunctorImageFilter<TInputImage,TOutputImage,
00071 Functor::Cos<
00072 typename TInputImage::PixelType,
00073 typename TOutputImage::PixelType> >
00074 {
00075 public:
00077 typedef CosImageFilter Self;
00078 typedef UnaryFunctorImageFilter<TInputImage,TOutputImage,
00079 Functor::Cos< typename TInputImage::PixelType,
00080 typename TOutputImage::PixelType> > Superclass;
00081 typedef SmartPointer<Self> Pointer;
00082 typedef SmartPointer<const Self> ConstPointer;
00083
00085 itkNewMacro(Self);
00086
00088 itkTypeMacro(CosImageFilter,
00089 UnaryFunctorImageFilter);
00090
00091 #ifdef ITK_USE_CONCEPT_CHECKING
00092
00093 itkConceptMacro(InputConvertibleToDoubleCheck,
00094 (Concept::Convertible<typename TInputImage::PixelType, double>));
00095 itkConceptMacro(DoubleConvertibleToOutputCheck,
00096 (Concept::Convertible<double, typename TOutputImage::PixelType>));
00097
00099 #endif
00100
00101 protected:
00102 CosImageFilter() {}
00103 virtual ~CosImageFilter() {}
00104
00105 private:
00106 CosImageFilter(const Self&);
00107 void operator=(const Self&);
00108
00109 };
00110
00111 }
00112
00113
00114 #endif
00115