Data-driven registration for local deformations