For generating a three-dimensional magnetic resonance image of a respirating examination subject, the respiration of the examination subject is divided into a number of predefined clusters. Based on a measured respiratory position of the examination subject, one of these clusters is selected. The scanned k-space range is divided into a number of data acquisition shots which, by means of a particular k-space trajectory, each fill a number of k-space lines. The different shots are acquired for the different clusters until all shots of the measurement data set are assigned together to at least two adjacent clusters. The magnetic resonance image is reconstructed from those shots that are assigned to at least two adjacent clusters.