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

itkLevelSetFunctionBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLevelSetFunctionBase.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/30 16:37:52 $
00007   Version:   $Revision: 1.3 $
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 __itkLevelSetFunctionBase_h_
00018 #define __itkLevelSetFunctionBase_h_
00019 
00020 #include "itkFiniteDifferenceFunction.h"
00021 #include "itkVector.h"
00022 
00023 namespace itk {
00024 
00033 template <class TImageType>
00034 class LevelSetFunctionBase : public FiniteDifferenceFunction<TImageType>
00035 {
00036 public:
00038   typedef LevelSetFunctionBase Self;
00039   typedef FiniteDifferenceFunction<TImageType> Superclass;
00040   typedef SmartPointer<Self> Pointer;
00041   typedef SmartPointer<const Self> ConstPointer;
00042 
00044   itkTypeMacro( LevelSetFunctionBase,  FiniteDifferenceFunction );
00045 
00047   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00048 
00050   typedef double TimeStepType;
00051   typedef typename Superclass::ImageType  ImageType;
00052   typedef typename Superclass::PixelType  PixelType;
00053   typedef                      PixelType  ScalarValueType;
00054   typedef typename Superclass::RadiusType RadiusType;
00055   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00056   typedef typename Superclass::BoundaryNeighborhoodType
00057                                                 BoundaryNeighborhoodType;
00058   typedef typename Superclass::FloatOffsetType FloatOffsetType;
00059   
00061   typedef
00062     Vector<ScalarValueType, itkGetStaticConstMacro(ImageDimension)> VectorType;
00063 
00065   virtual VectorType AdvectionField(const NeighborhoodType &neighborhood,
00066                                     const FloatOffsetType &)  const
00067     { return m_ZeroVectorConstant; }
00068   virtual VectorType AdvectionField(const BoundaryNeighborhoodType
00069                                     &neighborhood, const FloatOffsetType &
00070                                     ) const
00071     { return m_ZeroVectorConstant; }
00072 
00075   virtual ScalarValueType PropagationSpeed(
00076     const NeighborhoodType& neighborhood,
00077     const FloatOffsetType ) const
00078     { return NumericTraits<ScalarValueType>::Zero; }
00079   virtual ScalarValueType PropagationSpeed(
00080     const BoundaryNeighborhoodType
00081     &neighborhood, const FloatOffsetType &) const
00082     { return NumericTraits<ScalarValueType>::Zero; }
00083 
00086   virtual ScalarValueType CurvatureSpeed(const NeighborhoodType
00087                                          &neighborhood, const FloatOffsetType &
00088                                          ) const
00089     { return NumericTraits<ScalarValueType>::One; }
00090 
00091   virtual ScalarValueType CurvatureSpeed(const BoundaryNeighborhoodType
00092                                          &neighborhood, const FloatOffsetType &
00093                                          ) const
00094     { return NumericTraits<ScalarValueType>::One; }
00095 
00097   void SetAdvectionWeight(const ScalarValueType a)
00098     { m_AdvectionWeight = a; }
00099   ScalarValueType GetAdvectionWeight() const
00100     { return m_AdvectionWeight; }
00101   
00103   void SetPropagationWeight(const ScalarValueType p)
00104     { m_PropagationWeight = p; }
00105   ScalarValueType GetPropagationWeight() const
00106     { return m_PropagationWeight; }
00107   
00109   void SetCurvatureWeight(const ScalarValueType c)
00110     { m_CurvatureWeight = c; }
00111   ScalarValueType GetCurvatureWeight() const
00112     { return m_CurvatureWeight; }
00113   
00115   void SetEpsilonMagnitude(const ScalarValueType e)
00116     { m_EpsilonMagnitude = e; }
00117   ScalarValueType GetEpsilonMagnitude() const
00118     { return m_EpsilonMagnitude; }
00119 
00120   virtual void Initialize(const RadiusType &r) =0;
00121 
00122 protected:
00123   LevelSetFunctionBase()
00124     {
00125       m_EpsilonMagnitude = 1.0e-5;
00126       m_AdvectionWeight = m_PropagationWeight = m_CurvatureWeight =
00127         NumericTraits<ScalarValueType>::Zero;
00128     }
00129   ~LevelSetFunctionBase() {}
00130 
00131   void PrintSelf(std::ostream& os, Indent indent) const;
00132 
00135   static VectorType InitializeZeroVectorConstant();
00136   
00138   static VectorType m_ZeroVectorConstant;
00139 
00141   ScalarValueType m_EpsilonMagnitude;
00142   
00144   ScalarValueType m_AdvectionWeight;
00145 
00147   ScalarValueType m_PropagationWeight;
00148 
00150   ScalarValueType m_CurvatureWeight;
00151 
00152 private:
00153   LevelSetFunctionBase(const Self&); //purposely not implemented
00154   void operator=(const Self&); //purposely not implemented
00155 };
00156 
00157 } // namespace itk
00158 
00159 #ifndef ITK_MANUAL_INSTANTIATION
00160 #include "itkLevelSetFunctionBase.txx"
00161 #endif
00162 
00163 #endif
00164 
00165 
00166 
00167 

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