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 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;
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 }
00118
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkFloodFilledFunctionConditionalIterator.txx"
00121 #endif
00122
00123 #endif