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

itkShapePriorSegmentationLevelSetFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkShapePriorSegmentationLevelSetFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:28:39 $
00007   Version:   $Revision: 1.5 $
00008 
00009   Copyright (c) Insight Software 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 __itkShapePriorSegmentationLevelSetFunction_h_
00018 #define __itkShapePriorSegmentationLevelSetFunction_h_
00019 
00020 #include "itkSegmentationLevelSetFunction.h"
00021 #include "itkShapeSignedDistanceFunction.h"
00022 
00023 namespace itk {
00024 
00052 template <class TImageType, class TFeatureImageType = TImageType>
00053 class ITK_EXPORT ShapePriorSegmentationLevelSetFunction
00054   : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
00055 {
00056 public:
00058   typedef ShapePriorSegmentationLevelSetFunction Self;
00059   typedef SegmentationLevelSetFunction<TImageType,TFeatureImageType> Superclass;
00060   typedef SmartPointer<Self> Pointer;
00061   typedef SmartPointer<const Self> ConstPointer;
00062   typedef TFeatureImageType FeatureImageType;
00063 
00065   itkNewMacro(Self);
00066 
00068   itkTypeMacro( ShapePriorSegmentationLevelSetFunction, SegmentationLevelSetFunction );
00069 
00071   typedef typename Superclass::ImageType ImageType;
00072   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00073   typedef typename Superclass::ScalarValueType ScalarValueType;
00074   typedef typename Superclass::FeatureScalarType FeatureScalarType;
00075   typedef typename Superclass::RadiusType RadiusType;
00076   typedef typename Superclass::FloatOffsetType FloatOffsetType;
00077   typedef typename Superclass::VectorImageType VectorImageType;
00078   typedef typename Superclass::PixelType PixelType;
00079   typedef typename Superclass::TimeStepType TimeStepType;
00080   typedef typename Superclass::IndexType IndexType;
00081   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00082 
00084   itkStaticConstMacro(ImageDimension, unsigned int,
00085                       Superclass::ImageDimension);
00086 
00088   typedef ShapeSignedDistanceFunction<double,
00089                                       itkGetStaticConstMacro(ImageDimension)> ShapeFunctionType;
00090   typedef typename ShapeFunctionType::ConstPointer           ShapeFunctionPointer;
00091 
00093   void SetShapePriorWeight( const ScalarValueType p )
00094     { m_ShapePriorWeight = p; }
00095   ScalarValueType GetShapePriorWeight() const
00096     { return m_ShapePriorWeight; }
00097 
00100   void SetShapeFunction( const ShapeFunctionType * ptr )
00101     { m_ShapeFunction = ptr; }
00102   const ShapeFunctionType * GetShapeFunction() const
00103     { return m_ShapeFunction; }
00104 
00105 
00107   virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00108                                   void *globalData,
00109                                   const FloatOffsetType& = FloatOffsetType(0.0));
00110   
00112   virtual TimeStepType ComputeGlobalTimeStep( void *globalData ) const;
00113 
00115   typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
00116   struct ShapePriorGlobalDataStruct : public GlobalDataStruct
00117    {
00118      ScalarValueType m_MaxShapePriorChange;
00119    };
00120 
00122   virtual void *GetGlobalDataPointer() const
00123     {
00124       ShapePriorGlobalDataStruct *ans = new ShapePriorGlobalDataStruct();
00125       ans->m_MaxAdvectionChange   = NumericTraits<ScalarValueType>::Zero;
00126       ans->m_MaxPropagationChange = NumericTraits<ScalarValueType>::Zero;
00127       ans->m_MaxCurvatureChange   = NumericTraits<ScalarValueType>::Zero;
00128       ans->m_MaxShapePriorChange  = NumericTraits<ScalarValueType>::Zero;
00129       return ans; 
00130    }
00131 
00133   virtual void ReleaseGlobalDataPointer(void *GlobalData) const
00134     { delete (ShapePriorGlobalDataStruct *) GlobalData; }
00135   
00136 protected:
00137   ShapePriorSegmentationLevelSetFunction();
00138   virtual ~ShapePriorSegmentationLevelSetFunction() {}
00139 
00140   ShapePriorSegmentationLevelSetFunction(const Self&); //purposely not implemented
00141   void operator=(const Self&); //purposely not implemented
00142   
00143   void PrintSelf(std::ostream& os, Indent indent) const;
00144 
00145 private:
00146 
00147   ShapeFunctionPointer   m_ShapeFunction;
00148   ScalarValueType        m_ShapePriorWeight;
00149   
00150 };
00151   
00152 } // end namespace itk
00153 
00154 #ifndef ITK_MANUAL_INSTANTIATION
00155 #include "itkShapePriorSegmentationLevelSetFunction.txx"
00156 #endif
00157 
00158 #endif

Generated at Thu May 25 00:03:13 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000