18 #ifndef __itkFloodFilledFunctionConditionalConstIterator_h
19 #define __itkFloodFilledFunctionConditionalConstIterator_h
38 template<
class TImage,
class TFunction >
78 itkStaticConstMacro(NDimensions,
unsigned int, TImage::ImageDimension);
92 std::vector< IndexType > & startIndices);
104 void FindSeedPixel();
107 void FindSeedPixels();
110 void InitializeIterator();
116 virtual bool IsPixelIncluded(
const IndexType & index)
const = 0;
124 this->m_Function = it.m_Function;
125 this->m_TemporaryPointer = it.m_TemporaryPointer;
126 this->m_Seeds = it.m_Seeds;
127 this->m_ImageOrigin = it.m_ImageOrigin;
128 this->m_ImageSpacing = it.m_ImageSpacing;
129 this->m_ImageRegion = it.m_ImageRegion;
130 this->m_IndexStack = it.m_IndexStack;
131 this->m_LocationVector = it.m_LocationVector;
132 this->m_FoundUncheckedNeighbor = it.m_FoundUncheckedNeighbor;
133 this->m_IsValidIndex = it.m_IsValidIndex;
138 static unsigned int GetIteratorDimension()
139 {
return TImage::ImageDimension; }
146 {
return m_IndexStack.front(); }
150 {
return this->m_Image->GetPixel( m_IndexStack.front() ); }
154 {
return this->m_IsAtEnd; }
159 m_Seeds.push_back (seed);
179 while ( !m_IndexStack.empty() )
184 this->m_IsAtEnd =
true;
186 m_TemporaryPointer->FillBuffer(
190 for (
unsigned int i = 0; i < m_Seeds.size(); i++ )
192 if ( this->m_Image->GetBufferedRegion().IsInside (m_Seeds[i])
193 && this->IsPixelIncluded(m_Seeds[i]) )
196 m_IndexStack.push(m_Seeds[i]);
199 this->m_IsAtEnd =
false;
203 m_TemporaryPointer->SetPixel(m_Seeds[i], 2);
210 { this->DoFloodStep(); }
258 #ifndef ITK_MANUAL_INSTANTIATION
259 #include "itkFloodFilledFunctionConditionalConstIterator.hxx"