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/11/07 13:40:01 $
00007   Version:   $Revision: 1.11 $
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                                          std::vector<IndexType>& startIndex) :
00087                                       Superclass(imagePtr, fnPtr, startIndex){};
00088 
00092   FloodFilledFunctionConditionalIterator(ImageType *imagePtr,
00093                                          FunctionType *fnPtr) :
00094                                       Superclass(imagePtr, fnPtr){}; 
00095 
00097   virtual ~FloodFilledFunctionConditionalIterator() {};
00098   
00101   Self &operator=(const Self& it)
00102   {
00103     m_Image = it.m_Image;     // copy the smart pointer
00104     m_Region = it.m_Region;
00105   }
00106 
00108   PixelType & Get(void)
00109     { return const_cast<ImageType *>(m_Image.GetPointer())->GetPixel(m_IndexStack.top() ); }
00110 
00112   void Set( const PixelType & value)
00113     { const_cast<ImageType *>(m_Image.GetPointer())->GetPixel(m_IndexStack.top() ) = value; }
00114 
00115 };
00116 
00117 } // end namespace itk
00118 
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkFloodFilledFunctionConditionalIterator.txx"
00121 #endif
00122 
00123 #endif 

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