00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkEntropyPreservingGradientMagnitudeImageFunction_h
00018 #define _itkEntropyPreservingGradientMagnitudeImageFunction_h
00019
00020 #include "itkImageFunction.h"
00021
00022 namespace itk
00023 {
00024
00055 template < class TInputImage, class TCoordRep = float >
00056 class ITK_EXPORT EntropyPreservingGradientMagnitudeImageFunction :
00057 public ImageFunction< TInputImage, double, TCoordRep >
00058 {
00059 public:
00061 typedef EntropyPreservingGradientMagnitudeImageFunction Self;
00062 typedef ImageFunction<TInputImage, double, TCoordRep> Superclass;
00063 typedef SmartPointer<Self> Pointer;
00064 typedef SmartPointer<const Self> ConstPointer;
00065
00067 itkNewMacro(Self);
00068
00070 itkTypeMacro(EntropyPreservingGradientMagnitudeImageFunction, ImageFunction);
00071
00073 typedef TInputImage InputImageType;
00074 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00075
00077 itkStaticConstMacro(ImageDimension, unsigned int,
00078 InputImageType::ImageDimension);
00079
00081 typedef typename Superclass::IndexType IndexType;
00082
00084 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00085
00087 typedef typename Superclass::PointType PointType;
00088
00090 virtual void SetInputImage( const InputImageType * ptr );
00091
00093 void SetSpeed( double value )
00094 { m_Speed = value; }
00095
00097 double GetSpeed() const
00098 { return m_Speed; }
00099
00101 virtual double EvaluateAtIndex( const IndexType& index ) const;
00102
00104 virtual double Evaluate( const PointType& point ) const
00105 {
00106 IndexType index;
00107 this->ConvertPointToNearestIndex( point, index );
00108 return this->EvaluateAtIndex( index );
00109 }
00110
00112 virtual double EvaluateAtContinuousIndex(
00113 const ContinuousIndexType& cindex ) const
00114 {
00115 IndexType index;
00116 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00117 return this->EvaluateAtIndex( index ) ;
00118 }
00119
00121 double GetMagnitude() const
00122 { return m_Magnitude; }
00123
00124 protected:
00125 EntropyPreservingGradientMagnitudeImageFunction(){};
00126 ~EntropyPreservingGradientMagnitudeImageFunction(){};
00127 void PrintSelf(std::ostream& os, Indent indent) const;
00128
00129 private:
00130 EntropyPreservingGradientMagnitudeImageFunction ( const Self& );
00131 void operator=( const Self& );
00132
00133 signed long m_ImageSize[ImageDimension];
00134 bool m_ImageSizeOK;
00135
00136 double m_Speed;
00137 mutable double m_Magnitude;
00138
00139 mutable IndexType m_NeighIndex;
00140 mutable double m_CenterValue;
00141 mutable double m_DiffValue;
00142
00143 };
00144
00145 }
00146
00147 #ifndef ITK_MANUAL_INSTANTIATION
00148 #include "itkEntropyPreservingGradientMagnitudeImageFunction.txx"
00149 #endif
00150
00151 #endif