Ultrasound-based cardiac gating for MRI