itkNaryFunctorImageFilter.h
Go to the documentation of this file.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;
00051
00053 itkNewMacro(Self);
00054
00056 itkTypeMacro(NaryFunctorImageFilter, InPlaceImageFilter);
00057
00059 typedef TFunction FunctorType;
00060 typedef TInputImage InputImageType;
00061 typedef typename InputImageType::Pointer InputImagePointer;
00062 typedef typename InputImageType::RegionType InputImageRegionType;
00063 typedef typename InputImageType::PixelType InputImagePixelType;
00064 typedef TOutputImage OutputImageType;
00065 typedef typename OutputImageType::Pointer OutputImagePointer;
00066 typedef typename OutputImageType::RegionType OutputImageRegionType;
00067 typedef typename OutputImageType::PixelType OutputImagePixelType;
00068 typedef std::vector< InputImagePixelType > NaryArrayType;
00069
00074 FunctorType& GetFunctor() { return m_Functor; };
00075
00082 void SetFunctor(FunctorType& functor)
00083 {
00084 if ( m_Functor != functor )
00085 {
00086 m_Functor = functor;
00087 this->Modified();
00088 }
00089 }
00091
00093 itkStaticConstMacro(
00094 InputImageDimension, unsigned int, TInputImage::ImageDimension);
00095 itkStaticConstMacro(
00096 OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
00098
00099 #ifdef ITK_USE_CONCEPT_CHECKING
00100
00101 itkConceptMacro(SameDimensionCheck,
00102 (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00103 itkConceptMacro(OutputHasZeroCheck,
00104 (Concept::HasZero<OutputImagePixelType>));
00105
00107 #endif
00108
00109 protected:
00110 NaryFunctorImageFilter();
00111 virtual ~NaryFunctorImageFilter() {};
00112
00123 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00124 int threadId );
00125
00126 private:
00127 NaryFunctorImageFilter(const Self&);
00128 void operator=(const Self&);
00129
00130 FunctorType m_Functor;
00131 };
00132
00133 }
00134
00135 #ifndef ITK_MANUAL_INSTANTIATION
00136 #include "itkNaryFunctorImageFilter.txx"
00137 #endif
00138
00139 #endif
00140