18 #ifndef itkShapedFloodFilledFunctionConditionalConstIterator_h
19 #define itkShapedFloodFilledFunctionConditionalConstIterator_h
42 template<
typename TImage,
typename TFunction >
88 itkStaticConstMacro(NDimensions,
unsigned int, TImage::ImageDimension);
102 std::vector< IndexType > & startIndices);
114 void FindSeedPixel();
117 void FindSeedPixels();
120 void InitializeIterator();
126 virtual bool IsPixelIncluded(
const IndexType & index)
const = 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"
virtual ~ShapedFloodFilledFunctionConditionalConstIterator()
TImage::PixelType PixelType
static unsigned int GetIteratorDimension()
TImage::RegionType RegionType
TFunction::InputType FunctionInputType
virtual const SeedsContainerType & GetSeeds() const
Image< unsigned char, itkGetStaticConstMacro(NDimensions) > TTempImage
SeedsContainerType m_Seeds
FunctionInputType m_LocationVector
TImage::IndexType IndexType
virtual SmartPointer< FunctionType > GetFunction() const
Self & operator=(const Self &it)
NeighborhoodIteratorType m_NeighborhoodIterator
ImageType::PointType m_ImageOrigin
const IndexType GetIndex()
ImageBaseType::PointType PointType
ImageType::ConstWeakPointer m_Image
TImage::OffsetType OffsetType
Iterates over a flood-filled spatial function with read-only access to pixels.
ImageType::SpacingType m_ImageSpacing
TTempImage::Pointer m_TempPtr
ShapedFloodFilledFunctionConditionalConstIterator Self
std::vector< IndexType > SeedsContainerType
itk::ShapedNeighborhoodIterator< ImageType > NeighborhoodIteratorType
void AddSeed(const IndexType seed)
TImage::InternalPixelType InternalPixelType
ImageBaseType::SizeType SizeType
Define additional traits for native types such as int or float.
A base class for other iterators where membership in the set of output pixels is conditional upon som...
bool m_FoundUncheckedNeighbor
std::queue< IndexType > m_IndexStack
SmartPointer< FunctionType > m_Function
const PixelType Get(void) const
Templated n-dimensional image class.
ImageBaseType::IndexType IndexType
TImage::PixelType PixelType
TImage::SizeType SizeType