ITK  4.6.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
itk::LineConstIterator< TImage > Class Template Reference

#include <itkLineConstIterator.h>

+ Inheritance diagram for itk::LineConstIterator< TImage >:

Detailed Description

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

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

LineConstIterator 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.
Wiki Examples:

Definition at line 56 of file itkLineConstIterator.h.

Public Types

typedef TImage::AccessorType AccessorType
 
typedef TImage ImageType
 
typedef TImage::IndexType IndexType
 
typedef TImage::InternalPixelType InternalPixelType
 
typedef TImage::OffsetType OffsetType
 
typedef TImage::PixelContainer PixelContainer
 
typedef PixelContainer::Pointer PixelContainerPointer
 
typedef TImage::PixelType PixelType
 
typedef TImage::PointType PointType
 
typedef TImage::RegionType RegionType
 
typedef LineConstIterator Self
 
typedef TImage::SizeType SizeType
 
typedef TImage::SpacingType SpacingType
 

Public Member Functions

const PixelType Get (void) const
 
const IndexType GetIndex ()
 
virtual const char * GetNameOfClass () const
 
void GoToBegin ()
 
bool IsAtEnd ()
 
 LineConstIterator (const ImageType *imagePtr, const IndexType &firstIndex, const IndexType &lastIndex)
 
void operator++ ()
 
Selfoperator= (const Self &it)
 
virtual ~LineConstIterator ()
 

Static Public Member Functions

static unsigned int GetImageIteratorDimension ()
 

Static Public Attributes

static const unsigned int ImageIteratorDimension = TImage::ImageDimension
 

Protected Attributes

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

template<typename TImage >
typedef TImage::AccessorType itk::LineConstIterator< TImage >::AccessorType

Accessor type that convert data between internal and external representations.

Definition at line 105 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage itk::LineConstIterator< TImage >::ImageType

Image typedef support.

Definition at line 89 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage::IndexType itk::LineConstIterator< TImage >::IndexType

Index typedef support.

Definition at line 71 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage::InternalPixelType itk::LineConstIterator< TImage >::InternalPixelType

Internal Pixel Type

Definition at line 98 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage::OffsetType itk::LineConstIterator< TImage >::OffsetType

Offset typedef support.

Definition at line 74 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage::PixelContainer itk::LineConstIterator< TImage >::PixelContainer

PixelContainer typedef support. Used to refer to the container for the pixel data. While this was already typdef'ed in the superclass, it needs to be redone here for this subclass to compile properly with gcc.

Definition at line 94 of file itkLineConstIterator.h.

template<typename TImage >
typedef PixelContainer::Pointer itk::LineConstIterator< TImage >::PixelContainerPointer

Definition at line 95 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage::PixelType itk::LineConstIterator< TImage >::PixelType

External Pixel Type

Definition at line 101 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage::PointType itk::LineConstIterator< TImage >::PointType

Origin typedef support

Definition at line 86 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage::RegionType itk::LineConstIterator< TImage >::RegionType

Region typedef support

Definition at line 80 of file itkLineConstIterator.h.

template<typename TImage >
typedef LineConstIterator itk::LineConstIterator< TImage >::Self

Standard class typedefs.

Definition at line 61 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage::SizeType itk::LineConstIterator< TImage >::SizeType

Size typedef support.

Definition at line 77 of file itkLineConstIterator.h.

template<typename TImage >
typedef TImage::SpacingType itk::LineConstIterator< TImage >::SpacingType

Spacing typedef support

Definition at line 83 of file itkLineConstIterator.h.

Constructor & Destructor Documentation

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

Constructor establishes an iterator to walk along a line

template<typename TImage >
virtual itk::LineConstIterator< TImage >::~LineConstIterator ( )
inlinevirtual

Default Destructor.

Definition at line 148 of file itkLineConstIterator.h.

Member Function Documentation

template<typename TImage >
const PixelType itk::LineConstIterator< TImage >::Get ( void  ) const
inline
template<typename TImage >
static unsigned int itk::LineConstIterator< TImage >::GetImageIteratorDimension ( )
inlinestatic

Get the dimension (size) of the index.

Definition at line 111 of file itkLineConstIterator.h.

template<typename TImage >
const IndexType itk::LineConstIterator< TImage >::GetIndex ( void  )
inline

Get the index. This provides a read only reference to the index.

Definition at line 117 of file itkLineConstIterator.h.

References itk::LineConstIterator< TImage >::m_CurrentImageIndex.

template<typename TImage >
virtual const char* itk::LineConstIterator< TImage >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented in itk::LineIterator< TImage >.

template<typename TImage >
void itk::LineConstIterator< TImage >::GoToBegin ( )

Move an iterator to the beginning of the line.

template<typename TImage >
bool itk::LineConstIterator< TImage >::IsAtEnd ( void  )
inline

Is the iterator at the end of the line?

Definition at line 129 of file itkLineConstIterator.h.

References itk::LineConstIterator< TImage >::m_IsAtEnd.

template<typename TImage >
void itk::LineConstIterator< TImage >::operator++ ( )

Walk forward along the line to the next index in the image.

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

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

Member Data Documentation

template<typename TImage >
const unsigned int itk::LineConstIterator< TImage >::ImageIteratorDimension = TImage::ImageDimension
static

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 68 of file itkLineConstIterator.h.

template<typename TImage >
IndexType itk::LineConstIterator< TImage >::m_AccumulateError
protected

Definition at line 171 of file itkLineConstIterator.h.

template<typename TImage >
IndexType itk::LineConstIterator< TImage >::m_CurrentImageIndex
protected

Start, end and current ND index position in the image of the line

Definition at line 161 of file itkLineConstIterator.h.

Referenced by itk::LineConstIterator< TImage >::Get(), itk::LineConstIterator< TImage >::GetIndex(), and itk::LineIterator< TImage >::Set().

template<typename TImage >
IndexType itk::LineConstIterator< TImage >::m_EndIndex
protected

Definition at line 164 of file itkLineConstIterator.h.

template<typename TImage >
ImageType::ConstWeakPointer itk::LineConstIterator< TImage >::m_Image
protected

Smart pointer to the source image.

Definition at line 152 of file itkLineConstIterator.h.

Referenced by itk::LineConstIterator< TImage >::Get(), itk::LineIterator< TImage >::Set(), and itk::LineIterator< TImage >::Value().

template<typename TImage >
IndexType itk::LineConstIterator< TImage >::m_IncrementError
protected

Definition at line 175 of file itkLineConstIterator.h.

template<typename TImage >
bool itk::LineConstIterator< TImage >::m_IsAtEnd
protected

Is the iterator at the end of its walk?

Definition at line 158 of file itkLineConstIterator.h.

Referenced by itk::LineConstIterator< TImage >::IsAtEnd().

template<typename TImage >
IndexType itk::LineConstIterator< TImage >::m_LastIndex
protected

Definition at line 163 of file itkLineConstIterator.h.

template<typename TImage >
unsigned int itk::LineConstIterator< TImage >::m_MainDirection
protected

Variables that drive the Bresenham-Algorithm

Definition at line 168 of file itkLineConstIterator.h.

template<typename TImage >
IndexType itk::LineConstIterator< TImage >::m_MaximalError
protected

Definition at line 179 of file itkLineConstIterator.h.

template<typename TImage >
IndexType itk::LineConstIterator< TImage >::m_OverflowIncrement
protected

Definition at line 182 of file itkLineConstIterator.h.

template<typename TImage >
IndexType itk::LineConstIterator< TImage >::m_ReduceErrorAfterIncrement
protected

Definition at line 186 of file itkLineConstIterator.h.

template<typename TImage >
RegionType itk::LineConstIterator< TImage >::m_Region
protected

Region type to iterate over.

Definition at line 155 of file itkLineConstIterator.h.

template<typename TImage >
IndexType itk::LineConstIterator< TImage >::m_StartIndex
protected

Definition at line 162 of file itkLineConstIterator.h.


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