18 #ifndef itkShapedFloodFilledFunctionConditionalConstIterator_h
19 #define itkShapedFloodFilledFunctionConditionalConstIterator_h
42 template<
typename TImage,
typename TFunction >
88 static constexpr
unsigned int NDimensions = TImage::ImageDimension;
102 std::vector< IndexType > & startIndices);
114 void FindSeedPixel();
117 void FindSeedPixels();
120 void InitializeIterator();
126 bool IsPixelIncluded(
const IndexType & index)
const override = 0;
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);
173 while ( !m_IndexStack.empty() )
178 this->m_IsAtEnd =
true;
180 m_TempPtr->FillBuffer(
184 for (
unsigned int i = 0; i < m_Seeds.size(); i++ )
186 if ( this->m_Image->GetBufferedRegion().IsInside (m_Seeds[i])
187 && this->IsPixelIncluded(m_Seeds[i]) )
190 m_IndexStack.push(m_Seeds[i]);
193 this->m_IsAtEnd =
false;
197 m_TempPtr->SetPixel(m_Seeds[i], 2);
204 { this->DoFloodStep(); }
217 void SetFullyConnected(
const bool _arg);
219 bool GetFullyConnected()
const;
221 itkBooleanMacro(FullyConnected);
279 #ifndef ITK_MANUAL_INSTANTIATION
280 #include "itkShapedFloodFilledFunctionConditionalConstIterator.hxx"
typename TImage::RegionType RegionType
static unsigned int GetIteratorDimension()
typename TImage::PixelType PixelType
Define numeric traits for std::vector.
bool IsAtEnd() const override
typename TImage::IndexType IndexType
typename TFunction::InputType FunctionInputType
virtual const SeedsContainerType & GetSeeds() const
SeedsContainerType m_Seeds
FunctionInputType m_LocationVector
typename TImage::OffsetType OffsetType
virtual SmartPointer< FunctionType > GetFunction() const
Self & operator=(const Self &it)
const IndexType GetIndex() override
NeighborhoodIteratorType m_NeighborhoodIterator
ImageType::PointType m_ImageOrigin
typename std::vector< IndexType > SeedsContainerType
ImageBaseType::SizeType SizeType
ImageBaseType::IndexType IndexType
typename TImage::SizeType SizeType
ImageType::ConstWeakPointer m_Image
Iterates over a flood-filled spatial function with read-only access to pixels.
ImageType::SpacingType m_ImageSpacing
TTempImage::Pointer m_TempPtr
void AddSeed(const IndexType seed)
ImageBaseType::PointType PointType
typename TImage::InternalPixelType InternalPixelType
const PixelType Get() const override
A base class for other iterators where membership in the set of output pixels is conditional upon som...
bool m_FoundUncheckedNeighbor
ImageBaseType::RegionType RegionType
std::queue< IndexType > m_IndexStack
typename itk::ShapedNeighborhoodIterator< ImageType > NeighborhoodIteratorType
SmartPointer< FunctionType > m_Function
void operator++() override
Templated n-dimensional image class.