Spline-based wavefront reconstruction for Shack-Hartmann measurements