ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Attributes | List of all members
itk::LineIterator< TImage > Class Template Reference

#include <itkLineIterator.h>

Detailed Description

template<typename TImage>
class itk::LineIterator< TImage >

An iterator that walks a Bresenham line through an ND image with write access to pixels.

LineIterator is an iterator that walks a Bresenham line through an image. The iterator is constructed similar to other image iterators, except instead of specifying a region to traverse, you specify two indices. The interval specified by the two indices is closed. So, a line iterator specified with the same start and end index will visit exactly one pixel.

LineConstIterator<ImageType> it(image, I1, I2);
while (!it.IsAtEnd())
{
// visits at least 1 pixel
}
Author
Benjamin King, Experimentelle Radiologie, Medizinische Hochschule Hannover.
See also
LineConstIterator
ITK Sphinx Examples:
  • <a href=
  • <a href=

Definition at line 56 of file itkLineIterator.h.

+ Inheritance diagram for itk::LineIterator< TImage >:
+ Collaboration diagram for itk::LineIterator< TImage >:

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 PixelContainer = typename TImage::PixelContainer
 
using PixelContainerPointer = typename PixelContainer::Pointer
 
using PixelType = typename TImage::PixelType
 
using RegionType = typename TImage::RegionType
 
using Self = LineIterator
 
using SizeType = typename TImage::SizeType
 
using Superclass = LineConstIterator< TImage >
 
- Public Types inherited from itk::LineConstIterator< TImage >
using AccessorType = typename TImage::AccessorType
 
using ImageType = TImage
 
using IndexType = typename TImage::IndexType
 
using InternalPixelType = typename TImage::InternalPixelType
 
using OffsetType = typename TImage::OffsetType
 
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 = LineConstIterator
 
using SizeType = typename TImage::SizeType
 
using SpacingType = typename TImage::SpacingType
 

Public Member Functions

const char * GetNameOfClass () const override
 
 LineIterator (ImageType *imagePtr, const IndexType &firstIndex, const IndexType &lastIndex)
 
Selfoperator= (const Self &it)
 
const PixelTypeValue ()
 
 ~LineIterator () override=default
 
void Set (const PixelType &value)
 
- Public Member Functions inherited from itk::LineConstIterator< TImage >
const PixelType Get () const
 
const IndexType GetIndex ()
 
virtual const char * GetNameOfClass () const
 
void GoToBegin ()
 
bool IsAtEnd () const
 
 LineConstIterator (const ImageType *imagePtr, const IndexType &firstIndex, const IndexType &lastIndex)
 
void operator++ ()
 
Selfoperator= (const Self &it)
 
virtual ~LineConstIterator ()=default
 

Static Public Attributes

static constexpr unsigned int ImageIteratorDimension = TImage::ImageDimension
 
- Static Public Attributes inherited from itk::LineConstIterator< TImage >
static constexpr unsigned int ImageIteratorDimension = TImage::ImageDimension
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::LineConstIterator< TImage >
static unsigned int GetImageIteratorDimension ()
 
- Protected Attributes inherited from itk::LineConstIterator< TImage >
IndexType m_AccumulateError {}
 
IndexType m_CurrentImageIndex {}
 
IndexType m_EndIndex {}
 
ImageType::ConstWeakPointer m_Image {}
 
IndexType m_IncrementError {}
 
bool m_IsAtEnd {}
 
IndexType m_LastIndex {}
 
unsigned int m_MainDirection {}
 
IndexType m_MaximalError {}
 
IndexType m_OverflowIncrement {}
 
IndexType m_ReduceErrorAfterIncrement {}
 
RegionType m_Region {}
 
IndexType m_StartIndex {}
 

Member Typedef Documentation

◆ AccessorType

template<typename TImage >
using itk::LineConstIterator< TImage >::AccessorType = typename TImage::AccessorType

Accessor type that convert data between internal and external representations.

Definition at line 104 of file itkLineConstIterator.h.

◆ ImageType

template<typename TImage >
using itk::LineConstIterator< TImage >::ImageType = TImage

Image type alias support

Definition at line 88 of file itkLineConstIterator.h.

◆ IndexType

template<typename TImage >
using itk::LineConstIterator< TImage >::IndexType = typename TImage::IndexType

Index type alias support

Definition at line 70 of file itkLineConstIterator.h.

◆ InternalPixelType

template<typename TImage >
using itk::LineConstIterator< TImage >::InternalPixelType = typename TImage::InternalPixelType

Internal Pixel Type

Definition at line 97 of file itkLineConstIterator.h.

◆ OffsetType

template<typename TImage >
using itk::LineConstIterator< TImage >::OffsetType = typename TImage::OffsetType

Offset type alias support

Definition at line 73 of file itkLineConstIterator.h.

◆ PixelContainer

template<typename TImage >
using itk::LineConstIterator< TImage >::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 93 of file itkLineConstIterator.h.

◆ PixelContainerPointer

template<typename TImage >
using itk::LineConstIterator< TImage >::PixelContainerPointer = typename PixelContainer::Pointer

Definition at line 94 of file itkLineConstIterator.h.

◆ PixelType

template<typename TImage >
using itk::LineConstIterator< TImage >::PixelType = typename TImage::PixelType

External Pixel Type

Definition at line 100 of file itkLineConstIterator.h.

◆ RegionType

template<typename TImage >
using itk::LineConstIterator< TImage >::RegionType = typename TImage::RegionType

Region type alias support

Definition at line 79 of file itkLineConstIterator.h.

◆ Self

template<typename TImage >
using itk::LineIterator< TImage >::Self = LineIterator

Standard class type aliases.

Definition at line 61 of file itkLineIterator.h.

◆ SizeType

template<typename TImage >
using itk::LineConstIterator< TImage >::SizeType = typename TImage::SizeType

Size type alias support

Definition at line 76 of file itkLineConstIterator.h.

◆ Superclass

template<typename TImage >
using itk::LineIterator< TImage >::Superclass = LineConstIterator<TImage>

Define the superclass

Definition at line 70 of file itkLineIterator.h.

Constructor & Destructor Documentation

◆ LineIterator()

template<typename TImage >
itk::LineIterator< TImage >::LineIterator ( ImageType imagePtr,
const IndexType firstIndex,
const IndexType lastIndex 
)

Constructor establishes an iterator to walk along a path

◆ ~LineIterator()

template<typename TImage >
itk::LineIterator< TImage >::~LineIterator ( )
overridedefault

Default Destructor.

Member Function Documentation

◆ GetNameOfClass()

template<typename TImage >
const char * itk::LineIterator< TImage >::GetNameOfClass ( ) const
overridevirtual

◆ operator=()

template<typename TImage >
Self & itk::LineIterator< TImage >::operator= ( const Self it)

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

◆ Set()

template<typename TImage >
void itk::LineIterator< TImage >::Set ( const PixelType value)
inline

Set the pixel value

Definition at line 89 of file itkLineIterator.h.

◆ Value()

template<typename TImage >
const PixelType & itk::LineIterator< TImage >::Value ( )
inline

Return a reference to the pixel. This method will provide the fastest access to pixel data, but it will NOT support ImageAdaptors.

Definition at line 103 of file itkLineIterator.h.

Member Data Documentation

◆ ImageIteratorDimension

template<typename TImage >
constexpr unsigned int itk::LineIterator< TImage >::ImageIteratorDimension = TImage::ImageDimension
staticconstexpr

Dimension of the image that 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 67 of file itkLineIterator.h.


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