Marius, GREAT CATCH. I'm working on incorporating your test into ITK right now in order to demonstrate both the bug and the solution.
Hans ================================================================= Hans J. Johnson, Ph.D. Assistant Professor, Department of Psychiatry Mailing Address: W274 GH Email: [email protected]<mailto:[email protected]> 200 Hawkins Drive Phone: (319) 353 8587 The University of Iowa Iowa City, IA 52242 From: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Date: Wednesday, April 24, 2013 8:33 AM To: ITK <[email protected]<mailto:[email protected]>> Subject: [Insight-developers] Bug in BSplineInterpolateImageFunction Dear all, The BSplineInterpolateImageFunction class has two functions to compute the derivative: - EvaluateDerivativeAtContinuousIndex - EvaluateValueAndDerivativeAtContinuousIndex The first one does take direction cosines into account, the other does not. When called while using an image with non-trivial direction cosines, the two derivatives are not equal. I believe this bug was introduced a long time ago by commit 6abbc7969a90786c4c73f5d191f634db536c2d1d : http://itk.org/gitweb?p=ITK.git;a=commitdiff;h=6abbc7969a90786c4c73f5d191f634db536c2d1d#patch13 I attached a test program that simply calls the two functions. The input of the test program (set with interpolator->SetInputImage() ) is an image with direction cosines: (-0, 7.48376e-009, -1, 7.48376e-009, 1, 7.48376e-009, 1, -7.48376e-009, 0) Current output: EvaluateDerivative: [42.7697, -9.97885, 22.2913] EvaluateValueAndDerivative: [-22.2913, -9.97885, 42.7697] But that should really be the same. Note that the first and third entry are switched, and negated. I filed a gerrit entry which proposes a fix: http://review.source.kitware.com/#/c/11016/ After that fix the output is as follows: EvaluateDerivative: [42.7697, -9.97885, 22.2913] EvaluateValueAndDerivative: [42.7697, -9.97885, 22.2913] So, equal as it should be. Looking forward to your feedback, Regards, Marius Marius Staring, PhD Division of Image Processing (LKEB) Department of Radiology Leiden University Medical Center PO Box 9600, 2300 RC Leiden, The Netherlands phone: +31 (0)71 526 2137, fax: +31 (0)71 524 8256 [email protected]<mailto:[email protected]> ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://www.itk.org/mailman/listinfo/insight-developers
