A method of correcting active shimming element of a magnetic resonance
device, including providing a set of correction values for each shimming
element for a given N sub volumes, wherein N is an integer number greater
than or equal to 1, detecting irregularities in the magnetic field of the
sample regions, optimizing all the shimming elements according to the set
of correction values, assessing the regularity of the corrected magnetic
field, and reiterating the process until field uniformity is achieved,
such that an accurate magnetic resonance measurement of the sample is
achieved after a minimum number of iterations.