Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

/home/glehmann/rpm/BUILD/InsightToolkit-2.8.1/Code/Common/itkImageLinearConstIteratorWithIndex.h Class Reference

#include <itkImageLinearConstIteratorWithIndex.h>


Detailed Description

A multi-dimensional image iterator that visits image pixels within a region in a "scan-line" order.

ImageLinearConstIteratorWithIndex is templated over image type and is constrained to walk within a specified image region. It is designed for line-by-line processing of images. This iterator walks a linear path along a selected image direction that is parallel to one of the coordinate axes of the image. The iterator conceptually breaks the image into a set of parallel lines that span the selected image dimension.

ImageLinearConstIteratorWithIndex assumes a particular layout of the image data. The is arranged in a 1D array as if it were [][][][slice][row][col] with Index[0] = col, Index[1] = row, Index[2] = slice, etc.

operator++ provides a simple syntax for walking around a region of a multidimensional image. operator++ iterates across a preselected direction constraining the movement to within a region of image. The user can verify when the iterator reaches the boundary of the region along this direction, by calling the IsAtEndOfLine() method. Then it is possible to pass to the next line starting at the first pixel in the row that is part of the region by calling the NextLine() method.

This is the typical use of this iterator in a loop:

 ImageLinearConstIteratorWithIndex<ImageType> it( image, image->GetRequestedRegion() );
 
 it.SetDirection(2);
 it.GoToBegin();
 while( !it.IsAtEnd() )
 {
   while( !it.IsAtEndOfLine() )
   {
      value = it.Get();  // it.Set() doesn't exist in the Const Iterator
      ++it;
   }
   it.NextLine();
  } 


The documentation for this class was generated from the following file:
Generated at Fri Sep 8 04:26:58 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000