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::FloatOffsetType FloatOffsetType;
00059 typedef typename PixelType::ValueType ScalarValueType;
00060
00062 itkStaticConstMacro(ImageDimension, unsigned int,
00063 Superclass::ImageDimension);
00064 itkStaticConstMacro(VectorDimension, unsigned int,
00065 Superclass::VectorDimension);
00066
00068 virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00069 void *globalData,
00070 const FloatOffsetType& offset = FloatOffsetType(0.0)
00071 ) const;
00072
00074 virtual void InitializeIteration()
00075 {
00076 m_K = this->GetAverageGradientMagnitudeSquared() *
00077 this->GetConductanceParameter() * -1.0f;
00078 }
00079
00080 protected:
00081 VectorCurvatureNDAnisotropicDiffusionFunction();
00082 ~VectorCurvatureNDAnisotropicDiffusionFunction() {}
00083 void PrintSelf(std::ostream& os, Indent indent) const
00084 { Superclass::PrintSelf(os,indent); }
00085
00086 private:
00087 VectorCurvatureNDAnisotropicDiffusionFunction(const Self&);
00088 void operator=(const Self&);
00089
00091 VectorNeighborhoodInnerProduct<ImageType> m_InnerProduct;
00092
00094 std::slice x_slice[ImageDimension];
00095 std::slice xa_slice[ImageDimension][ImageDimension];
00096 std::slice xd_slice[ImageDimension][ImageDimension];
00097
00099 DerivativeOperator<ScalarValueType, itkGetStaticConstMacro(ImageDimension)> dx_op;
00100
00102 double m_K;
00103
00107 static double m_MIN_NORM;
00108
00112 unsigned long m_Center;
00113 unsigned long m_Stride[ImageDimension];
00114 };
00115
00116 }
00117
00118 #ifndef ITK_MANUAL_INSTANTIATION
00119 #include "itkVectorCurvatureNDAnisotropicDiffusionFunction.txx"
00120 #endif
00121
00122 #endif