Non-rigid medical image registration and its application to cardiac image analysis