00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkVectorCurvatureNDAnisotropicDiffusionFunction_h_
00018 #define __itkVectorCurvatureNDAnisotropicDiffusionFunction_h_
00019
00020 #include "itkVectorAnisotropicDiffusionFunction.h"
00021 #include "itkNeighborhoodAlgorithm.h"
00022 #include "itkVectorNeighborhoodInnerProduct.h"
00023 #include "itkDerivativeOperator.h"
00024
00025 namespace itk {
00026
00034 template <class TImage>
00035 class VectorCurvatureNDAnisotropicDiffusionFunction :
00036 public VectorAnisotropicDiffusionFunction<TImage>
00037 {
00038 public:
00040 typedef VectorCurvatureNDAnisotropicDiffusionFunction Self;
00041 typedef VectorAnisotropicDiffusionFunction<TImage> Superclass;
00042 typedef SmartPointer<Self> Pointer;
00043 typedef SmartPointer<const Self> ConstPointer;
00044
00046 itkNewMacro(Self);
00047
00049 itkTypeMacro( VectorCurvatureNDAnisotropicDiffusionFunction,
00050 VectorAnisotropicDiffusionFunction );
00051
00053 typedef typename Superclass::ImageType ImageType;
00054 typedef typename Superclass::PixelType PixelType;
00055 typedef typename Superclass::TimeStepType TimeStepType;
00056 typedef typename Superclass::RadiusType RadiusType;
00057 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00058 typedef typename Superclass::BoundaryNeighborhoodType
00059 BoundaryNeighborhoodType;
00060 typedef typename Superclass::FloatOffsetType FloatOffsetType;
00061 typedef typename PixelType::ValueType ScalarValueType;
00062
00064 itkStaticConstMacro(ImageDimension, unsigned int,
00065 Superclass::ImageDimension);
00066 itkStaticConstMacro(VectorDimension, unsigned int,
00067 Superclass::VectorDimension);
00068
00070 virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00071 void *globalData,
00072 const FloatOffsetType& offset = m_ZeroOffset
00073 ) const;
00074 virtual PixelType ComputeUpdate(const BoundaryNeighborhoodType
00075 &neighborhood, void *globalData,
00076 const FloatOffsetType& offset = m_ZeroOffset
00077 ) const;
00078
00080 virtual void InitializeIteration()
00081 {
00082 m_K = this->GetAverageGradientMagnitudeSquared() *
00083 this->GetConductanceParameter() * -1.0f;
00084 }
00085
00086 protected:
00087 VectorCurvatureNDAnisotropicDiffusionFunction();
00088 ~VectorCurvatureNDAnisotropicDiffusionFunction() {}
00089 void PrintSelf(std::ostream& os, Indent indent) const
00090 { Superclass::PrintSelf(os,indent); }
00091
00092 private:
00093 VectorCurvatureNDAnisotropicDiffusionFunction(const Self&);
00094 void operator=(const Self&);
00095
00097 VectorNeighborhoodInnerProduct<ImageType> m_InnerProduct;
00098
00100 SmartVectorNeighborhoodInnerProduct<ImageType> m_SmartInnerProduct;
00101
00103 std::slice x_slice[ImageDimension];
00104 std::slice xa_slice[ImageDimension][ImageDimension];
00105 std::slice xd_slice[ImageDimension][ImageDimension];
00106
00108 DerivativeOperator<ScalarValueType, itkGetStaticConstMacro(ImageDimension)> dx_op;
00109
00111 double m_K;
00112
00116 static double m_MIN_NORM;
00117
00121 unsigned long m_Center;
00122 unsigned long m_Stride[ImageDimension];
00123 };
00124
00125 }
00126
00127 #ifndef ITK_MANUAL_INSTANTIATION
00128 #include "itkVectorCurvatureNDAnisotropicDiffusionFunction.txx"
00129 #endif
00130
00131 #endif