ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Attributes | List of all members
itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction > Class Template Referenceabstract

#include <itkShapedFloodFilledFunctionConditionalConstIterator.h>

Detailed Description

template<typename TImage, typename TFunction>
class itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >

Iterates over a flood-filled spatial function with read-only access to pixels.

Contributed as a paper to the Insight Journal: https://doi.org/10.54294/iei8xt

Definition at line 43 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

+ Inheritance diagram for itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >:
+ Collaboration diagram for itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >:

Public Types

using FunctionInputType = typename TFunction::InputType
 
using FunctionType = TFunction
 
using ImageType = TImage
 
using IndexType = typename TImage::IndexType
 
using InternalPixelType = typename TImage::InternalPixelType
 
using NeighborhoodIteratorType = typename itk::ShapedNeighborhoodIterator< ImageType >
 
using OffsetType = typename TImage::OffsetType
 
using PixelType = typename TImage::PixelType
 
using RegionType = typename TImage::RegionType
 
using SeedsContainerType = typename std::vector< IndexType >
 
using Self = ShapedFloodFilledFunctionConditionalConstIterator
 
using SizeType = typename TImage::SizeType
 
- Public Types inherited from itk::ConditionalConstIterator< TImage >
using ImageType = TImage
 
using IndexType = typename TImage::IndexType
 
using InternalPixelType = typename TImage::InternalPixelType
 
using PixelType = typename TImage::PixelType
 
using RegionType = typename TImage::RegionType
 
using Self = ConditionalConstIterator
 
using SizeType = typename TImage::SizeType
 

Public Member Functions

void AddSeed (const IndexType seed)
 
void ClearSeeds ()
 
void DoFloodStep ()
 
void FindSeedPixel ()
 
void FindSeedPixels ()
 
virtual void FullyConnectedOn ()
 
const PixelType Get () const override
 
bool GetFullyConnected () const
 
virtual SmartPointer< FunctionTypeGetFunction () const
 
const IndexType GetIndex () override
 
virtual const SeedsContainerTypeGetSeeds () const
 
void GoToBegin ()
 
void InitializeIterator ()
 
bool IsAtEnd () const override
 
bool IsPixelIncluded (const IndexType &index) const override=0
 
void operator++ () override
 
Selfoperator= (const Self &it)
 
void SetFullyConnected (const bool _arg)
 
 ShapedFloodFilledFunctionConditionalConstIterator (const ImageType *imagePtr, FunctionType *fnPtr)
 
 ShapedFloodFilledFunctionConditionalConstIterator (const ImageType *imagePtr, FunctionType *fnPtr, IndexType startIndex)
 
 ShapedFloodFilledFunctionConditionalConstIterator (const ImageType *imagePtr, FunctionType *fnPtr, std::vector< IndexType > &startIndex)
 
 ~ShapedFloodFilledFunctionConditionalConstIterator () override=default
 
- Public Member Functions inherited from itk::ConditionalConstIterator< TImage >
 ConditionalConstIterator ()=default
 
Selfoperator= (const Self &it)
 
virtual ~ConditionalConstIterator ()=default
 

Static Public Member Functions

static unsigned int GetIteratorDimension ()
 
- Static Public Member Functions inherited from itk::ConditionalConstIterator< TImage >
static unsigned int GetIteratorDimension ()
 

Static Public Attributes

static constexpr unsigned int NDimensions = TImage::ImageDimension
 
- Static Public Attributes inherited from itk::ConditionalConstIterator< TImage >
static constexpr unsigned int NDimension = TImage::ImageDimension
 

Protected Types

using TTempImage = Image< unsigned char, Self::NDimensions >
 

Protected Attributes

bool m_FoundUncheckedNeighbor {}
 
SmartPointer< FunctionTypem_Function {}
 
ImageType::PointType m_ImageOrigin {}
 
RegionType m_ImageRegion {}
 
ImageType::SpacingType m_ImageSpacing {}
 
std::queue< IndexTypem_IndexStack {}
 
bool m_IsValidIndex {}
 
FunctionInputType m_LocationVector {}
 
NeighborhoodIteratorType m_NeighborhoodIterator {}
 
SeedsContainerType m_Seeds {}
 
TTempImage::Pointer m_TempPtr {}
 
bool m_FullyConnected {}
 
- Protected Attributes inherited from itk::ConditionalConstIterator< TImage >
ImageType::ConstWeakPointer m_Image {}
 
bool m_IsAtEnd { false }
 
RegionType m_Region {}
 

Member Typedef Documentation

◆ FunctionInputType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::FunctionInputType = typename TFunction::InputType

Type of vector used to store location info in the spatial function

Definition at line 54 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ FunctionType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::FunctionType = TFunction

Type of function

Definition at line 51 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ ImageType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::ImageType = TImage

Image type alias support

Definition at line 72 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ IndexType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::IndexType = typename TImage::IndexType

Index type alias support

Definition at line 57 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ InternalPixelType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::InternalPixelType = typename TImage::InternalPixelType

Internal Pixel Type

Definition at line 75 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ NeighborhoodIteratorType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::NeighborhoodIteratorType = typename itk::ShapedNeighborhoodIterator<ImageType>

Internal Neighborhood Iterator Type

Definition at line 81 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ OffsetType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::OffsetType = typename TImage::OffsetType

Offset type alias support

Definition at line 63 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ PixelType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::PixelType = typename TImage::PixelType

External Pixel Type

Definition at line 78 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ RegionType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::RegionType = typename TImage::RegionType

Region type alias support

Definition at line 69 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ SeedsContainerType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::SeedsContainerType = typename std::vector<IndexType>

Index Container Type

Definition at line 60 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ Self

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::Self = ShapedFloodFilledFunctionConditionalConstIterator

Standard class type aliases.

Definition at line 48 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ SizeType

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::SizeType = typename TImage::SizeType

Size type alias support

Definition at line 66 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ TTempImage

template<typename TImage , typename TFunction >
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::TTempImage = Image<unsigned char, Self::NDimensions>
protected

A temporary image used for storing info about indices 0 = pixel has not yet been processed 1 = pixel is not inside the function 2 = pixel is inside the function, neighbor check incomplete 3 = pixel is inside the function, neighbor check complete

Definition at line 260 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

Constructor & Destructor Documentation

◆ ShapedFloodFilledFunctionConditionalConstIterator() [1/3]

template<typename TImage , typename TFunction >
itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::ShapedFloodFilledFunctionConditionalConstIterator ( const ImageType imagePtr,
FunctionType fnPtr,
IndexType  startIndex 
)

Constructor establishes an iterator to walk a particular image and a particular region of that image. This version of the constructor uses an explicit seed pixel for the flood fill, the "startIndex"

◆ ShapedFloodFilledFunctionConditionalConstIterator() [2/3]

template<typename TImage , typename TFunction >
itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::ShapedFloodFilledFunctionConditionalConstIterator ( const ImageType imagePtr,
FunctionType fnPtr,
std::vector< IndexType > &  startIndex 
)

Constructor establishes an iterator to walk a particular image and a particular region of that image. This version of the constructor uses a list of seed pixels for the flood fill

◆ ShapedFloodFilledFunctionConditionalConstIterator() [3/3]

template<typename TImage , typename TFunction >
itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::ShapedFloodFilledFunctionConditionalConstIterator ( const ImageType imagePtr,
FunctionType fnPtr 
)

Constructor establishes an iterator to walk a particular image and a particular region of that image. This version of the constructor should be used when the seed pixel is unknown

◆ ~ShapedFloodFilledFunctionConditionalConstIterator()

template<typename TImage , typename TFunction >
itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::~ShapedFloodFilledFunctionConditionalConstIterator ( )
overridedefault

Default Destructor.

Member Function Documentation

◆ AddSeed()

template<typename TImage , typename TFunction >
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::AddSeed ( const IndexType  seed)
inline

Put more seeds on the list

Definition at line 173 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ ClearSeeds()

template<typename TImage , typename TFunction >
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::ClearSeeds ( )
inline

Clear all the seeds

Definition at line 180 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ DoFloodStep()

template<typename TImage , typename TFunction >
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::DoFloodStep ( )

◆ FindSeedPixel()

template<typename TImage , typename TFunction >
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::FindSeedPixel ( )

Automatically find a seed pixel and set m_StartIndex. Does nothing if a seed pixel isn't found. A seed pixel is determined by traversing the input image's LargestPossibleRegion and applying the IsPixelIncluded() test.

◆ FindSeedPixels()

template<typename TImage , typename TFunction >
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::FindSeedPixels ( )

Automatically find all seed pixels.

◆ FullyConnectedOn()

template<typename TImage , typename TFunction >
virtual void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::FullyConnectedOn ( )
virtual

◆ Get()

template<typename TImage , typename TFunction >
const PixelType itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::Get ( ) const
inlineoverridevirtual

◆ GetFullyConnected()

template<typename TImage , typename TFunction >
bool itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::GetFullyConnected ( ) const

◆ GetFunction()

template<typename TImage , typename TFunction >
virtual SmartPointer<FunctionType> itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::GetFunction ( ) const
inlinevirtual

◆ GetIndex()

template<typename TImage , typename TFunction >
const IndexType itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::GetIndex ( )
inlineoverridevirtual

Get the index. This provides a read only reference to the index. This causes the index to be calculated from pointer arithmetic and is therefore an expensive operation.

See also
SetIndex

Implements itk::ConditionalConstIterator< TImage >.

Definition at line 152 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ GetIteratorDimension()

template<typename TImage , typename TFunction >
static unsigned int itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::GetIteratorDimension ( )
inlinestatic

Get the dimension (size) of the index.

Definition at line 142 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ GetSeeds()

template<typename TImage , typename TFunction >
virtual const SeedsContainerType& itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::GetSeeds ( ) const
inlinevirtual

◆ GoToBegin()

template<typename TImage , typename TFunction >
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::GoToBegin ( )
inline

Move an iterator to the beginning of the region. "Begin" is defined as the first pixel in the region.

Definition at line 188 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ InitializeIterator()

template<typename TImage , typename TFunction >
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::InitializeIterator ( )

Initializes the iterator, called from constructor

◆ IsAtEnd()

template<typename TImage , typename TFunction >
bool itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::IsAtEnd ( ) const
inlineoverridevirtual

Is the iterator at the end of the region?

Implements itk::ConditionalConstIterator< TImage >.

Definition at line 166 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ IsPixelIncluded()

template<typename TImage , typename TFunction >
bool itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::IsPixelIncluded ( const IndexType index) const
overridepure virtual

Compute whether the index of interest should be included in the flood

Implements itk::ConditionalConstIterator< TImage >.

Implemented in itk::ShapedFloodFilledImageFunctionConditionalConstIterator< TImage, TFunction >.

◆ operator++()

template<typename TImage , typename TFunction >
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::operator++ ( )
inlineoverridevirtual

Walk forward one index

Implements itk::ConditionalConstIterator< TImage >.

Definition at line 219 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ operator=()

template<typename TImage , typename TFunction >
Self& itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::operator= ( const Self it)
inline

operator= is provided to make sure the handle to the image is properly reference counted.

Definition at line 133 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

References itk::ConditionalConstIterator< TImage >::m_Image, and itk::ConditionalConstIterator< TImage >::m_Region.

◆ SetFullyConnected()

template<typename TImage , typename TFunction >
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::SetFullyConnected ( const bool  _arg)

When m_FullyConnected is set to true, the neighborhood iterator will inspect an 8 respectively 26 neighborhood. When the value is set to false, the neighborhood will be 4 in 2D and 6 in 3D.

Member Data Documentation

◆ m_FoundUncheckedNeighbor

template<typename TImage , typename TFunction >
bool itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_FoundUncheckedNeighbor {}
protected

Indicates whether or not we've found a neighbor that needs to be checked.

Definition at line 287 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_FullyConnected

template<typename TImage , typename TFunction >
bool itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_FullyConnected {}
protected

Defines the connectivity of the neighborhood iterator. In case of 2D the default connectivity is 4 (6 in 3D) and when m_FullyConnected is set to true the connectivity is 8 (26 in 3D).

Definition at line 297 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_Function

template<typename TImage , typename TFunction >
SmartPointer<FunctionType> itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_Function {}
protected

Smart pointer to the function we're evaluating

Definition at line 253 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_ImageOrigin

template<typename TImage , typename TFunction >
ImageType::PointType itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_ImageOrigin {}
protected

The origin of the source image

Definition at line 268 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_ImageRegion

template<typename TImage , typename TFunction >
RegionType itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_ImageRegion {}
protected

Region of the source image

Definition at line 277 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_ImageSpacing

template<typename TImage , typename TFunction >
ImageType::SpacingType itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_ImageSpacing {}
protected

The spacing of the source image

Definition at line 271 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_IndexStack

template<typename TImage , typename TFunction >
std::queue<IndexType> itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_IndexStack {}
protected

◆ m_IsValidIndex

template<typename TImage , typename TFunction >
bool itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_IsValidIndex {}
protected

Indicates whether or not an index is valid (inside an image)/

Definition at line 290 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_LocationVector

template<typename TImage , typename TFunction >
FunctionInputType itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_LocationVector {}
protected

Location vector used in the flood algorithm

Definition at line 283 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_NeighborhoodIterator

template<typename TImage , typename TFunction >
NeighborhoodIteratorType itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_NeighborhoodIterator {}
protected

The neighborhood iterator

Definition at line 274 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_Seeds

template<typename TImage , typename TFunction >
SeedsContainerType itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_Seeds {}
protected

A list of locations to start the recursive fill

Definition at line 265 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.

◆ m_TempPtr

template<typename TImage , typename TFunction >
TTempImage::Pointer itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::m_TempPtr {}
protected

◆ NDimensions

template<typename TImage , typename TFunction >
constexpr unsigned int itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::NDimensions = TImage::ImageDimension
staticconstexpr

Dimension of the image the iterator walks. This constant is needed so that functions that are templated over image iterator type (as opposed to being templated over pixel type and dimension) can have compile time access to the dimension of the image that the iterator walks.

Definition at line 87 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.


The documentation for this class was generated from the following file: