Fixed centroid calculation, fixed record log reading, added scaling of direction vectors, and added evaluation of registration.