18 #ifndef itkImageLinearConstIteratorWithIndex_h
19 #define itkImageLinearConstIteratorWithIndex_h
100 template<
typename TImage >
154 inline void NextLine();
158 inline void PreviousLine();
162 void GoToBeginOfLine();
166 void GoToReverseBeginOfLine();
170 void GoToEndOfLine();
175 return this->m_PositionIndex[m_Direction] >= this->m_EndIndex[m_Direction];
181 return this->m_PositionIndex[m_Direction] < this->m_BeginIndex[m_Direction];
187 if ( direction >= TImage::ImageDimension )
189 itkGenericExceptionMacro(
190 <<
"In image of dimension " << TImage::ImageDimension <<
" Direction " << direction <<
" sas selected");
192 m_Direction = direction;
193 m_Jump = this->m_OffsetTable[m_Direction];
207 this->m_PositionIndex[m_Direction]++;
208 this->m_Position += m_Jump;
217 this->m_PositionIndex[m_Direction]--;
218 this->m_Position -= m_Jump;
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
A multi-dimensional image iterator that visits image pixels within a region in a "scan-line" order...
ImageLinearConstIteratorWithIndex()
A base class for multi-dimensional iterators templated over image type that are designed to efficient...
TImage::PixelContainer PixelContainer
unsigned int GetDirection()
TImage::RegionType RegionType
TImage::IndexType IndexType
void SetDirection(unsigned int direction)
ImageLinearConstIteratorWithIndex Self
bool IsAtReverseEndOfLine(void)
PixelContainer::Pointer PixelContainerPointer
Self & operator=(const Self &it)
ImageBaseType::IndexType IndexType