Method for generating at least one image data set and one reference image data set of an examination object from at least two raw data sets (17, 20), having the following steps: - providing a first raw data set, wherein the first raw data set is acquired with a magnetic resonance system and comprises measurement signals at a plurality of read-out points (36, 44) in the k-space, wherein the read-out points (36, 44) lie on a first k-space trajectory (35, 42), - providing a second raw data set, wherein the second raw data set is acquired with the same magnetic resonance system and at the same examination object as the first raw data set and comprises measurement signals at a plurality of read-out points in the k-space, wherein the read-out points lie on a second k-space trajectory that is different from the first k-space trajectory (35, 42), - reconstruction of a plurality of image data sets (87, 88, 89, 90) from the first raw data set, wherein before the reconstruction of each image data set (87, 88, 89, 90), a separate distortion correction coefficient set (79, 81, 82, 83) is used, wherein a distortion correction coefficient set (79, 81, 82, 83) defines a shift of the read-out points of the measurement signals of the first raw data set in the k-space, - reconstruction of a reference image data set from the second raw data set, - comparison of the image data sets (87, 88, 89, 90) with the reference image data set, wherein on comparison one similarity value (α 87, α 88, α 89, α 90) respectively is generated, and - selection of the image data set (87, 88, 89, 90) with the greatest similarity value (α 87, α 88, α 89, α 90) and storage of the associated distortion correction coefficient set, wherein the first k-space trajectory is more sensitive to gradient deviations than the second k-space trajectory. - providing a first raw data set, wherein the first raw data set is acquired with a magnetic resonance system and comprises measurement signals at a plurality of read-out points (36, 44) in the k-space, wherein the read-out points (36, 44) lie on a first k-space trajectory (35, 42), - providing a second raw data set, wherein the second raw data set is acquired with the same magnetic resonance system and at the same examination object as the first raw data set and comprises measurement signals at a plurality of read-out points in the k-space, wherein the read-out points lie on a second k-space trajectory that is different from the first k-space trajectory (35, 42), - reconstruction of a plurality of image data sets (87, 88, 89, 90) from the first raw data set, wherein before the reconstruction of each image data set (87, 88, 89, 90), a separate distortion correction coefficient set (79, 81, 82, 83) is used, wherein a distortion correction coefficient set (79, 81, 82, 83) defines a shift of the read-out points of the measurement signals of the first raw data set in the k-space, - reconstruction of a reference image data set from the second raw data set, - comparison of the image data sets (87, 88, 89, 90) with the reference image data set, wherein on comparison one similarity value (α 87, α 88, α 89, α 90) respectively is generated, and - selection of the image data set (87, 88, 89, 90) with the greatest similarity value (α 87, α 88, α 89, α 90) and storage of the associated distortion correction coefficient set, wherein the first k-space trajectory is more sensitive to gradient deviations than the second k-space trajectory.