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:
00053
typedef VectorMeanImageFunction
Self;
00054 typedef ImageFunction<TInputImage,
00055
FixedArray<
00056
ITK_TYPENAME NumericTraits<typename TInputImage::PixelType::ValueType>::RealType,
00057 ::itk::GetVectorDimension<typename TInputImage::PixelType>::VectorDimension >,
00058 TCoordRep >
Superclass;
00059 typedef SmartPointer<Self> Pointer;
00060 typedef SmartPointer<const Self> ConstPointer;
00061
00063
itkTypeMacro(VectorMeanImageFunction,
ImageFunction);
00064
00066
itkNewMacro(
Self);
00067
00069
typedef TInputImage
InputImageType;
00070
00072
typedef typename Superclass::OutputType
OutputType;
00073
00075
typedef typename Superclass::IndexType
IndexType;
00076
00078
typedef typename Superclass::ContinuousIndexType
ContinuousIndexType;
00079
00081
typedef typename Superclass::PointType
PointType;
00082
00084
itkStaticConstMacro(ImageDimension,
unsigned int,
00085 InputImageType::ImageDimension);
00086
00088
typedef FixedArray<
00089
typename NumericTraits<typename InputImageType::PixelType::ValueType>::RealType,
00090 ::itk::GetVectorDimension<typename TInputImage::PixelType>::VectorDimension >
00091
RealType;
00092
00094
virtual RealType EvaluateAtIndex(
const IndexType& index )
const;
00095
00097
virtual RealType Evaluate(
const PointType& point )
const
00098 {
00099
IndexType index;
00100 this->ConvertPointToNearestIndex( point, index );
00101
return this->EvaluateAtIndex( index );
00102 }
00103
virtual RealType EvaluateAtContinuousIndex(
00104 const ContinuousIndexType& cindex )
const
00105
{
00106
IndexType index;
00107 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00108
return this->EvaluateAtIndex( index ) ;
00109 }
00110
00113
itkSetMacro( NeighborhoodRadius,
unsigned int );
00114
itkGetConstReferenceMacro( NeighborhoodRadius,
unsigned int );
00115
00116
protected:
00117 VectorMeanImageFunction();
00118 ~VectorMeanImageFunction(){};
00119
void PrintSelf(std::ostream& os, Indent indent)
const;
00120
00121 private:
00122 VectorMeanImageFunction(
const Self& );
00123
void operator=(
const Self& );
00124
00125
unsigned int m_NeighborhoodRadius;
00126
00127 };
00128
00129 }
00130
00131
#ifndef ITK_MANUAL_INSTANTIATION
00132
#include "itkVectorMeanImageFunction.txx"
00133
#endif
00134
00135
#endif
00136