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 "itkInPlaceImageFilter.h"
00021 #include "itkImageIterator.h"
00022 #include "itkArray.h"
00023
00024 namespace itk
00025 {
00026
00040 template <class TInputImage, class TOutputImage, class TFunction >
00041 class ITK_EXPORT NaryFunctorImageFilter :
00042 public InPlaceImageFilter<TInputImage,TOutputImage>
00043
00044 {
00045 public:
00047 typedef NaryFunctorImageFilter Self;
00048 typedef InPlaceImageFilter<TInputImage,TOutputImage> Superclass;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00052 itkNewMacro(Self);
00053
00055 itkTypeMacro(NaryFunctorImageFilter, InPlaceImageFilter);
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 typedef Array< InputImagePixelType > NaryArrayType;
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