[Insight-developers] itkIndex & itkOffset

Joshua Cates cates@cayenne.cs.utah.edu
Tue, 3 Apr 2001 13:27:03 -0600 (MDT)


Hello all,

Now that itkIndex has been changed to unsigned and there is a
signed itkOffset class, we need to establish the definitions
and relationship between the two classes in very concrete terms.

The documentation for itkOffset defines it as the difference between two
itkIndex's, but the implementation of itkIndex does not support this
definition. Currently all arithmetic operations between two itkIndex
return itkIndex. This is no longer appropriate.

If itkOffset is the difference btwn two itkIndex it follows that:

 itkIndex - itkIndex  = itkOffset
 itkIndex - itkOffset = itkIndex
 itkIndex + itkOffset = itkIndex
 itkIndex + itkIndex  = itkOffset? itkIndex? or undefined?

Another issue is whether to check the itkIndex - itkOffset case for
negative results, which will produce undefined values in itkIndex.
What do others think?

Josh.

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