00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freVectorToNormImageFilter_h
00023 #define __freVectorToNormImageFilter_h
00024
00025 #include "itkUnaryFunctorImageFilter.h"
00026
00027 namespace FREE
00028 {
00029
00035 namespace Functor
00036 {
00037
00038 template< class TInput, class TOutput>
00039 class VectorToNormFunctor
00040 {
00041 public:
00042 VectorToNormFunctor() {};
00043 ~VectorToNormFunctor() {};
00044 inline TOutput operator()( const TInput & a)
00045 {
00046 TOutput output = a.GetNorm();
00047 return output;
00048 }
00049 };
00050 }
00051
00052 template <class TInputImage, class TOutputImage>
00053 class ITK_EXPORT VectorToNormImageFilter : public
00054 itk::UnaryFunctorImageFilter<TInputImage,TOutputImage,
00055 Functor::VectorToNormFunctor<
00056 typename TInputImage::PixelType,
00057 typename TOutputImage::PixelType> >
00058 {
00059 public:
00061 typedef VectorToNormImageFilter Self;
00062 typedef itk::UnaryFunctorImageFilter<TInputImage,TOutputImage,
00063 Functor::VectorToNormFunctor<
00064 typename TInputImage::PixelType,
00065 typename TOutputImage::PixelType>
00066 > Superclass;
00067
00068 typedef itk::SmartPointer<Self> Pointer;
00069 typedef itk::SmartPointer<const Self> ConstPointer;
00070
00072 itkNewMacro(Self);
00073
00074 protected:
00075 VectorToNormImageFilter() {}
00076 virtual ~VectorToNormImageFilter() {}
00077
00078 private:
00079 VectorToNormImageFilter(const Self&);
00080 void operator=(const Self&);
00081
00082 };
00083
00084 }
00085
00086
00087 #endif