#include <itkShapedFloodFilledFunctionConditionalConstIterator.h>
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.
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 |
![]() | |
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 |
Static Public Member Functions | |
static unsigned int | GetIteratorDimension () |
![]() | |
static unsigned int | GetIteratorDimension () |
Static Public Attributes | |
static constexpr unsigned int | NDimensions = TImage::ImageDimension |
![]() | |
static constexpr unsigned int | NDimension = TImage::ImageDimension |
Protected Types | |
using | TTempImage = Image<unsigned char, Self::NDimensions> |
Protected Attributes | |
bool | m_FoundUncheckedNeighbor {} |
bool | m_FullyConnected {} |
SmartPointer< FunctionType > | m_Function {} |
ImageType::PointType | m_ImageOrigin {} |
RegionType | m_ImageRegion {} |
ImageType::SpacingType | m_ImageSpacing {} |
std::queue< IndexType > | m_IndexStack {} |
bool | m_IsValidIndex {} |
FunctionInputType | m_LocationVector {} |
NeighborhoodIteratorType | m_NeighborhoodIterator {} |
SeedsContainerType | m_Seeds {} |
TTempImage::Pointer | m_TempPtr {} |
![]() | |
ImageType::ConstWeakPointer | m_Image {} |
bool | m_IsAtEnd { false } |
RegionType | m_Region {} |
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::FunctionInputType = typename TFunction::InputType |
Type of vector used to store location info in the spatial function
Definition at line 53 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::FunctionType = TFunction |
Type of function
Definition at line 50 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::ImageType = TImage |
Image type alias support
Definition at line 71 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::IndexType = typename TImage::IndexType |
Index type alias support
Definition at line 56 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::InternalPixelType = typename TImage::InternalPixelType |
Internal Pixel Type
Definition at line 74 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::NeighborhoodIteratorType = typename itk::ShapedNeighborhoodIterator<ImageType> |
Internal Neighborhood Iterator Type
Definition at line 80 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::OffsetType = typename TImage::OffsetType |
Offset type alias support
Definition at line 62 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::PixelType = typename TImage::PixelType |
External Pixel Type
Definition at line 77 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::RegionType = typename TImage::RegionType |
Region type alias support
Definition at line 68 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::SeedsContainerType = typename std::vector<IndexType> |
Index Container Type
Definition at line 59 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::Self = ShapedFloodFilledFunctionConditionalConstIterator |
Standard class type aliases.
Definition at line 47 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
using itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::SizeType = typename TImage::SizeType |
Size type alias support
Definition at line 65 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
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 259 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
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"
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
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
|
overridedefault |
Default Destructor.
|
inline |
Put more seeds on the list
Definition at line 172 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References m_Seeds.
|
inline |
Clear all the seeds
Definition at line 179 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References m_Seeds.
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::DoFloodStep | ( | ) |
Referenced by operator++().
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.
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::FindSeedPixels | ( | ) |
Automatically find all seed pixels.
|
virtual |
|
virtual |
|
inlineoverridevirtual |
Get the pixel value
Implements itk::ConditionalConstIterator< TImage >.
Reimplemented in itk::ShapedFloodFilledImageFunctionConditionalIterator< TImage, TFunction >.
Definition at line 158 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References itk::ConditionalConstIterator< TImage >::m_Image, and m_IndexStack.
bool itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::GetFullyConnected | ( | ) | const |
|
inlinevirtual |
Definition at line 227 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References m_Function.
|
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.
Implements itk::ConditionalConstIterator< TImage >.
Definition at line 151 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References m_IndexStack.
|
inlinestatic |
Get the dimension (size) of the index.
Definition at line 141 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
inlinevirtual |
Definition at line 245 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References m_Seeds.
|
inline |
Move an iterator to the beginning of the region. "Begin" is defined as the first pixel in the region.
Definition at line 187 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References itk::ConditionalConstIterator< TImage >::m_Image, m_IndexStack, itk::ConditionalConstIterator< TImage >::m_IsAtEnd, m_Seeds, and m_TempPtr.
void itk::ShapedFloodFilledFunctionConditionalConstIterator< TImage, TFunction >::InitializeIterator | ( | ) |
Initializes the iterator, called from constructor
|
inlineoverridevirtual |
Is the iterator at the end of the region?
Implements itk::ConditionalConstIterator< TImage >.
Definition at line 165 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References itk::ConditionalConstIterator< TImage >::m_IsAtEnd.
|
overridepure virtual |
Compute whether the index of interest should be included in the flood
Implements itk::ConditionalConstIterator< TImage >.
Implemented in itk::ShapedFloodFilledImageFunctionConditionalConstIterator< TImage, TFunction >.
|
inlineoverridevirtual |
Walk forward one index
Implements itk::ConditionalConstIterator< TImage >.
Definition at line 218 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References DoFloodStep().
|
inline |
operator= is provided to make sure the handle to the image is properly reference counted.
Definition at line 132 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
References itk::ConditionalConstIterator< TImage >::m_Image, and itk::ConditionalConstIterator< TImage >::m_Region.
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.
|
protected |
Indicates whether or not we've found a neighbor that needs to be checked.
Definition at line 286 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
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 296 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
protected |
Smart pointer to the function we're evaluating
Definition at line 252 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
Referenced by GetFunction().
|
protected |
The origin of the source image
Definition at line 267 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
protected |
Region of the source image
Definition at line 276 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
protected |
The spacing of the source image
Definition at line 270 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
protected |
Stack used to hold the path of the iterator through the image
Definition at line 279 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
Referenced by Get(), itk::ShapedFloodFilledImageFunctionConditionalIterator< TImage, TFunction >::Get(), GetIndex(), GoToBegin(), and itk::ShapedFloodFilledImageFunctionConditionalIterator< TImage, TFunction >::Set().
|
protected |
Indicates whether or not an index is valid (inside an image)/
Definition at line 289 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
protected |
Location vector used in the flood algorithm
Definition at line 282 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
protected |
The neighborhood iterator
Definition at line 273 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
|
protected |
A list of locations to start the recursive fill
Definition at line 264 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
Referenced by AddSeed(), ClearSeeds(), GetSeeds(), and GoToBegin().
|
protected |
Definition at line 261 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.
Referenced by GoToBegin().
|
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 86 of file itkShapedFloodFilledFunctionConditionalConstIterator.h.