Techniques are disclosed for acquiring magnetic resonance data of an object with a magnetic resonance imaging apparatus. A slice group is imaged whose slices define a contiguous imaging volume and which contains a first number of slices. In a number of concatenations, the magnetic resonance data for subgroups of the slices, each containing a respective second number of slices depending on the first number of concatenations, are acquired, and shimming is performed to increase field homogeneity in the imaging volume. To define the subgroups, the imaging volume is subdivided into at least two disjoint contiguous sub-volumes, and at least two subgroups are defined for each sub-volume, each subgroup only containing non-adjacent slices in the sub-volume. During acquisition of the magnetic resonance data of each subgroup, shimming is at least restricted to the respective sub-volume.