[Insight-developers] problem with image iterator
Ting Chen
chenting@graphics.cis.upenn.edu
Thu, 13 Sep 2001 21:37:08 -0500
Hi! I updated my local copy of itk and found some of my code no longer
works, for instance:
typedef itk::SimpleImageRegionIterator<TOutputImage> ClassImageIterator;
...
ClassImageIterator it( m_Image, region );// the image size 256*256*1
it.Begin();
k = 0;
int t=0;
while ( !it.IsAtEnd() ) {
if (k < it.Get()) k = it.Get();
++it;
t++;
}
t=0; // here the debugger shows the value of t is 65536;
it.Begin();
while ( !it.IsAtEnd() ) {
k = it.Get();
++it;
t++;
}
but t=0 here.
it seems the Begin() function no longer reset the iterator position to the
start,
are there anyone have the same problem with the nearest version of itk?
ting