00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkVectorMeanImageFunction_h
00018 #define __itkVectorMeanImageFunction_h
00019
00020 #include "itkImageFunction.h"
00021 #include "itkNumericTraits.h"
00022
00023 namespace itk
00024 {
00025
00043 template <class TInputImage, class TCoordRep = float >
00044 class ITK_EXPORT VectorMeanImageFunction :
00045 public ImageFunction< TInputImage,
00046 FixedArray<
00047 ITK_TYPENAME NumericTraits<typename TInputImage::PixelType::ValueType>::RealType,
00048 ::itk::GetVectorDimension<typename TInputImage::PixelType>::VectorDimension >,
00049 TCoordRep >
00050 {
00051 public:
00052
00054 typedef VectorMeanImageFunction Self;
00055 typedef ImageFunction<TInputImage,
00056 FixedArray<
00057 ITK_TYPENAME NumericTraits<typename TInputImage::PixelType::ValueType>::RealType,
00058 ::itk::GetVectorDimension<typename TInputImage::PixelType>::VectorDimension >,
00059 TCoordRep > Superclass;
00060 typedef SmartPointer<Self> Pointer;
00061 typedef SmartPointer<const Self> ConstPointer;
00062
00064 itkTypeMacro(VectorMeanImageFunction, ImageFunction);
00065
00067 itkNewMacro(Self);
00068
00070 typedef TInputImage InputImageType;
00071
00073 typedef typename Superclass::OutputType OutputType;
00074
00076 typedef typename Superclass::IndexType IndexType;
00077
00079 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00080
00082 typedef typename Superclass::PointType PointType;
00083
00085 itkStaticConstMacro(ImageDimension, unsigned int,
00086 InputImageType::ImageDimension);
00087
00089 typedef FixedArray<
00090 typename NumericTraits<typename InputImageType::PixelType::ValueType>::RealType,
00091 ::itk::GetVectorDimension<typename TInputImage::PixelType>::VectorDimension >
00092 RealType;
00093
00095 virtual RealType EvaluateAtIndex( const IndexType& index ) const;
00096
00098 virtual RealType Evaluate( const PointType& point ) const
00099 {
00100 IndexType index;
00101 this->ConvertPointToNearestIndex( point, index );
00102 return this->EvaluateAtIndex( index );
00103 }
00104 virtual RealType EvaluateAtContinuousIndex(
00105 const ContinuousIndexType& cindex ) const
00106 {
00107 IndexType index;
00108 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00109 return this->EvaluateAtIndex( index );
00110 }
00112
00115 itkSetMacro( NeighborhoodRadius, unsigned int );
00116 itkGetConstReferenceMacro( NeighborhoodRadius, unsigned int );
00118
00119 protected:
00120 VectorMeanImageFunction();
00121 ~VectorMeanImageFunction(){};
00122 void PrintSelf(std::ostream& os, Indent indent) const;
00123
00124 private:
00125 VectorMeanImageFunction( const Self& );
00126 void operator=( const Self& );
00127
00128 unsigned int m_NeighborhoodRadius;
00129
00130 };
00131
00132 }
00133
00134
00135 #define ITK_TEMPLATE_VectorMeanImageFunction(_, EXPORT, x, y) namespace itk { \
00136 _(2(class EXPORT VectorMeanImageFunction< ITK_TEMPLATE_2 x >)) \
00137 namespace Templates { typedef VectorMeanImageFunction< ITK_TEMPLATE_2 x > \
00138 VectorMeanImageFunction##y; } \
00139 }
00140
00141 #if ITK_TEMPLATE_EXPLICIT
00142 # include "Templates/itkVectorMeanImageFunction+-.h"
00143 #endif
00144
00145 #if ITK_TEMPLATE_TXX
00146 # include "itkVectorMeanImageFunction.txx"
00147 #endif
00148
00149 #endif
00150