Automatic landmark correspondence detection in medical images with an application to deformable image registration