18 #ifndef itkImageLinearConstIteratorWithIndex_h
19 #define itkImageLinearConstIteratorWithIndex_h
100 template<
typename TImage >
187 if ( direction >= TImage::ImageDimension )
189 itkGenericExceptionMacro(
190 <<
"In image of dimension " << TImage::ImageDimension <<
" Direction " << direction <<
" sas selected");
231 template<
typename TImage >
237 this->m_Position -= this->m_OffsetTable[m_Direction]
238 * ( this->m_PositionIndex[m_Direction] - this->m_BeginIndex[m_Direction] );
240 this->m_PositionIndex[m_Direction] = this->m_BeginIndex[m_Direction];
242 for (
unsigned int n = 0; n < TImage::ImageDimension; n++ )
244 this->m_Remaining =
false;
246 if ( n == m_Direction )
251 this->m_PositionIndex[n]++;
252 if ( this->m_PositionIndex[n] < this->m_EndIndex[n] )
254 this->m_Position += this->m_OffsetTable[n];
255 this->m_Remaining =
true;
260 this->m_Position -= this->m_OffsetTable[n] * ( this->m_Region.GetSize()[n] - 1 );
261 this->m_PositionIndex[n] = this->m_BeginIndex[n];
269 template<
typename TImage >
275 this->m_Position += this->m_OffsetTable[m_Direction]
276 * ( this->m_EndIndex[m_Direction] - 1 - this->m_PositionIndex[m_Direction] );
278 this->m_PositionIndex[m_Direction] = this->m_EndIndex[m_Direction] - 1;
280 for (
unsigned int n = 0; n < TImage::ImageDimension; n++ )
282 this->m_Remaining =
false;
284 if ( n == m_Direction )
289 this->m_PositionIndex[n]--;
290 if ( this->m_PositionIndex[n] >= this->m_BeginIndex[n] )
292 this->m_Position -= this->m_OffsetTable[n];
293 this->m_Remaining =
true;
298 this->m_Position += this->m_OffsetTable[n] * ( this->m_Region.GetSize()[n] - 1 );
299 this->m_PositionIndex[n] = this->m_EndIndex[n] - 1;
305 #ifndef ITK_MANUAL_INSTANTIATION
306 #include "itkImageLinearConstIteratorWithIndex.hxx"
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
void GoToReverseBeginOfLine()
TImage::IndexType IndexType
void SetDirection(unsigned int direction)
ImageLinearConstIteratorWithIndex Self
bool IsAtReverseEndOfLine(void)
PixelContainer::Pointer PixelContainerPointer
Self & operator=(const Self &it)