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

itkAntiAliasBinaryImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAntiAliasBinaryImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/05/16 20:07:11 $
00007   Version:   $Revision: 1.4 $
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 __itkAntiAliasBinaryImageFilter_h_
00018 #define __itkAntiAliasBinaryImageFilter_h_
00019 #include "itkSparseFieldLevelSetImageFilter.h"
00020 #include "itkCurvatureFlowFunction.h"
00021 
00022 namespace itk {
00023 
00099 template <class TInputImage, class TOutputImage>
00100 class AntiAliasBinaryImageFilter
00101   : public SparseFieldLevelSetImageFilter<TInputImage, TOutputImage>
00102 {
00103 public:
00105   typedef AntiAliasBinaryImageFilter Self;
00106   typedef SparseFieldLevelSetImageFilter<TInputImage, TOutputImage> Superclass;
00107   typedef SmartPointer<Self>  Pointer;
00108   typedef SmartPointer<const Self>  ConstPointer;
00109 
00111   typedef typename Superclass::ValueType ValueType;
00112   typedef typename Superclass::IndexType IndexType;
00113   typedef typename Superclass::TimeStepType TimeStepType;
00114   typedef typename Superclass::OutputImageType OutputImageType;
00115   typedef typename Superclass::InputImageType  InputImageType;
00116 
00117   
00119   typedef CurvatureFlowFunction<OutputImageType> CurvatureFunctionType;
00120   
00122   typedef typename TInputImage::ValueType  BinaryValueType;
00123   
00125   itkNewMacro(Self);
00126 
00128   itkTypeMacro(AntiAliasBinaryImageFilter, SparseFieldLevelSetImageFilter);
00129 
00132   itkSetMacro(MaximumRMSError, ValueType);
00133   itkGetMacro(MaximumRMSError, ValueType);
00134 
00139   itkSetMacro(MaximumIterations, unsigned int);
00140   itkGetMacro(MaximumIterations, unsigned int);
00141   
00143   itkGetMacro(UpperBinaryValue, BinaryValueType);
00144   itkGetMacro(LowerBinaryValue, BinaryValueType);
00145   
00146 protected:
00147   AntiAliasBinaryImageFilter();
00148   ~AntiAliasBinaryImageFilter() {}
00149   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00150 
00153   inline virtual ValueType CalculateUpdateValue(const IndexType &idx,
00154                                                 const TimeStepType &dt,
00155                                                 const ValueType &value,
00156                                                 const ValueType &change);
00157   
00160   bool Halt()
00161   {
00162     if (this->GetElapsedIterations() >= m_MaximumIterations)
00163       {
00164         itkWarningMacro("This filter has passed the maximum number of iterations allowed and will be halted.  This means that the solution did not converge to the MaximumRMSError you specified.  Try setting m_MaximumRMSError to a higher value, or set m_MaxmimumIterations to a higher value.");
00165         return true;
00166       }
00167     else if ( this->GetElapsedIterations() == 0)
00168       { return false; }
00169     else if ( this->GetRMSChange() <= m_MaximumRMSError )
00170       { return true; }
00171     else
00172       { return false; }
00173   }
00174 
00177   void GenerateData();
00178   
00179 private:
00180   ValueType m_MaximumRMSError;
00181   BinaryValueType m_UpperBinaryValue;
00182   BinaryValueType m_LowerBinaryValue;
00183   typename CurvatureFunctionType::Pointer m_CurvatureFunction;
00184   
00185   unsigned int m_MaximumIterations;
00186   
00187 };
00188 
00189 } // end namespace itk
00190 
00191 #ifndef ITK_MANUAL_INSTANTIATION
00192 #include "itkAntiAliasBinaryImageFilter.txx"
00193 #endif
00194 
00195 #endif

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