The doc for this function doesn't make it clear whether the user may
call it with an index point that lies outside the image or not.  I can
tell you that the code doesn't check the bounds, resulting in
uninitialized memory reads [1].

My question is: is that a user error or bug in the evaluation

If I read the ITK 4.8.2 code correctly, it looks like it takes care of
the lower index bound, but not the upper index bound -- so ITK bug?


[1] http://my.cdash.org/viewDynamicAnalysisFile.php?id=3780109

Elastix test suite creates a 2D image of size 10x10, then calls
the interpolator with coordinates { 12.7, 15.3 }.  I believe
that is the cause of this diagnostic:

UMR ==26834== Invalid read of size 2
==26834==    at 0x62AE77: itk::LinearInterpolateImageFunction<itk::Image<short, 
 2u>, double>::Dispatch<2u> const&, itk::ContinuousIndex<double, 2u> const&) 
const (itkLinearInterpolateImageFunction.h:172)
==26834==    by 0x62228A: itk::LinearInterpolateImageFunction<itk::Image<short, 
2u>, double>::EvaluateAtContinuousIndex(itk::ContinuousIndex<double, 2u> 
const&) const (itkLinearInterpolateImageFunction.h:99)
==26834==    by 0x61C431: bool TestInterpolators<2u>() 
==26834==    by 0x616CD2: main (itkAdvancedLinearInterpolatorTest.cxx:279)

(Later, the code does an out-of-image call in 3D as well)

Attachment: signature.asc
Description: PGP signature

Powered by www.kitware.com

Visit other Kitware open-source projects at

Kitware offers ITK Training Courses, for more information visit:

Please keep messages on-topic and check the ITK FAQ at:

Follow this link to subscribe/unsubscribe:

Reply via email to