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; }
00098 
00101   void SetShapeFunction( const ShapeFunctionType * ptr )
00102     { m_ShapeFunction = ptr; }
00103   const ShapeFunctionType * GetShapeFunction() const
00104     { return m_ShapeFunction; }
00106 
00107 
00109   virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00110                                   void *globalData,
00111                                   const FloatOffsetType& = FloatOffsetType(0.0));
00112 
00114   virtual TimeStepType ComputeGlobalTimeStep( void *globalData ) const;
00115 
00117   typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
00118   struct ShapePriorGlobalDataStruct : public GlobalDataStruct
00119    {
00120      ScalarValueType m_MaxShapePriorChange;
00121    };
00122 
00124   virtual void *GetGlobalDataPointer() const
00125     {
00126       ShapePriorGlobalDataStruct *ans = new ShapePriorGlobalDataStruct();
00127       ans->m_MaxAdvectionChange   = NumericTraits<ScalarValueType>::Zero;
00128       ans->m_MaxPropagationChange = NumericTraits<ScalarValueType>::Zero;
00129       ans->m_MaxCurvatureChange   = NumericTraits<ScalarValueType>::Zero;
00130       ans->m_MaxShapePriorChange  = NumericTraits<ScalarValueType>::Zero;
00131       return ans; 
00132    }
00134 
00136   virtual void ReleaseGlobalDataPointer(void *GlobalData) const
00137     { delete (ShapePriorGlobalDataStruct *) GlobalData; }
00138 
00139 protected:
00140   ShapePriorSegmentationLevelSetFunction();
00141   virtual ~ShapePriorSegmentationLevelSetFunction() {}
00142 
00143   ShapePriorSegmentationLevelSetFunction(const Self&); //purposely not implemented
00144   void operator=(const Self&); //purposely not implemented
00145   
00146   void PrintSelf(std::ostream& os, Indent indent) const;
00147 
00148 private:
00149 
00150   ShapeFunctionPointer   m_ShapeFunction;
00151   ScalarValueType        m_ShapePriorWeight;
00152   
00153 };
00154   
00155 } // end namespace itk
00156 
00157 #ifndef ITK_MANUAL_INSTANTIATION
00158 #include "itkShapePriorSegmentationLevelSetFunction.txx"
00159 #endif
00160 
00161 #endif
00162 

Generated at Tue Jul 29 22:20:23 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000