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