Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes

itk::LineIterator< TImage > Class Template Reference

Iterator that walks a Bresenham line through an ND image. More...

#include <itkLineIterator.h>

Inheritance diagram for itk::LineIterator< TImage >:
Inheritance graph
[legend]
Collaboration diagram for itk::LineIterator< TImage >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Superclass::AccessorType AccessorType
typedef Superclass::ImageType ImageType
typedef Superclass::IndexType IndexType
typedef Superclass::IndexValueType IndexValueType
typedef
Superclass::InternalPixelType 
InternalPixelType
typedef Superclass::OffsetType OffsetType
typedef Superclass::OffsetValueType OffsetValueType
typedef Superclass::PixelContainer PixelContainer
typedef
Superclass::PixelContainerPointer 
PixelContainerPointer
typedef Superclass::PixelType PixelType
typedef TImage::PointType PointType
typedef Superclass::RegionType RegionType
typedef LineIterator Self
typedef Superclass::SizeType SizeType
typedef Superclass::SizeValueType SizeValueType
typedef TImage::SpacingType SpacingType
typedef LineConstIterator< TImage > Superclass

Public Member Functions

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

void Set (const PixelType &value)

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

Detailed Description

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

Iterator that walks a Bresenham line through an ND image.

LineIterator is an iterator that walks a Bresenham line through an image. The iterator is constructed similar to other image iterators except for 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
 }

This class was contributed by Benjamin King, Experimentelle Radiologie, Medizinische Hochschule Hannover.

See also:
LineConstIterator

Definition at line 52 of file itkLineIterator.h.


Member Typedef Documentation

template<class TImage >
typedef Superclass::AccessorType itk::LineIterator< TImage >::AccessorType

Accessor type that convert data between internal and external representations.

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 82 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::ImageType itk::LineIterator< TImage >::ImageType

Image typedef support.

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 77 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::IndexType itk::LineIterator< TImage >::IndexType

Inherit types from the superclass

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 70 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::IndexValueType itk::LineIterator< TImage >::IndexValueType

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 71 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::InternalPixelType itk::LineIterator< TImage >::InternalPixelType

Internal Pixel Type

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 80 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::OffsetType itk::LineIterator< TImage >::OffsetType

Offset typedef support.

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 72 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::OffsetValueType itk::LineIterator< TImage >::OffsetValueType

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 73 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::PixelContainer itk::LineIterator< 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.

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 78 of file itkLineIterator.h.

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 79 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::PixelType itk::LineIterator< TImage >::PixelType

External Pixel Type

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 81 of file itkLineIterator.h.

template<class TImage >
typedef TImage::PointType itk::LineConstIterator< TImage >::PointType [inherited]

Origin typedef support

Definition at line 83 of file itkLineConstIterator.h.

template<class TImage >
typedef Superclass::RegionType itk::LineIterator< TImage >::RegionType

Region typedef support

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 76 of file itkLineIterator.h.

template<class TImage >
typedef LineIterator itk::LineIterator< TImage >::Self

Standard class typedefs.

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 57 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::SizeType itk::LineIterator< TImage >::SizeType

Size typedef support.

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 74 of file itkLineIterator.h.

template<class TImage >
typedef Superclass::SizeValueType itk::LineIterator< TImage >::SizeValueType

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 75 of file itkLineIterator.h.

template<class TImage >
typedef TImage::SpacingType itk::LineConstIterator< TImage >::SpacingType [inherited]

Spacing typedef support

Definition at line 80 of file itkLineConstIterator.h.

template<class TImage >
typedef LineConstIterator<TImage> itk::LineIterator< TImage >::Superclass

Define the superclass

Definition at line 67 of file itkLineIterator.h.


Constructor & Destructor Documentation

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

Constructor establishes an iterator to walk along a path

template<class TImage >
virtual itk::LineIterator< TImage >::~LineIterator (  )  [inline, virtual]

Default Destructor.

Definition at line 116 of file itkLineIterator.h.


Member Function Documentation

template<class TImage >
const PixelType& itk::LineConstIterator< TImage >::Get ( void   )  const [inline, inherited]

Get the pixel value

Definition at line 120 of file itkLineConstIterator.h.

template<class TImage >
static unsigned int itk::LineConstIterator< TImage >::GetImageIteratorDimension (  )  [inline, static, inherited]

Get the dimension (size) of the index.

Definition at line 108 of file itkLineConstIterator.h.

References HardConnectedComponentImageFilter::ImageDimension.

template<class TImage >
const IndexType itk::LineConstIterator< TImage >::GetIndex ( void   )  [inline, inherited]

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

Definition at line 114 of file itkLineConstIterator.h.

template<class TImage >
virtual const char* itk::LineIterator< TImage >::GetNameOfClass (  )  const [virtual]

Run-time type information (and related methods).

Reimplemented from itk::LineConstIterator< TImage >.

template<class TImage >
void itk::LineConstIterator< TImage >::GoToBegin (  )  [inherited]

Move an iterator to the beginning of the line.

template<class TImage >
bool itk::LineConstIterator< TImage >::IsAtEnd ( void   )  [inline, inherited]

Is the iterator at the end of the line?

Definition at line 126 of file itkLineConstIterator.h.

template<class TImage >
void itk::LineConstIterator< TImage >::operator++ (  )  [inherited]

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

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

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

Reimplemented from itk::LineConstIterator< TImage >.

template<class TImage >
void itk::LineIterator< TImage >::Set ( const PixelType value  )  [inline]

Set the pixel value

Definition at line 88 of file itkLineIterator.h.

template<class TImage >
const PixelType& itk::LineIterator< TImage >::Value ( void   )  [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 102 of file itkLineIterator.h.


Member Data Documentation

template<class TImage >
const unsigned int itk::LineIterator< TImage >::ImageIteratorDimension = TImage::ImageDimension [static]

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.

Reimplemented from itk::LineConstIterator< TImage >.

Definition at line 64 of file itkLineIterator.h.

template<class TImage >
IndexType itk::LineConstIterator< TImage >::m_AccumulateError [protected, inherited]

Definition at line 169 of file itkLineConstIterator.h.

template<class TImage >
IndexType itk::LineConstIterator< TImage >::m_CurrentImageIndex [protected, inherited]

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

Definition at line 159 of file itkLineConstIterator.h.

template<class TImage >
IndexType itk::LineConstIterator< TImage >::m_EndIndex [protected, inherited]

Definition at line 162 of file itkLineConstIterator.h.

template<class TImage >
ImageType::ConstWeakPointer itk::LineConstIterator< TImage >::m_Image [protected, inherited]

Smart pointer to the source image.

Definition at line 145 of file itkLineConstIterator.h.

template<class TImage >
IndexType itk::LineConstIterator< TImage >::m_IncrementError [protected, inherited]

Definition at line 173 of file itkLineConstIterator.h.

template<class TImage >
bool itk::LineConstIterator< TImage >::m_IsAtEnd [protected, inherited]

Is the iterator at the end of its walk?

Definition at line 156 of file itkLineConstIterator.h.

template<class TImage >
IndexType itk::LineConstIterator< TImage >::m_LastIndex [protected, inherited]

Definition at line 161 of file itkLineConstIterator.h.

template<class TImage >
unsigned int itk::LineConstIterator< TImage >::m_MainDirection [protected, inherited]

Variables that drive the Bresenham-Algorithm

Definition at line 166 of file itkLineConstIterator.h.

template<class TImage >
IndexType itk::LineConstIterator< TImage >::m_MaximalError [protected, inherited]

Definition at line 177 of file itkLineConstIterator.h.

template<class TImage >
IndexType itk::LineConstIterator< TImage >::m_OverflowIncrement [protected, inherited]

Definition at line 180 of file itkLineConstIterator.h.

template<class TImage >
IndexType itk::LineConstIterator< TImage >::m_ReduceErrorAfterIncrement [protected, inherited]

Definition at line 184 of file itkLineConstIterator.h.

template<class TImage >
RegionType itk::LineConstIterator< TImage >::m_Region [protected, inherited]

Region type to iterate over.

Definition at line 153 of file itkLineConstIterator.h.

template<class TImage >
IndexType itk::LineConstIterator< TImage >::m_StartIndex [protected, inherited]

Definition at line 160 of file itkLineConstIterator.h.


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

Generated at Mon Jul 12 2010 23:56:32 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000