[Insight-developers] What are the bounds of an itkImageRegion?

Steve M. Robbins steve at sumost.ca
Tue Dec 30 20:27:03 EST 2008


On Tue, Dec 30, 2008 at 06:51:29PM -0500, Luis Ibanez wrote:

> Image Regions are defined in the digital space of the image grid,
> not in the continous space of physical coordinates.

I'm not talking about physical coordinates or world space.  
I'm only talking about the image grid.

If I have a 1D image grid, the first pixel is at Index=0, the second
at Index=1, and it makes perfect sense to interpolate the two to
obtain an image value at location "0.5".  The latter must obviously
use a ContinuousIndex type.


> The region defined by
>
>         start = 1
>         size  = 2
>
> includes only the two pixels of indices :
>
>         a)   index = 1
>         b)   index = 2
>
> not the continous range of real coordinates
>
>        [1.0, 2.99)

Yes, the current code treats this region as the interval 

	[1,2] == {x: 1 <= x <= 2}.  

But that is surely a bug, for a two-pixel region should have length 2!

The two common conventions are edge-based, in which case the interval
is [1,3]; or centre-based, leading to the interval [0.5,2.5].


> In fact, this ties up to the discussion on how we define the
> center of a pixel, and how we compute rounding.

Indeed, and I think the code should be centre-based as the ITK
Software Guide describes it.  My point is that even if you believe it
is edge-based, there is a bug.

In addition, the intervals should probably be half-open, so that
pixels are disjoint.


Regards,
-Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20081230/5d987198/attachment.pgp>


More information about the Insight-developers mailing list