00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkTernaryMagnitudeImageFilter_h
00018 #define __itkTernaryMagnitudeImageFilter_h
00019
00020 #include "itkTernaryFunctorImageFilter.h"
00021
00022 namespace itk
00023 {
00024
00034 namespace Function {
00035
00036 template< class TInput1, class TInput2, class TInput3, class TOutput>
00037 class Modulus3
00038 {
00039 public:
00040 Modulus3() {}
00041 ~Modulus3() {}
00042 inline TOutput operator()( const TInput1 & A,
00043 const TInput2 & B,
00044 const TInput3 & C)
00045 { return (TOutput) sqrt( (double)(A*A + B*B + C*C) ); }
00046 bool operator != (const Modulus3&) const
00047 {
00048 return false;
00049 }
00050 };
00051 }
00052
00053 template <class TInputImage1, class TInputImage2,
00054 class TInputImage3, class TOutputImage>
00055 class ITK_EXPORT TernaryMagnitudeImageFilter :
00056 public
00057 TernaryFunctorImageFilter<TInputImage1,TInputImage2,
00058 TInputImage3,TOutputImage,
00059 Function::Modulus3<
00060 typename TInputImage1::PixelType,
00061 typename TInputImage2::PixelType,
00062 typename TInputImage3::PixelType,
00063 typename TOutputImage::PixelType> >
00064 {
00065 public:
00067 typedef TernaryMagnitudeImageFilter Self;
00068 typedef TernaryFunctorImageFilter<TInputImage1,TInputImage2,
00069 TInputImage3,TOutputImage,
00070 Function::Modulus3<
00071 typename TInputImage1::PixelType,
00072 typename TInputImage2::PixelType,
00073 typename TInputImage3::PixelType,
00074 typename TOutputImage::PixelType>
00075 > Superclass;
00076 typedef SmartPointer<Self> Pointer;
00077 typedef SmartPointer<const Self> ConstPointer;
00078
00080 itkNewMacro(Self);
00081
00082 protected:
00083 TernaryMagnitudeImageFilter() {}
00084 virtual ~TernaryMagnitudeImageFilter() {}
00085
00086 private:
00087 TernaryMagnitudeImageFilter(const Self&);
00088 void operator=(const Self&);
00089
00090
00091 };
00092
00093 }
00094
00095
00096 #endif