00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkNaryFunctorImageFilter_h
00018 #define __itkNaryFunctorImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImageIterator.h"
00022
00023 namespace itk
00024 {
00025
00039 template <class TInputImage, class TOutputImage, class TFunction >
00040 class ITK_EXPORT NaryFunctorImageFilter :
00041 public ImageToImageFilter<TInputImage,TOutputImage>
00042
00043 {
00044 public:
00046 typedef NaryFunctorImageFilter Self;
00047 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00048 typedef SmartPointer<Self> Pointer;
00049 typedef SmartPointer<const Self> ConstPointer;
00050
00052 itkNewMacro(Self);
00053
00055 itkTypeMacro(NaryFunctorImageFilter, ImageToImageFilter);
00056
00058 typedef TFunction FunctorType;
00059 typedef TInputImage InputImageType;
00060 typedef typename InputImageType::Pointer InputImagePointer;
00061 typedef typename InputImageType::RegionType InputImageRegionType;
00062 typedef typename InputImageType::PixelType InputImagePixelType;
00063 typedef TOutputImage OutputImageType;
00064 typedef typename OutputImageType::Pointer OutputImagePointer;
00065 typedef typename OutputImageType::RegionType OutputImageRegionType;
00066 typedef typename OutputImageType::PixelType OutputImagePixelType;
00067
00068
00073 FunctorType& GetFunctor() { return m_Functor; };
00074
00081 void SetFunctor(FunctorType& functor)
00082 {
00083 if ( m_Functor != functor )
00084 {
00085 m_Functor = functor;
00086 this->Modified();
00087 }
00088 }
00089
00090 protected:
00091 NaryFunctorImageFilter();
00092 virtual ~NaryFunctorImageFilter() {};
00093
00104 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00105 int threadId );
00106
00107 private:
00108 NaryFunctorImageFilter(const Self&);
00109 void operator=(const Self&);
00110
00111 FunctorType m_Functor;
00112 };
00113
00114 }
00115
00116 #ifndef ITK_MANUAL_INSTANTIATION
00117 #include "itkNaryFunctorImageFilter.txx"
00118 #endif
00119
00120 #endif