This is from a recent offline discussion with Kristen about the best way to remove the dependency to Qt in the currently experimental new Spline Tool.
Currently, I'm using the LGPL library Qwt to compute the spline coefficients and sample the spline. But this library has a dependency to Qt, something we would like to eliminate.
The current Spline Tool computation is done to mimic the results from Matlab's function CSCVN().
There are two possible solutions on the table right now:
1) Write a derivative work of Qwt to remove the dependency to Qt
2) As Kristen has pointed out:
"Another alternative would be to use the spline computation
implemented in src/Dataflow/Modules/Fields/GeneratePlanarElectrode.cc
and src/Dataflow/Modules/Fields/GenerateWireElectrode.cc that is
coded to behave similarly to Matlab's spline computation interp1."
I have checked 2), and it doesn't seem feasible, because the coefficients computed by cscvn and interp1 are different. That is, they compute different splines even if both use the same knot vector. I suppose this have to be because of different end-conditions.
To illustrate this, I have attached a figure comparing the interpolation produced by cscv() to the interpolation of interp1() using cubic and Hermite polynomials.
Also, attached is the Matlab script used to generate it.
Best regards,
Ramon.
------------------------------------------------------------------------
Archive powered by MHonArc 2.6.16.