18#ifndef itkFloodFilledFunctionConditionalConstIterator_h
19#define itkFloodFilledFunctionConditionalConstIterator_h
38template <
typename TImage,
typename TFunction>
77 static constexpr unsigned int NDimensions = TImage::ImageDimension;
89 std::vector<IndexType> & startIndex);
127 this->m_Function = it.m_Function;
128 this->m_TemporaryPointer = it.m_TemporaryPointer;
129 this->m_Seeds = it.m_Seeds;
130 this->m_ImageOrigin = it.m_ImageOrigin;
131 this->m_ImageSpacing = it.m_ImageSpacing;
132 this->m_ImageRegion = it.m_ImageRegion;
133 this->m_IndexStack = it.m_IndexStack;
134 this->m_LocationVector = it.m_LocationVector;
135 this->m_FoundUncheckedNeighbor = it.m_FoundUncheckedNeighbor;
136 this->m_IsValidIndex = it.m_IsValidIndex;
146 return TImage::ImageDimension;
156 return m_IndexStack.front();
163 return this->m_Image->GetPixel(m_IndexStack.front());
170 return this->m_IsAtEnd;
177 m_Seeds.push_back(seed);
181 virtual const SeedsContainerType &
200 while (!m_IndexStack.empty())
205 this->m_IsAtEnd =
true;
209 for (
unsigned int i = 0; i < m_Seeds.size(); ++i)
211 if (this->m_Image->GetBufferedRegion().IsInside(m_Seeds[i]) && this->IsPixelIncluded(m_Seeds[i]))
214 m_IndexStack.push(m_Seeds[i]);
217 this->m_IsAtEnd =
false;
221 m_TemporaryPointer->SetPixel(m_Seeds[i], 2);
261 typename ImageType::SpacingType m_ImageSpacing{};
267 std::queue<IndexType> m_IndexStack{};
274 bool m_FoundUncheckedNeighbor{};
277 bool m_IsValidIndex{};
281#ifndef ITK_MANUAL_INSTANTIATION
282# include "itkFloodFilledFunctionConditionalConstIterator.hxx"
A base class for other iterators where membership in the set of output pixels is conditional upon som...
typename TImage::PixelType PixelType
typename TImage::InternalPixelType InternalPixelType
ImageType::ConstWeakPointer m_Image
typename TImage::RegionType RegionType
typename TImage::SizeType SizeType
Iterates over a flood-filled spatial function.
FloodFilledFunctionConditionalConstIterator(const ImageType *imagePtr, FunctionType *fnPtr, std::vector< IndexType > &startIndex)
static unsigned int GetIteratorDimension()
bool IsAtEnd() const override
void operator++() override
void InitializeIterator()
void AddSeed(const IndexType &seed)
typename TImage::IndexType IndexType
typename std::vector< IndexType > SeedsContainerType
const IndexType GetIndex() override
Self & operator=(const Self &it)
typename TFunction::InputType FunctionInputType
FloodFilledFunctionConditionalConstIterator(const ImageType *imagePtr, FunctionType *fnPtr)
FloodFilledFunctionConditionalConstIterator(const ImageType *imagePtr, FunctionType *fnPtr, IndexType startIndex)
~FloodFilledFunctionConditionalConstIterator() override=default
virtual SmartPointer< FunctionType > GetFunction() const
bool IsPixelIncluded(const IndexType &index) const override=0
virtual const SeedsContainerType & GetSeeds() const
const PixelType Get() const override
Templated n-dimensional image class.
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....