00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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;
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 }
00110
00111 #ifndef ITK_MANUAL_INSTANTIATION
00112 #include "itkFloodFilledFunctionConditionalIterator.txx"
00113 #endif
00114
00115 #endif