18 #ifndef itkFloodFilledFunctionConditionalConstIterator_h
19 #define itkFloodFilledFunctionConditionalConstIterator_h
38 template<
typename TImage,
typename TFunction >
78 static constexpr
unsigned int NDimensions = TImage::ImageDimension;
92 std::vector< IndexType > & startIndices);
104 void FindSeedPixel();
107 void FindSeedPixels();
110 void InitializeIterator();
116 bool IsPixelIncluded(
const IndexType & index)
const override = 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;
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"
ImageType::PointType m_ImageOrigin
std::queue< IndexType > m_IndexStack
typename TImage::RegionType RegionType
bool m_FoundUncheckedNeighbor
virtual SmartPointer< FunctionType > GetFunction() const
void AddSeed(const IndexType &seed)
typename TImage::InternalPixelType InternalPixelType
typename TImage::PixelType PixelType
Define numeric traits for std::vector.
const PixelType Get() const override
SeedsContainerType m_Seeds
typename std::vector< IndexType > SeedsContainerType
static unsigned int GetIteratorDimension()
TTempImage::Pointer m_TemporaryPointer
FunctionInputType m_LocationVector
ImageBaseType::SizeType SizeType
typename TFunction::InputType FunctionInputType
typename TImage::IndexType IndexType
ImageBaseType::IndexType IndexType
typename TImage::SizeType SizeType
ImageType::ConstWeakPointer m_Image
void operator++() override
virtual const SeedsContainerType & GetSeeds() const
SmartPointer< FunctionType > m_Function
bool IsAtEnd() const override
ImageType::SpacingType m_ImageSpacing
ImageBaseType::PointType PointType
Iterates over a flood-filled spatial function.
Self & operator=(const Self &it)
A base class for other iterators where membership in the set of output pixels is conditional upon som...
ImageBaseType::RegionType RegionType
const IndexType GetIndex() override
Templated n-dimensional image class.