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

itkFloodFilledFunctionConditionalIterator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkFloodFilledFunctionConditionalIterator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/11 19:57:12 $
00007   Version:   $Revision: 1.10 $
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 __itkFloodFilledFunctionConditionalIterator_h
00018 #define __itkFloodFilledFunctionConditionalIterator_h
00019 
00020 #include <stack>
00021 
00022 #include "itkImage.h"
00023 #include "itkFloodFilledFunctionConditionalConstIterator.h"
00024 
00025 namespace itk
00026 {
00027 
00035 template<class TImage, class TFunction>
00036 class FloodFilledFunctionConditionalIterator: public FloodFilledFunctionConditionalConstIterator<TImage, TFunction>
00037 {
00038 public:
00040   typedef FloodFilledFunctionConditionalIterator Self;
00041   typedef FloodFilledFunctionConditionalConstIterator<TImage, TFunction> Superclass;
00042 
00044   typedef TFunction FunctionType;
00045 
00047   typedef typename TFunction::FunctionInputType FunctionInputType;
00048 
00050   typedef typename Superclass::IndexType  IndexType;
00051 
00053   typedef typename Superclass::SizeType    SizeType;
00054 
00056   typedef typename Superclass::RegionType    RegionType;
00057 
00059   typedef typename Superclass::ImageType   ImageType;
00060 
00062   typedef typename Superclass::InternalPixelType   InternalPixelType;
00063 
00065   typedef typename Superclass::PixelType   PixelType;
00066 
00071   itkStaticConstMacro(NDimensions, unsigned int, TImage::ImageDimension);
00072 
00076   FloodFilledFunctionConditionalIterator(ImageType *imagePtr,
00077                                          FunctionType *fnPtr,
00078                                          IndexType startIndex) :
00079                                       Superclass(imagePtr, fnPtr, startIndex){};
00080 
00084   FloodFilledFunctionConditionalIterator(ImageType *imagePtr,
00085                                          FunctionType *fnPtr) :
00086                                       Superclass(imagePtr, fnPtr){}; 
00087 
00089   virtual ~FloodFilledFunctionConditionalIterator() {};
00090   
00093   Self &operator=(const Self& it)
00094   {
00095     m_Image = it.m_Image;     // copy the smart pointer
00096     m_Region = it.m_Region;
00097   }
00098 
00100   PixelType & Get(void)
00101     { return const_cast<ImageType *>(m_Image.GetPointer())->GetPixel(m_IndexStack.top() ); }
00102 
00104   void Set( const PixelType & value)
00105     { const_cast<ImageType *>(m_Image.GetPointer())->GetPixel(m_IndexStack.top() ) = value; }
00106 
00107 };
00108 
00109 } // end namespace itk
00110 
00111 #ifndef ITK_MANUAL_INSTANTIATION
00112 #include "itkFloodFilledFunctionConditionalIterator.txx"
00113 #endif
00114 
00115 #endif 

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