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/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 __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::BoundaryNeighborhoodType
00092                    BoundaryNeighborhoodType;
00093   typedef typename Superclass::VectorType VectorType;
00094   typedef typename Superclass::FloatOffsetType FloatOffsetType;
00095 
00097   virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00098                                   void *globalData,
00099                                   const FloatOffsetType& = m_ZeroOffset) const;
00100   virtual PixelType ComputeUpdate(const BoundaryNeighborhoodType
00101                                   &neighborhood, void * globalData,
00102                                   const FloatOffsetType& = m_ZeroOffset) const;
00103 
00110   virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const;
00111 
00117   virtual void *GetGlobalDataPointer() const
00118     {
00119       GlobalDataStruct *ans = new GlobalDataStruct();
00120       ans->m_MaxAdvectionChange   = NumericTraits<ScalarValueType>::Zero;
00121       ans->m_MaxPropagationChange = NumericTraits<ScalarValueType>::Zero;
00122       return ans; 
00123     }
00124 
00128   virtual void Initialize(const RadiusType &r);
00129   
00134   virtual void ReleaseGlobalDataPointer(void *GlobalData) const
00135     { delete (GlobalDataStruct *) GlobalData; }
00136 
00137 protected:
00140   struct GlobalDataStruct
00141   {
00142     ScalarValueType m_MaxAdvectionChange;
00143     ScalarValueType m_MaxPropagationChange;
00144   };
00145   
00146   LevelSetFunction() {}
00147   ~LevelSetFunction() {}
00148   void PrintSelf(std::ostream& os, Indent indent) const
00149     {
00150       Superclass::PrintSelf(os, indent );
00151       os << indent << "WaveDT: " << m_WaveDT << std::endl;
00152       os << indent << "DT: " << m_DT << std::endl;
00153     }
00154   
00156   static double m_WaveDT;
00157   static double m_DT;
00158 
00159 private:
00160   LevelSetFunction(const Self&); //purposely not implemented
00161   void operator=(const Self&);   //purposely not implemented
00162 
00164   std::slice  x_slice[ImageDimension];
00165 
00167   ::size_t m_Center;
00168 
00170   ::size_t m_xStride[ImageDimension];
00171 };
00172 
00173 } // namespace itk
00174 
00175 #ifndef ITK_MANUAL_INSTANTIATION
00176 #include "itkLevelSetFunction.txx"
00177 #endif
00178 
00179 #endif
00180 

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