#include <itkImageRegionExclusionConstIteratorWithIndex.h>
ImageRegionExclusionConstIteratorWithIndex is a templated class to represent a multi-dimensional iterator. ImageRegionExclusionConstIteratorWithIndex is templated over the image type. ImageRegionExclusionConstIteratorWithIndex is constrained to walk only within the specified region. The exclusion region is set after construction. By default the exclusion region is empty and the iterator will behave as the itk::ImageRegionIteratorWithIndex with a penalty in performance due to internal bounds checking.
As with other ITK image iterators, ImageRegionExclusionConstIteratorWithIndex requires more information be specified before the iterator can be used than conventional iterators. Whereas the std::vector::iterator from the STL only needs to be passed a pointer to establish the iterator, the multi-dimensional image iterator needs a pointer, the size of the buffer, the size of the region, the start index of the buffer, and the start index of the region. To gain access to this information, ImageRegionExclusionConstIteratorWithIndex holds a reference to the image over which it is traversing.
ImageRegionExclusionConstIteratorWithIndex 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.
The operator++ method provides a simple syntax for walking around a region of a multidimensional image. operator++ iterates across a row, constraining the movement to within a region of image. When the iterator reaches the boundary of the region along a row, the iterator automatically wraps to the next row, starting at the first pixel in the row that is part of the region. This allows for simple processing loops of the form: