A method for compensating for respiratory motion of a structure imaged by a magnetic resonance (MR) scanner, such as heart, is disclosed. The method comprises obtaining a sequence of navigator samples (22) representative of the progressive displacement of the structure during a first time interval (20), and adjusting a waveform (14) of predefined initial parameters to follow the sequence of navigator samples. During a second time interval (24) which follows the first time interval and during which the magnetic resonance scanner takes a number of image projection views or lines (17), the expected respiratory displacement of the structure is estimated at the times that the image projection lines are taken, by extrapolating the waveform model and estimating the displacements (26) predicted by the extrapolated waveform, so that the position at which the image projection lines are taken can be adjusted to compensate for the respiratory motion, so as to yield a sharper magnetic resonance image.