18 #ifndef __itkImageLinearConstIteratorWithIndex_h
19 #define __itkImageLinearConstIteratorWithIndex_h
100 template<
typename TImage >
183 if ( direction >= TImage::ImageDimension )
185 itkGenericExceptionMacro(
186 <<
"In image of dimension " << TImage::ImageDimension <<
" Direction " << direction <<
" sas selected");
227 template<
typename TImage >
233 this->m_Position -= this->m_OffsetTable[m_Direction]
234 * ( this->m_PositionIndex[m_Direction] - this->m_BeginIndex[m_Direction] );
236 this->m_PositionIndex[m_Direction] = this->m_BeginIndex[m_Direction];
238 for (
unsigned int n = 0; n < TImage::ImageDimension; n++ )
240 this->m_Remaining =
false;
242 if ( n == m_Direction )
247 this->m_PositionIndex[n]++;
248 if ( this->m_PositionIndex[n] < this->m_EndIndex[n] )
250 this->m_Position += this->m_OffsetTable[n];
251 this->m_Remaining =
true;
256 this->m_Position -= this->m_OffsetTable[n] * ( this->m_Region.GetSize()[n] - 1 );
257 this->m_PositionIndex[n] = this->m_BeginIndex[n];
265 template<
typename TImage >
271 this->m_Position += this->m_OffsetTable[m_Direction]
272 * ( this->m_EndIndex[m_Direction] - 1 - this->m_PositionIndex[m_Direction] );
274 this->m_PositionIndex[m_Direction] = this->m_EndIndex[m_Direction] - 1;
276 for (
unsigned int n = 0; n < TImage::ImageDimension; n++ )
278 this->m_Remaining =
false;
280 if ( n == m_Direction )
285 this->m_PositionIndex[n]--;
286 if ( this->m_PositionIndex[n] >= this->m_BeginIndex[n] )
288 this->m_Position -= this->m_OffsetTable[n];
289 this->m_Remaining =
true;
294 this->m_Position += this->m_OffsetTable[n] * ( this->m_Region.GetSize()[n] - 1 );
295 this->m_PositionIndex[n] = this->m_EndIndex[n] - 1;
301 #ifndef ITK_MANUAL_INSTANTIATION
302 #include "itkImageLinearConstIteratorWithIndex.hxx"
void GoToBeginOfLine(void)
ImageLinearConstIteratorWithIndex(const ImageConstIteratorWithIndex< TImage > &it)
OffsetType::OffsetValueType OffsetValueType
ImageConstIteratorWithIndex< TImage > Superclass
OffsetValueType m_OffsetTable[ImageDimension+1]
A multi-dimensional image iterator that visits image pixels within a region in a "scan-line" order...
const InternalPixelType * m_Position
ImageLinearConstIteratorWithIndex()
A base class for multi-dimensional iterators templated over image type that are designed to efficient...
TImage::PixelContainer PixelContainer
unsigned int GetDirection()
IndexType m_PositionIndex
TImage::RegionType RegionType
TImage::IndexType IndexType
void SetDirection(unsigned int direction)
ImageLinearConstIteratorWithIndex Self
void GoToReverseBeginOfLine(void)
bool IsAtReverseEndOfLine(void)
PixelContainer::Pointer PixelContainerPointer
Self & operator=(const Self &it)