[Insight-developers] BSplineInterpolateImageFunction

Brad King brad . king at kitware . com
Thu, 18 Dec 2003 16:40:14 -0500 (EST)


Hello,

While tracking down a recent test failure, I noticed that
BSplineInterpolateImageFunction has vnl_matrix local variables in its
EvaluateAtContinuousIndex and EvaluateDerivativeAtContinuousIndex methods.
When used in a registration method, this effectively does a dynamic memory
allocation and free per pixel!

I think these variables should be changed to member data for the class.
Since EvaluateAtContinuousIndex and EvaluateDerivativeAtContinuousIndex
are const methods, the matrices will have to be mutable (whether these
methods should be const is a separate discussion).  I expect a substantial
speed improvement will be achieved by this relatively simple change.

Will the author of this class please look at making the change?

Thanks,
-Brad