ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkShapedFloodFilledImageFunctionConditionalIterator.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 __itkShapedFloodFilledImageFunctionConditionalIterator_h
00019 #define __itkShapedFloodFilledImageFunctionConditionalIterator_h
00020 
00021 #include "itkShapedFloodFilledImageFunctionConditionalConstIterator.h"
00022 
00023 namespace itk
00024 {
00037 template< class TImage, class TFunction >
00038 class ITK_EXPORT ShapedFloodFilledImageFunctionConditionalIterator:public
00039   ShapedFloodFilledImageFunctionConditionalConstIterator< TImage, TFunction >
00040 {
00041 public:
00042 
00044   typedef ShapedFloodFilledImageFunctionConditionalIterator                           Self;
00045   typedef ShapedFloodFilledImageFunctionConditionalConstIterator< TImage, TFunction > Superclass;
00046 
00048   typedef typename Superclass::FunctionType FunctionType;
00049 
00051   typedef typename Superclass::FunctionInputType FunctionInputType;
00052 
00054   typedef typename Superclass::IndexType IndexType;
00055 
00057   typedef typename Superclass::SizeType SizeType;
00058 
00060   typedef typename Superclass::RegionType RegionType;
00061 
00063   typedef typename Superclass::ImageType ImageType;
00064 
00066   typedef typename Superclass::InternalPixelType InternalPixelType;
00067 
00069   typedef typename Superclass::PixelType PixelType;
00070 
00075   itkStaticConstMacro(NDimensions, unsigned int, Superclass::NDimensions);
00076 
00080   ShapedFloodFilledImageFunctionConditionalIterator(ImageType *imagePtr,
00081                                                     FunctionType *fnPtr,
00082                                                     IndexType startIndex):Superclass(imagePtr, fnPtr, startIndex) {}
00083 
00087   ShapedFloodFilledImageFunctionConditionalIterator(ImageType *imagePtr,
00088                                                     FunctionType *fnPtr,
00089                                                     std::vector< IndexType > & startIndex):Superclass(imagePtr, fnPtr,
00090                                                                                                       startIndex) {}
00091 
00095   ShapedFloodFilledImageFunctionConditionalIterator(ImageType *imagePtr,
00096                                                     FunctionType *fnPtr):Superclass(imagePtr, fnPtr) {}
00097 
00099   const PixelType & Get(void) const
00100   { return const_cast< ImageType * >( this->m_Image.GetPointer() )->GetPixel( this->m_IndexStack.front() ); }
00101 
00103   void Set(const PixelType & value)
00104   { const_cast< ImageType * >( this->m_Image.GetPointer() )->GetPixel( this->m_IndexStack.front() ) = value; }
00105 
00107   virtual ~ShapedFloodFilledImageFunctionConditionalIterator() {}
00108 };
00109 } // end namespace itk
00110 
00111 #endif
00112