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

itkSegmentationLevelSetFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSegmentationLevelSetFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/24 16:45:57 $
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 __itkSegmentationLevelSetFunction_h_
00018 #define __itkSegmentationLevelSetFunction_h_
00019 
00020 #include "itkLevelSetFunction.h"
00021 
00022 namespace itk {
00023 
00041 template <class TImageType, class TFeatureImageType = TImageType>
00042 class ITK_EXPORT SegmentationLevelSetFunction
00043   : public LevelSetFunction<TImageType>
00044 {
00045 public:
00047   typedef SegmentationLevelSetFunction Self;
00048   typedef LevelSetFunction<TImageType> Superclass;
00049   typedef SmartPointer<Self> Pointer;
00050   typedef SmartPointer<const Self> ConstPointer;
00051 
00053   itkTypeMacro( SegmentationLevelSetFunction, LevelSetFunction );
00054 
00055   //  itkNewMacro(Self);
00056   
00058   typedef typename Superclass::ImageType ImageType;
00059   typedef typename Superclass::RadiusType RadiusType;
00060   typedef TFeatureImageType FeatureImageType;
00061   typedef typename Superclass::BoundaryNeighborhoodType BoundaryNeighborhoodType;
00062   typedef typename Superclass::FloatOffsetType FloatOffsetType;
00063   typedef typename Superclass::ScalarValueType ScalarValueType;
00064   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00065   typedef typename FeatureImageType::PixelType FeatureScalarType;
00066   typedef typename ImageType::IndexType IndexType;
00067 
00068   
00070   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00071 
00073   virtual FeatureImageType *GetFeatureImage() const
00074   { return m_FeatureImage.GetPointer(); }
00075   virtual void SetFeatureImage(FeatureImageType *f)
00076   { m_FeatureImage = f; }
00077   
00079   virtual ImageType *GetSpeedImage() const
00080   { return m_SpeedImage.GetPointer(); }
00081 
00085   virtual void Initialize(const RadiusType &r);
00086 
00091   virtual void CalculateSpeedImage() = 0;
00092 
00095   virtual void AllocateSpeedImage();
00096   
00097 protected:
00099   typename FeatureImageType::Pointer m_FeatureImage;
00100   typename ImageType::Pointer        m_SpeedImage;
00101 
00103  virtual ScalarValueType PropagationSpeed(
00104                             const NeighborhoodType& neighborhood,
00105                             const FloatOffsetType
00106                           ) const
00107     {
00108       IndexType idx = neighborhood.GetIndex();
00109       return m_SpeedImage->GetPixel(idx);
00110     }
00111   
00113   virtual ScalarValueType PropagationSpeed(const BoundaryNeighborhoodType
00114                                &neighborhood, const FloatOffsetType &
00115                                            ) const
00116   {
00117     IndexType idx = neighborhood.GetIndex();
00118     return m_SpeedImage->GetPixel(idx);
00119   }
00120 
00121   virtual ~SegmentationLevelSetFunction() {}
00122   SegmentationLevelSetFunction()
00123   { m_SpeedImage = ImageType::New(); }  
00124 };
00125 
00126 } // end namespace
00127 
00128 #ifndef ITK_MANUAL_INSTANTIATION
00129 #include "itkSegmentationLevelSetFunction.txx"
00130 #endif
00131 
00132 #endif

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