[Insight-users] ContinuousIndex and IsInside

Jim Miller millerjv at gmail.com
Fri Dec 29 19:05:20 EST 2006


Unfortunately, the space occupied by a pixel was not defined early enough in
ITK development.  In about half the circumstances, it is assumed that the
coordinate of a pixel is associated with the center of the pixel.  In the
other half, it is assumed that the coordinate of a pixel is associated with
a corner of the pixel.

itk::Image::TransformIndexToPhysicalPoint() is alright regardless of the
interpretation but itk::Image::TransformPhysicalPointToIndex() pretty much
assumes a pixel's coordinate is defined by one of its corners.

Some of the ImageFunction classes take care of this 1/2 pixel shift
automatically.

But there are other places in the code where an implicit assumption is made
on the coordinate frame.  These are hard to identify.

ITK as designed to handle negative indices, but as Karthik mentions, there
may be code where it implicitly assumes positive or unsigned indices.

An image with unity spacing an 100 pixels in a dimension should have been
defined to cover the space [-0.5, 99.5).  At some point, we'll bite the
bullet and fix this.

Jim

On 12/22/06, Emmanuel Christophe <melaneum at gmail.com> wrote:
>
> Hello,
>
> What is the valid range for a continous index of a dataset of size 100
> starting at 0 ?
>
> Index (integer) will be going from 0 to 99 (included).
> I would expect the continuous index to be valid from [0,100[ (100
> excluded but 99.9 included for example)
>
> Apparently the IsInside function consider the continousIndex to be
> inside only if in the interval [0,99] (99.9 excluded for example). Is
> there a reason for such a choice ?
>
> Thanks,
> Emmanuel Christophe
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20061229/4fd19431/attachment.htm


More information about the Insight-users mailing list