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

itkLevelSetImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLevelSetImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/18 16:22:22 $
00007   Version:   $Revision: 1.20 $
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 _itkLevelSetImageFilter_h
00018 #define _itkLevelSetImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkLevelSet.h"
00022 
00023 namespace itk
00024 {
00025 
00056 template <class TLevelSet>
00057 class ITK_EXPORT LevelSetImageFilter : 
00058   public ImageToImageFilter<TLevelSet,TLevelSet>
00059 {
00060 public:
00062   typedef LevelSetImageFilter Self;
00063   typedef ImageToImageFilter<TLevelSet,TLevelSet> Superclass;
00064   typedef SmartPointer<Self> Pointer;
00065   typedef SmartPointer<const Self>  ConstPointer;
00066 
00068   itkTypeMacro(LevelSetImageFilter, ImageToImageFilter);
00069 
00071   typedef LevelSetTypeDefault<TLevelSet>  LevelSetType;
00072   typedef typename LevelSetType::LevelSetImageType  LevelSetImageType;
00073   typedef typename LevelSetType::LevelSetPointer  LevelSetPointer;
00074   typedef typename LevelSetType::LevelSetConstPointer  LevelSetConstPointer;
00075   typedef typename LevelSetType::PixelType  PixelType;
00076   typedef typename LevelSetType::NodeType NodeType;
00077   typedef typename LevelSetType::NodeContainer NodeContainer;
00078   typedef typename LevelSetType::NodeContainerPointer NodeContainerPointer;
00079 
00081   enum { SetDimension = LevelSetType::SetDimension};
00082 
00087   itkSetClampMacro( TimeStepSize, double, 0.0, 
00088     NumericTraits<double>::max());
00089 
00091   itkGetMacro( TimeStepSize, double );
00092 
00098   itkSetMacro( NarrowBanding, bool );
00099   itkBooleanMacro( NarrowBanding );
00100 
00102   itkGetMacro( NarrowBanding, bool );
00103 
00105   itkSetClampMacro( NarrowBandwidth, double, 0.0, 
00106     NumericTraits<double>::max());
00107 
00109   itkGetMacro( NarrowBandwidth, double );
00110 
00112   int GetNarrowBandSize()
00113     { 
00114     if( !m_NarrowBanding ) return 0;
00115     return m_InputNarrowBand->Size();
00116     }
00117 
00119   void SetInputNarrowBand( NodeContainer *ptr );
00120 
00122   NodeContainerPointer GetInputNarrowBand( )
00123     { return m_InputNarrowBand; }
00124 
00126   itkSetMacro( NumberOfIterations, unsigned int );
00127 
00129   itkGetMacro( NumberOfIterations, unsigned int );
00130 
00131 protected:
00132   LevelSetImageFilter();
00133   ~LevelSetImageFilter(){};
00134   void PrintSelf(std::ostream& os, Indent indent) const;
00135 
00137   virtual void AllocateBuffers(bool outputOnly = false);
00138 
00142   virtual void SwapBuffers();
00143 
00146   virtual void CopyInputToInputBuffer();
00147 
00150   virtual void CopyOutputBufferToOutput();
00151 
00153   LevelSetPointer GetInputBuffer(void)
00154     { return m_InputBuffer; }
00155 
00157   LevelSetPointer GetOutputBuffer(void)
00158     { return m_OutputBuffer; }
00159 
00165   virtual void GenerateInputRequestedRegion();
00166 
00172   virtual void EnlargeOutputRequestedRegion(DataObject * output);
00173 
00174 private:
00175   LevelSetImageFilter(const Self&); //purposely not implemented
00176   void operator=(const Self&); //purposely not implemented
00177   
00178   NodeContainerPointer   m_InputNarrowBand;
00179   double                 m_TimeStepSize;
00180   bool                   m_NarrowBanding;
00181   double                 m_NarrowBandwidth;
00182 
00183   unsigned int           m_NumberOfIterations;
00184   LevelSetPointer        m_InputBuffer;
00185   LevelSetPointer        m_OutputBuffer;
00186 
00187 };
00188 
00189 
00190 } //namespace itk
00191 
00192 #ifndef ITK_MANUAL_INSTANTIATION
00193 #include "itkLevelSetImageFilter.txx"
00194 #endif
00195 
00196 #endif

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