00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkNeighborhoodOperatorImageFunction_h
00018 #define __itkNeighborhoodOperatorImageFunction_h
00019
00020 #include "itkImageFunction.h"
00021 #include "itkNeighborhood.h"
00022
00023 namespace itk
00024 {
00025
00035 template <class TInputImage,class TOutput>
00036 class ITK_EXPORT NeighborhoodOperatorImageFunction :
00037 public ImageFunction< TInputImage, TOutput >
00038 {
00039 public:
00040
00042 typedef NeighborhoodOperatorImageFunction Self;
00043
00045 typedef ImageFunction<TInputImage, TOutput> Superclass;
00046
00048 typedef SmartPointer<Self> Pointer;
00049 typedef SmartPointer<const Self> ConstPointer;
00050
00052 itkNewMacro(Self);
00053
00055 typedef TInputImage InputImageType;
00056 typedef typename InputImageType::PixelType InputPixelType;
00057 typedef typename Superclass::IndexType IndexType;
00058 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00059
00061 itkTypeMacro( NeighborhoodOperatorImageFunction, ImageFunction );
00062
00063
00065 itkStaticConstMacro(ImageDimension, unsigned int,
00066 InputImageType::ImageDimension);
00067
00068 typedef Neighborhood<TOutput, itkGetStaticConstMacro(ImageDimension)> NeighborhoodType;
00069
00071 typedef typename Superclass::PointType PointType;
00072
00074
00075
00079 void SetOperator(const NeighborhoodType &p) const
00080 {
00081 m_Operator = p;
00082 this->Modified();
00083 }
00085
00088 virtual TOutput Evaluate(const PointType& ) const
00089 {
00090 std::cout << "NeighborhoodOperatorImageFunction::Evaluate(): Not implemented!" << std::endl;
00091 TOutput out;
00092 out = 0;
00093 return out;
00094 }
00095
00097 virtual TOutput EvaluateAtIndex( const IndexType & index ) const;
00098
00101 virtual TOutput EvaluateAtContinuousIndex(
00102 const ContinuousIndexType & ) const
00103 {
00104 std::cout << "NeighborhoodOperatorImageFunction::EvaluateAtContinuousIndex():Not implemented!" << std::endl;
00105 TOutput out;
00106 out = 0;
00107 return out;
00108 }
00110
00111 protected:
00112 NeighborhoodOperatorImageFunction();
00113 NeighborhoodOperatorImageFunction( const Self& ){};
00114
00115 ~NeighborhoodOperatorImageFunction(){};
00116
00117 void operator=( const Self& ){};
00118 void PrintSelf(std::ostream& os, Indent indent) const;
00119
00120 private:
00121
00122 mutable NeighborhoodType m_Operator;
00123
00124 };
00125
00126 }
00127
00128
00129
00130 #define ITK_TEMPLATE_NeighborhoodOperatorImageFunction(_, EXPORT, x, y) namespace itk { \
00131 _(2(class EXPORT NeighborhoodOperatorImageFunction< ITK_TEMPLATE_2 x >)) \
00132 namespace Templates { typedef NeighborhoodOperatorImageFunction< ITK_TEMPLATE_2 x > \
00133 NeighborhoodOperatorImageFunction##y; } \
00134 }
00135
00136 #if ITK_TEMPLATE_EXPLICIT
00137 # include "Templates/itkNeighborhoodOperatorImageFunction+-.h"
00138 #endif
00139
00140 #if ITK_TEMPLATE_TXX
00141 # include "itkNeighborhoodOperatorImageFunction.txx"
00142 #endif
00143
00144
00145
00146
00147
00148
00149
00150 #endif
00151
00152