ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkFloodFilledImageFunctionConditionalIterator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkFloodFilledImageFunctionConditionalIterator_h
00019 #define __itkFloodFilledImageFunctionConditionalIterator_h
00020 
00021 #include "itkFloodFilledImageFunctionConditionalConstIterator.h"
00022 
00023 namespace itk
00024 {
00033 template< class TImage, class TFunction >
00034 class ITK_EXPORT FloodFilledImageFunctionConditionalIterator:public FloodFilledImageFunctionConditionalConstIterator<
00035     TImage, TFunction >
00036 {
00037 public:
00038 
00040   typedef FloodFilledImageFunctionConditionalIterator                           Self;
00041   typedef FloodFilledImageFunctionConditionalConstIterator< TImage, TFunction > Superclass;
00042 
00044   typedef typename Superclass::FunctionType FunctionType;
00045 
00047   typedef typename Superclass::FunctionInputType FunctionInputType;
00048 
00050   typedef typename Superclass::IndexType IndexType;
00051 
00053   typedef typename Superclass::SeedsContainerType SeedsContainerType;
00054 
00056   typedef typename Superclass::SizeType SizeType;
00057 
00059   typedef typename Superclass::RegionType RegionType;
00060 
00062   typedef typename Superclass::ImageType ImageType;
00063 
00065   typedef typename Superclass::InternalPixelType InternalPixelType;
00066 
00068   typedef typename Superclass::PixelType PixelType;
00069 
00074   itkStaticConstMacro(NDimensions, unsigned int, Superclass::NDimensions);
00075 
00079   FloodFilledImageFunctionConditionalIterator(ImageType *imagePtr,
00080                                               FunctionType *fnPtr,
00081                                               IndexType startIndex):Superclass(imagePtr, fnPtr, startIndex) {}
00082 
00086   FloodFilledImageFunctionConditionalIterator(ImageType *imagePtr,
00087                                               FunctionType *fnPtr,
00088                                               std::vector< IndexType > & startIndex):Superclass(imagePtr, fnPtr,
00089                                                                                                 startIndex) {}
00090 
00094   FloodFilledImageFunctionConditionalIterator(ImageType *imagePtr,
00095                                               FunctionType *fnPtr):Superclass(imagePtr, fnPtr) {}
00096 
00098   const PixelType & Get(void) const
00099   { return const_cast< ImageType * >( this->m_Image.GetPointer() )->GetPixel( this->m_IndexStack.front() ); }
00100 
00102   void Set(const PixelType & value)
00103   { const_cast< ImageType * >( this->m_Image.GetPointer() )->GetPixel( this->m_IndexStack.front() ) = value; }
00104 
00106   virtual ~FloodFilledImageFunctionConditionalIterator() {}
00107 };
00108 } // end namespace itk
00109 
00110 #endif
00111