[Insight-developers] ImageRandomConstIteratorWithIndex

Joshua Cates cates@sci.utah.edu
Thu, 20 Feb 2003 13:32:19 -0700 (MST)


Hi,

In the implementation of ImageRandomConstIteratorWithIndex, the member 
variable m_NumerOfSamplesDone is incremented in both operator++ and 
operator--.  This works fine for common cases of iteratation in one 
"direction" through the whole random sample set because IsAtBegin, 
IsAtEnd are defined appropriately.

But for cases where you might want to reverse iteration direction in a
loop, or go back a few random samples, (for example, an it++ followed by a
conditional it--), this implementation will fail.  Is there any reason not
to modify this class so that operator-- decrements m_NumberOfSamplesDone?

Josh.
______________________________
 Josh Cates			
 School of Computer Science	
 University of Utah
 Email: cates@sci.utah.edu
 Phone: (801) 587-7697
 URL:   http://www.sci.utah.edu/~cates