On 12/22/06, <b class="gmail_sendername">Emmanuel Christophe</b> &lt;<a href="mailto:melaneum@gmail.com">melaneum@gmail.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>What is the valid range for a continous index of a dataset of size 100<br>starting at 0 ?<br><br>Index (integer) will be going from 0 to 99 (included).<br>I would expect the continuous index to be valid from [0,100[ (100
<br>excluded but 99.9 included for example)<br><br>Apparently the IsInside function consider the continousIndex to be<br>inside only if in the interval [0,99] (99.9 excluded&nbsp;<br> </blockquote></div><br>I perfectly agree with you here and IMHO its a bug in itk::Image. I agree that a ContinuousIndex should be considered &quot;Inside&quot; if it lies in the interval (-
0.5, 99.5] for your example.<br><br>An itk::Index is the value at the center of a voxel, with normalized extents (-0.5,.5]. I tried to fix a while ago at the level of the interpolator, which, in ITK is the class that evaluates the value at a ContinuousIndex. [A voxel is just a regular grid of sample points from a continuous function, and the ideal interpolator is the one that best approximates the PSF.]
<br><br>That fix was here : <br><a href="http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkLinearInterpolateImageFunction.h?root=Insight&amp;r1=1.28&amp;r2=1.29">http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkLinearInterpolateImageFunction.h?root=Insight&amp;r1=1.28&amp;r2=1.29
</a><br>logged as Bug 3647.<br><br>It overrided the IsInsideBuffer() methods from ImageFunction, so as to extend the boundaries of the voxel by 0.5, atleast for the LinearInterpolator. <br><br>I reverted the fix though, since a few developers raised concerns about the performance penalty, it might cause due to an extra IsInsideBuffer() call that was made as a result. [
<a href="http://www.itk.org/mailman/private/insight-developers/2006-August/008340.html">http://www.itk.org/mailman/private/insight-developers/2006-August/008340.html</a>]<br><br>I was worried about putting the fix in itk::Image, as you suggest, since that would mean supporting negative indices and I&#39;m not sure what would happen in ITK with negative indices. It might be just fine, but there may be code fragments somewhere assuming its a postive real value... 
<br><br>--<br>Karthik Krishnan<br>R &amp; D Engineer,<br>Kitware Inc<br>