#include <itkPathConstIterator.h>
PathConstIterator iterates (traces) over a path through an image.
This iterator visits only those indices of the image that are overlapped by a specified 1D path. All indices are visited in path order. If a path crosses itself at an index, that index of the image will be visited twice. An exception to this rule is that if the path is closed, i.e. its starting and ending indices are coincident. When starting and ending indices are coincident, GoToBegin() will go to the second index, since the "first" index will be visited later as the "last" index. This is so that paths (especially parametric paths) can be properly closed, without double-visiting the starting/ending point. This behavior can be overridden by calling VisitStartIndexAsLastIndexIfClosed(false) before calling GoToBegin(). This class is the const version of the PathIterator, and for this reason it doesn't support the Set() method.
Definition at line 75 of file itkPathConstIterator.h.
Public Types | |
using | AccessorType = typename TImage::AccessorType |
using | ImageType = TImage |
using | IndexType = typename TImage::IndexType |
using | InternalPixelType = typename TImage::InternalPixelType |
using | OffsetType = typename TImage::OffsetType |
using | PathInputType = typename PathType::InputType |
using | PathOutputType = typename PathType::OutputType |
using | PathType = TPath |
using | PixelContainer = typename TImage::PixelContainer |
using | PixelContainerPointer = typename PixelContainer::Pointer |
using | PixelType = typename TImage::PixelType |
using | PointType = typename TImage::PointType |
using | RegionType = typename TImage::RegionType |
using | Self = PathConstIterator |
using | SizeType = typename TImage::SizeType |
using | SpacingType = typename TImage::SpacingType |
Public Member Functions | |
const PixelType & | Get () const |
const IndexType | GetIndex () |
virtual const char * | GetNameOfClass () const |
const PathInputType | GetPathPosition () |
void | GoToBegin () |
bool | IsAtEnd () const |
void | operator++ () |
Self & | operator= (const Self &it) |
PathConstIterator (const ImageType *imagePtr, const PathType *pathPtr) | |
virtual void | VisitStartIndexAsLastIndexIfClosed (bool flag) |
virtual | ~PathConstIterator ()=default |
Static Public Member Functions | |
static unsigned int | GetImageIteratorDimension () |
Static Public Attributes | |
static constexpr unsigned int | ImageIteratorDimension = TImage::ImageDimension |
Protected Attributes | |
IndexType | m_CurrentImageIndex {} |
PathInputType | m_CurrentPathPosition {} |
ImageType::ConstWeakPointer | m_Image {} |
PointType | m_ImageOrigin {} |
const SizeValueType * | m_ImageSize {} |
SpacingType | m_ImageSpacing {} |
bool | m_IsAtEnd {} |
PathType::ConstPointer | m_Path {} |
RegionType | m_Region {} |
bool | m_VisitStartIndexAsLastIndexIfClosed {} |
OffsetType | m_ZeroOffset {} |
using itk::PathConstIterator< TImage, TPath >::AccessorType = typename TImage::AccessorType |
Accessor type that convert data between internal and external representations.
Definition at line 122 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::ImageType = TImage |
Image type alias support
Definition at line 106 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::IndexType = typename TImage::IndexType |
Index type alias support
Definition at line 88 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::InternalPixelType = typename TImage::InternalPixelType |
Internal Pixel Type
Definition at line 115 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::OffsetType = typename TImage::OffsetType |
Offset type alias support
Definition at line 91 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::PathInputType = typename PathType::InputType |
Path 1D Input Type
Definition at line 128 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::PathOutputType = typename PathType::OutputType |
Path ND Output Type, which is not necessarily an index type
Definition at line 131 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::PathType = TPath |
Path type alias support
Definition at line 125 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::PixelContainer = typename TImage::PixelContainer |
PixelContainer type alias support Used to refer to the container for the pixel data. While this was already typedef'ed in the superclass it needs to be redone here for this subclass to compile properly with gcc.
Definition at line 111 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::PixelContainerPointer = typename PixelContainer::Pointer |
Definition at line 112 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::PixelType = typename TImage::PixelType |
External Pixel Type
Definition at line 118 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::PointType = typename TImage::PointType |
Origin type alias support
Definition at line 103 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::RegionType = typename TImage::RegionType |
Region type alias support
Definition at line 97 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::Self = PathConstIterator |
Standard class type aliases.
Definition at line 79 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::SizeType = typename TImage::SizeType |
Size type alias support
Definition at line 94 of file itkPathConstIterator.h.
using itk::PathConstIterator< TImage, TPath >::SpacingType = typename TImage::SpacingType |
Spacing type alias support
Definition at line 100 of file itkPathConstIterator.h.
itk::PathConstIterator< TImage, TPath >::PathConstIterator | ( | const ImageType * | imagePtr, |
const PathType * | pathPtr ) |
Constructor establishes an iterator to walk along a path
Referenced by GetNameOfClass().
|
virtualdefault |
Default Destructor.
|
inline |
Get the pixel value
Definition at line 159 of file itkPathConstIterator.h.
References m_CurrentImageIndex, and m_Image.
|
inlinestatic |
Get the dimension (size) of the index.
Definition at line 138 of file itkPathConstIterator.h.
|
inline |
Get the index. This provides a read only reference to the index.
Definition at line 152 of file itkPathConstIterator.h.
References m_CurrentImageIndex.
|
virtual |
Reimplemented in itk::PathIterator< TImage, TPath >.
References PathConstIterator().
|
inline |
Get the input. This provides a read only reference to the input.
Definition at line 145 of file itkPathConstIterator.h.
References m_CurrentPathPosition.
void itk::PathConstIterator< TImage, TPath >::GoToBegin | ( | ) |
Move an iterator to the beginning of the path. If the starting and ending indices of the path are coincident, then move to the 2'nd index of the path, since the 1'st index will be visited later as the last index. However, if m_VisitStartIndexAsLastIndexIfClosed is false, then GoToBegin() will always move to the 1'st index.
|
inline |
Is the iterator at the end of the path? Note that for a closed path, it may be possible to increment back to the start of the path.
Definition at line 168 of file itkPathConstIterator.h.
References m_IsAtEnd.
void itk::PathConstIterator< TImage, TPath >::operator++ | ( | ) |
Walk forward along the path to the next index in the image.
Self & itk::PathConstIterator< TImage, TPath >::operator= | ( | const Self & | it | ) |
operator= is provided to make sure the handles to the image and path are properly reference counted.
|
inlinevirtual |
Should GoToBegin() initially skip the first index of a closed path so that the first index will only be visited once–at the end of the path? If set to false, then GoToBegin() will always move to the 1'st index. The constructor presets m_VisitStartIndexAsLastIndexIfClosed to true.
Definition at line 178 of file itkPathConstIterator.h.
References m_VisitStartIndexAsLastIndexIfClosed.
|
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 85 of file itkPathConstIterator.h.
|
protected |
Current ND index position in the image of the path
Definition at line 241 of file itkPathConstIterator.h.
Referenced by Get(), GetIndex(), and itk::PathIterator< TImage, TPath >::Set().
|
protected |
Current 1D position along the path, such as time or arc length
Definition at line 238 of file itkPathConstIterator.h.
Referenced by GetPathPosition().
|
protected |
Smart pointer to the source image.
Definition at line 211 of file itkPathConstIterator.h.
Referenced by Get(), and itk::PathIterator< TImage, TPath >::Set().
|
protected |
The origin of the source image
Definition at line 220 of file itkPathConstIterator.h.
|
protected |
Size of the source image
Definition at line 226 of file itkPathConstIterator.h.
|
protected |
The spacing of the source image
Definition at line 223 of file itkPathConstIterator.h.
|
protected |
Is the iterator at the end of its walk?
Definition at line 235 of file itkPathConstIterator.h.
Referenced by IsAtEnd().
|
protected |
Smart pointer to the path we're following
Definition at line 214 of file itkPathConstIterator.h.
|
protected |
Region type to iterate over.
Definition at line 217 of file itkPathConstIterator.h.
|
protected |
Should GoToBegin() initially skip the first index of a closed path so that the first index will only be visited once–at the end of the path? If false, then GoToBegin() will always move to the 1'st index. The default value is true, which is set the constructor.
Definition at line 232 of file itkPathConstIterator.h.
Referenced by VisitStartIndexAsLastIndexIfClosed().
|
protected |
Definition at line 208 of file itkPathConstIterator.h.