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;
126 this->m_Function = it.m_Function;
127 this->m_TemporaryPointer = it.m_TemporaryPointer;
128 this->m_Seeds = it.m_Seeds;
129 this->m_ImageOrigin = it.m_ImageOrigin;
130 this->m_ImageSpacing = it.m_ImageSpacing;
131 this->m_ImageRegion = it.m_ImageRegion;
132 this->m_IndexStack = it.m_IndexStack;
133 this->m_LocationVector = it.m_LocationVector;
134 this->m_FoundUncheckedNeighbor = it.m_FoundUncheckedNeighbor;
135 this->m_IsValidIndex = it.m_IsValidIndex;
142 static unsigned int GetIteratorDimension()
143 {
return TImage::ImageDimension; }
150 {
return m_IndexStack.front(); }
154 {
return this->m_Image->GetPixel( m_IndexStack.front() ); }
158 {
return this->m_IsAtEnd; }
163 m_Seeds.push_back (seed);
183 while ( !m_IndexStack.empty() )
188 this->m_IsAtEnd =
true;
190 m_TemporaryPointer->FillBuffer(
194 for (
unsigned int i = 0; i < m_Seeds.size(); i++ )
196 if ( this->m_Image->GetBufferedRegion().IsInside (m_Seeds[i])
197 && this->IsPixelIncluded(m_Seeds[i]) )
200 m_IndexStack.push(m_Seeds[i]);
203 this->m_IsAtEnd =
false;
207 m_TemporaryPointer->SetPixel(m_Seeds[i], 2);
214 { this->DoFloodStep(); }
262 #ifndef ITK_MANUAL_INSTANTIATION
263 #include "itkFloodFilledFunctionConditionalConstIterator.hxx"