18 #ifndef itkImageLinearConstIteratorWithIndex_h
19 #define itkImageLinearConstIteratorWithIndex_h
100 template<
typename TImage >
153 inline void NextLine();
157 inline void PreviousLine();
161 void GoToBeginOfLine();
165 void GoToReverseBeginOfLine();
169 void GoToEndOfLine();
174 return this->m_PositionIndex[m_Direction] >= this->m_EndIndex[m_Direction];
180 return this->m_PositionIndex[m_Direction] < this->m_BeginIndex[m_Direction];
186 if ( direction >= TImage::ImageDimension )
188 itkGenericExceptionMacro(
189 <<
"In image of dimension " << TImage::ImageDimension <<
" Direction " << direction <<
" sas selected");
191 m_Direction = direction;
192 m_Jump = this->m_OffsetTable[m_Direction];
206 this->m_PositionIndex[m_Direction]++;
207 this->m_Position += m_Jump;
216 this->m_PositionIndex[m_Direction]--;
217 this->m_Position -= m_Jump;
224 unsigned int m_Direction{0};
230 template<
typename TImage >
236 this->m_Position -= this->m_OffsetTable[m_Direction]
237 * ( this->m_PositionIndex[m_Direction] - this->m_BeginIndex[m_Direction] );
239 this->m_PositionIndex[m_Direction] = this->m_BeginIndex[m_Direction];
241 for (
unsigned int n = 0; n < TImage::ImageDimension; n++ )
243 this->m_Remaining =
false;
245 if ( n == m_Direction )
250 this->m_PositionIndex[n]++;
251 if ( this->m_PositionIndex[n] < this->m_EndIndex[n] )
253 this->m_Position += this->m_OffsetTable[n];
254 this->m_Remaining =
true;
259 this->m_Position -= this->m_OffsetTable[n] * ( this->m_Region.GetSize()[n] - 1 );
260 this->m_PositionIndex[n] = this->m_BeginIndex[n];
268 template<
typename TImage >
274 this->m_Position += this->m_OffsetTable[m_Direction]
275 * ( this->m_EndIndex[m_Direction] - 1 - this->m_PositionIndex[m_Direction] );
277 this->m_PositionIndex[m_Direction] = this->m_EndIndex[m_Direction] - 1;
279 for (
unsigned int n = 0; n < TImage::ImageDimension; n++ )
281 this->m_Remaining =
false;
283 if ( n == m_Direction )
288 this->m_PositionIndex[n]--;
289 if ( this->m_PositionIndex[n] >= this->m_BeginIndex[n] )
291 this->m_Position -= this->m_OffsetTable[n];
292 this->m_Remaining =
true;
297 this->m_Position += this->m_OffsetTable[n] * ( this->m_Region.GetSize()[n] - 1 );
298 this->m_PositionIndex[n] = this->m_EndIndex[n] - 1;
304 #ifndef ITK_MANUAL_INSTANTIATION
305 #include "itkImageLinearConstIteratorWithIndex.hxx"
bool IsAtEndOfLine() const
ImageLinearConstIteratorWithIndex(const ImageConstIteratorWithIndex< TImage > &it)
typename PixelContainer::Pointer PixelContainerPointer
typename OffsetType::OffsetValueType OffsetValueType
A multi-dimensional image iterator that visits image pixels within a region in a "scan-line" order...
bool IsAtReverseEndOfLine() const
ImageLinearConstIteratorWithIndex()
A base class for multi-dimensional iterators templated over image type that are designed to efficient...
unsigned int GetDirection()
ImageBaseType::IndexType IndexType
typename TImageType::IndexType IndexType
typename TImageType::RegionType RegionType
void SetDirection(unsigned int direction)
typename TImageType::PixelContainer PixelContainer
ImageBaseType::RegionType RegionType
Self & operator=(const Self &it)