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

itkThresholdSegmentationLevelSetFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkThresholdSegmentationLevelSetFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/10/01 01:36:05 $
00007   Version:   $Revision: 1.6 $
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 __itkThresholdSegmentationLevelSetFunction_h_
00018 #define __itkThresholdSegmentationLevelSetFunction_h_
00019 
00020 #include "itkSegmentationLevelSetFunction.h"
00021 
00022 namespace itk {
00023 
00045 template <class TImageType, class TFeatureImageType = TImageType>
00046 class ITK_EXPORT ThresholdSegmentationLevelSetFunction
00047   : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
00048 {
00049 public:
00051   typedef ThresholdSegmentationLevelSetFunction Self;
00052   typedef SegmentationLevelSetFunction<TImageType> Superclass;
00053   typedef SmartPointer<Self> Pointer;
00054   typedef SmartPointer<const Self> ConstPointer;
00055   typedef TFeatureImageType FeatureImageType;
00056 
00058   itkNewMacro(Self);
00059 
00061   itkTypeMacro( ThresholdSegmentationLevelSetFunction, SegmentationLevelSetFunction );
00062 
00064   typedef typename Superclass::ImageType ImageType;
00065   typedef typename Superclass::ScalarValueType ScalarValueType;
00066   typedef typename Superclass::FeatureScalarType FeatureScalarType;
00067   typedef typename Superclass::RadiusType RadiusType;
00068 
00070   itkStaticConstMacro(ImageDimension, unsigned int,
00071                       Superclass::ImageDimension);
00072 
00074   void SetUpperThreshold(FeatureScalarType f)
00075   { m_UpperThreshold = f; }
00076   FeatureScalarType GetUpperThreshold() const
00077   { return m_UpperThreshold; }
00078   void SetLowerThreshold(FeatureScalarType f)
00079   { m_LowerThreshold = f; }
00080   FeatureScalarType GetLowerThreshold() const
00081   { return m_LowerThreshold; }
00082 
00083   virtual void CalculateSpeedImage();
00084 
00085   virtual void Initialize(const RadiusType &r)
00086   {
00087     Superclass::Initialize(r);
00088     
00089     this->SetAdvectionWeight( NumericTraits<ScalarValueType>::Zero);
00090     this->SetPropagationWeight(-1.0 * NumericTraits<ScalarValueType>::One);
00091     this->SetCurvatureWeight(NumericTraits<ScalarValueType>::One);
00092   }
00093   
00094 protected:
00095   ThresholdSegmentationLevelSetFunction()  {}
00096   virtual ~ThresholdSegmentationLevelSetFunction() {}
00097 
00098   ThresholdSegmentationLevelSetFunction(const Self&); //purposely not implemented
00099   void operator=(const Self&); //purposely not implemented
00100   
00101   void PrintSelf(std::ostream& os, Indent indent) const
00102   {
00103     Superclass::PrintSelf(os, indent );
00104     os << indent << "UpperThreshold: " << m_UpperThreshold << std::endl;
00105     os << indent << "LowerThreshold: " << m_LowerThreshold << std::endl;
00106   }
00107   
00108   FeatureScalarType m_UpperThreshold;
00109   FeatureScalarType m_LowerThreshold;
00110 };
00111   
00112 } // end namespace itk
00113 
00114 #ifndef ITK_MANUAL_INSTANTIATION
00115 #include "itkThresholdSegmentationLevelSetFunction.txx"
00116 #endif
00117 
00118 #endif

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