18#ifndef itkShapedFloodFilledFunctionConditionalConstIterator_h
19#define itkShapedFloodFilledFunctionConditionalConstIterator_h
42template <
typename TImage,
typename TFunction>
87 static constexpr unsigned int NDimensions = TImage::ImageDimension;
101 std::vector<IndexType> & startIndex);
144 return TImage::ImageDimension;
154 return m_IndexStack.front();
161 return this->m_Image->GetPixel(m_IndexStack.front());
168 return this->m_IsAtEnd;
175 m_Seeds.push_back(seed);
191 while (!m_IndexStack.empty())
196 this->m_IsAtEnd =
true;
200 for (
unsigned int i = 0; i < m_Seeds.size(); ++i)
202 if (this->m_Image->GetBufferedRegion().IsInside(m_Seeds[i]) && this->IsPixelIncluded(m_Seeds[i]))
205 m_IndexStack.push(m_Seeds[i]);
208 this->m_IsAtEnd =
false;
212 m_TempPtr->SetPixel(m_Seeds[i], 2);
243 itkBooleanMacro(FullyConnected);
271 typename ImageType::SpacingType m_ImageSpacing{};
280 std::queue<IndexType> m_IndexStack{};
287 bool m_FoundUncheckedNeighbor{};
290 bool m_IsValidIndex{};
297 bool m_FullyConnected{};
302#ifndef ITK_MANUAL_INSTANTIATION
303# include "itkShapedFloodFilledFunctionConditionalConstIterator.hxx"
A base class for other iterators where membership in the set of output pixels is conditional upon som...
typename TImage::PixelType PixelType
ImageType::ConstWeakPointer m_Image
typename TImage::RegionType RegionType
typename TImage::SizeType SizeType
Templated n-dimensional image class.
Iterates over a flood-filled spatial function with read-only access to pixels.
ShapedFloodFilledFunctionConditionalConstIterator(const ImageType *imagePtr, FunctionType *fnPtr)
void AddSeed(const IndexType seed)
const PixelType Get() const override
void InitializeIterator()
bool IsAtEnd() const override
const IndexType GetIndex() override
typename std::vector< IndexType > SeedsContainerType
~ShapedFloodFilledFunctionConditionalConstIterator() override=default
ShapedFloodFilledFunctionConditionalConstIterator(const ImageType *imagePtr, FunctionType *fnPtr, std::vector< IndexType > &startIndex)
virtual SmartPointer< FunctionType > GetFunction() const
virtual const SeedsContainerType & GetSeeds() const
static unsigned int GetIteratorDimension()
typename TImage::InternalPixelType InternalPixelType
bool IsPixelIncluded(const IndexType &index) const override=0
typename itk::ShapedNeighborhoodIterator< ImageType > NeighborhoodIteratorType
typename TImage::IndexType IndexType
ShapedFloodFilledFunctionConditionalConstIterator(const ImageType *imagePtr, FunctionType *fnPtr, IndexType startIndex)
typename TFunction::InputType FunctionInputType
void SetFullyConnected(const bool _arg)
typename TImage::OffsetType OffsetType
bool GetFullyConnected() const
Self & operator=(const Self &it)
void operator++() override
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....