Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkGradientNDAnisotropicDiffusionFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGradientNDAnisotropicDiffusionFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/30 15:24:40 $
00007   Version:   $Revision: 1.8 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkGradientNDAnisotropicDiffusionFunction_h_
00018 #define __itkGradientNDAnisotropicDiffusionFunction_h_
00019 
00020 #include "itkScalarAnisotropicDiffusionFunction.h"
00021 #include "itkNeighborhoodAlgorithm.h"
00022 #include "itkNeighborhoodInnerProduct.h"
00023 #include "itkDerivativeOperator.h"
00024 
00025 namespace itk {
00026 
00058 template <class TImage>
00059 class GradientNDAnisotropicDiffusionFunction :
00060     public ScalarAnisotropicDiffusionFunction<TImage>
00061 {
00062 public:
00064   typedef GradientNDAnisotropicDiffusionFunction Self;
00065   typedef ScalarAnisotropicDiffusionFunction<TImage> Superclass;
00066   typedef SmartPointer<Self> Pointer;
00067   typedef SmartPointer<const Self> ConstPointer;
00068 
00070   itkNewMacro(Self);
00071 
00073   itkTypeMacro( GradientNDAnisotropicDiffusionFunction,
00074                 ScalarAnisotropicDiffusionFunction );
00075   
00077   typedef typename Superclass::ImageType        ImageType;
00078   typedef typename Superclass::PixelType        PixelType;
00079   typedef typename Superclass::TimeStepType     TimeStepType;
00080   typedef typename Superclass::RadiusType       RadiusType;
00081   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00082   typedef typename Superclass::BoundaryNeighborhoodType
00083                    BoundaryNeighborhoodType;
00084   typedef typename Superclass::FloatOffsetType  FloatOffsetType;
00085 
00087   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00088 
00090   virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00091                                   void *globalData,
00092                                   const FloatOffsetType& offset = m_ZeroOffset
00093                                   ) const;
00094   virtual PixelType ComputeUpdate(const BoundaryNeighborhoodType
00095                                   &neighborhood, void *globalData,
00096                                   const FloatOffsetType& offset = m_ZeroOffset
00097                                   ) const;
00098 
00100   virtual void InitializeIteration()
00101     {
00102       m_K = static_cast<PixelType>(this->GetAverageGradientMagnitudeSquared() *
00103                                    this->GetConductanceParameter() * -1.0f);
00104     }
00105   
00106 protected:
00107   GradientNDAnisotropicDiffusionFunction();
00108   ~GradientNDAnisotropicDiffusionFunction() {}
00109 
00110   void PrintSelf(std::ostream& os, Indent indent) const
00111     {      Superclass::PrintSelf(os,indent);    }
00112   
00114   NeighborhoodInnerProduct<ImageType> m_InnerProduct;
00115 
00117   SmartNeighborhoodInnerProduct<ImageType> m_SmartInnerProduct;
00118 
00120   std::slice  x_slice[ImageDimension];
00121   std::slice xa_slice[ImageDimension][ImageDimension];
00122   std::slice xd_slice[ImageDimension][ImageDimension];
00123 
00125   DerivativeOperator<PixelType, itkGetStaticConstMacro(ImageDimension)> dx_op;
00126 
00128   PixelType m_K;
00129 
00130   unsigned long m_Center;
00131   unsigned long m_Stride[ImageDimension];
00132 
00133   static double m_MIN_NORM;
00134   
00135 private:
00136   GradientNDAnisotropicDiffusionFunction(const Self&); //purposely not implemented
00137   void operator=(const Self&); //purposely not implemented
00138 
00139 };
00140   
00141 }// end namespace itk
00142 
00143 #ifndef ITK_MANUAL_INSTANTIATION
00144 #include "itkGradientNDAnisotropicDiffusionFunction.txx"
00145 #endif
00146 
00147 #endif

Generated at Wed Mar 12 01:12:58 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000