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/12/17 17:50:35 $
00007   Version:   $Revision: 1.7 $
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 #include "itkLinearInterpolateImageFunction.h"
00022 #include "itkVectorLinearInterpolateImageFunction.h"
00023 #include "itkVectorCastImageFilter.h"
00024 
00025 namespace itk {
00026 
00044 template <class TImageType, class TFeatureImageType = TImageType>
00045 class ITK_EXPORT SegmentationLevelSetFunction
00046   : public LevelSetFunction<TImageType>
00047 {
00048 public:
00050   typedef SegmentationLevelSetFunction Self;
00051   typedef LevelSetFunction<TImageType> Superclass;
00052   typedef SmartPointer<Self> Pointer;
00053   typedef SmartPointer<const Self> ConstPointer;
00054 
00056   itkTypeMacro( SegmentationLevelSetFunction, LevelSetFunction );
00057 
00059   typedef typename Superclass::ImageType ImageType;
00060   typedef typename Superclass::RadiusType RadiusType;
00061   typedef TFeatureImageType FeatureImageType;
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   typedef typename Superclass::VectorType VectorType;
00068 
00070   typedef Image<VectorType, 
00071                 ::itk::GetImageDimension<TImageType>::ImageDimension > VectorImageType;
00072 
00073 
00075   typedef LinearInterpolateImageFunction<FeatureImageType>  InterpolatorType;
00076 
00078   typedef VectorLinearInterpolateImageFunction<VectorImageType> VectorInterpolatorType;
00079   
00081   typedef typename InterpolatorType::ContinuousIndexType ContinuousIndexType;
00082   
00084   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00085 
00087   virtual FeatureImageType *GetFeatureImage() const
00088   { return m_FeatureImage.GetPointer(); }
00089   virtual void SetFeatureImage(FeatureImageType *f)
00090   {    m_FeatureImage = f;  }
00091   
00093   virtual ImageType *GetSpeedImage() const
00094   { return m_SpeedImage.GetPointer(); }
00095 
00097   virtual VectorImageType *GetAdvectionImage() const
00098   { return m_AdvectionImage.GetPointer(); } 
00099 
00103   virtual void Initialize(const RadiusType &r);
00104 
00109   virtual void CalculateSpeedImage() {}
00110 
00115   virtual void CalculateAdvectionImage() {}
00116 
00119   virtual void AllocateSpeedImage();
00120 
00123   virtual void AllocateAdvectionImage();
00124 
00125 protected:
00127   typename FeatureImageType::Pointer m_FeatureImage;
00128 
00130   typename ImageType::Pointer        m_SpeedImage;
00131 
00133   typename VectorImageType::Pointer  m_AdvectionImage;
00134 
00136   Functor::VectorCast< ITK_TYPENAME VectorInterpolatorType::OutputType,
00137                        VectorType > m_VectorCast;
00138 
00140   virtual ScalarValueType PropagationSpeed(const NeighborhoodType &,
00141                                            const FloatOffsetType &) const;
00142 
00144   virtual VectorType AdvectionField(const NeighborhoodType &,
00145                                     const FloatOffsetType &) const;
00146   
00147   
00148   virtual ~SegmentationLevelSetFunction() {}
00149   SegmentationLevelSetFunction()
00150   {
00151     m_SpeedImage = ImageType::New();
00152     m_AdvectionImage = VectorImageType::New();
00153     m_Interpolator = InterpolatorType::New();
00154     m_VectorInterpolator = VectorInterpolatorType::New();
00155   }
00156 
00157   typename InterpolatorType::Pointer m_Interpolator;
00158   typename VectorInterpolatorType::Pointer m_VectorInterpolator;
00159   
00160 };
00161 
00162 } // end namespace
00163 
00164 #ifndef ITK_MANUAL_INSTANTIATION
00165 #include "itkSegmentationLevelSetFunction.txx"
00166 #endif
00167 
00168 #endif

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