Learning anatomical image representations for cardiac imaging