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

itkLevelSetFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLevelSetFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/12/17 17:50:35 $
00007   Version:   $Revision: 1.5 $
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 __itkLevelSetFunction_h_
00018 #define __itkLevelSetFunction_h_
00019 
00020 #include "itkLevelSetFunctionBase.h"
00021 
00022 namespace itk {
00023 
00062 template <class TImageType>
00063 class ITK_EXPORT LevelSetFunction
00064   : public LevelSetFunctionBase<TImageType>
00065 {
00066 public:
00068   typedef LevelSetFunction Self;
00069   typedef LevelSetFunctionBase<TImageType> Superclass;
00070   typedef SmartPointer<Self> Pointer;
00071   typedef SmartPointer<const Self> ConstPointer;
00072 
00074   itkNewMacro(Self);
00075 
00077   itkTypeMacro( LevelSetFunction, LevelSetFunctionBase );
00078 
00080   typedef typename Superclass::ImageType ImageType;
00081 
00083   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00084 
00086   typedef typename Superclass::PixelType        PixelType;
00087   typedef typename Superclass::TimeStepType     TimeStepType;
00088   typedef typename Superclass::ScalarValueType  ScalarValueType;
00089   typedef typename Superclass::RadiusType       RadiusType;
00090   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00091   typedef typename Superclass::VectorType VectorType;
00092   typedef typename Superclass::FloatOffsetType FloatOffsetType;
00093 
00095   virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00096                                   void *globalData,
00097                                   const FloatOffsetType& = FloatOffsetType(0.0)) const;
00098 
00105   virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const;
00106 
00112   virtual void *GetGlobalDataPointer() const
00113     {
00114       GlobalDataStruct *ans = new GlobalDataStruct();
00115       ans->m_MaxAdvectionChange   = NumericTraits<ScalarValueType>::Zero;
00116       ans->m_MaxPropagationChange = NumericTraits<ScalarValueType>::Zero;
00117       return ans; 
00118     }
00119 
00123   virtual void Initialize(const RadiusType &r);
00124   
00129   virtual void ReleaseGlobalDataPointer(void *GlobalData) const
00130     { delete (GlobalDataStruct *) GlobalData; }
00131 
00132 protected:
00135   struct GlobalDataStruct
00136   {
00137     ScalarValueType m_MaxAdvectionChange;
00138     ScalarValueType m_MaxPropagationChange;
00139   };
00140   
00141   LevelSetFunction() {}
00142   ~LevelSetFunction() {}
00143   void PrintSelf(std::ostream& os, Indent indent) const
00144     {
00145       Superclass::PrintSelf(os, indent );
00146       os << indent << "WaveDT: " << m_WaveDT << std::endl;
00147       os << indent << "DT: " << m_DT << std::endl;
00148     }
00149   
00151   static double m_WaveDT;
00152   static double m_DT;
00153 
00154 private:
00155   LevelSetFunction(const Self&); //purposely not implemented
00156   void operator=(const Self&);   //purposely not implemented
00157 
00159   std::slice  x_slice[ImageDimension];
00160 
00162   ::size_t m_Center;
00163 
00165   ::size_t m_xStride[ImageDimension];
00166 };
00167 
00168 } // namespace itk
00169 
00170 #ifndef ITK_MANUAL_INSTANTIATION
00171 #include "itkLevelSetFunction.txx"
00172 #endif
00173 
00174 #endif
00175 

Generated at Fri May 21 01:15:00 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000