A method for shimming a magnetic field which is generated by a magnetic structure comprising a plurality of poles, and which permeates a volume of space, the method comprising:
- a) defining a shimming field of view comprising a part of a volume of space enclosed by a three-dimensional closed surface permeated by the magnetic field;
- b) measuring at least a feature of the magnetic field in a plurality of locations of a three-dimensional grid, along the three dimensional closed surface;
- c) defining a positioning surface on each pole of the magnetic structure for positioning one or more correction elements of the magnetic field, depending on the magnet structure;
- d) calculating position and magnitude parameters of said one or more correction elements to obtain predetermined target values of the magnetic field characteristics;
- in which
- e) target values of the magnetic field characteristics are a magnetic field homogeneity;
- f) the measured feature of the magnetic field is the field homogeneity on the three-dimensional grid;
- g) the correction elements being magnetic dipoles;
- and
- h) a distribution of the position and magnitude parameters of said one or more correction elements on the poles of the magnetic structure being chosen to minimize homogeneity variations of a shimmed magnetic field resulting from an addition of the magnetic field generated by the magnetic structure and a magnetic field generated by the correction elements on the poles of the magnetic structure;
- and
- optionally starting from the magnetic field generated by the magnetic structure with any correction elements already positioned on a pole and iteratively repeating step d) as additional correction elements are added until a predetermined target value is met;
- wherein evaluation parameters of the magnetic field homogeneity are a statistical standard deviation of the magnetic field strength inside the volume of space and minimizing homogeneity variations is done by minimizing a standard deviation of the sum of magnetic fields in the volume;
- further comprising the steps of:
- defining a second three-dimensional closed boundary surface enclosing a part of the volume of space permeated by the magnetic field, the second three-dimensional surface having a different shape than the first three-dimensional closed boundary surface and the volume of space enclosed by the two boundary surfaces being at least partly coincident with each other;
- the second three-dimensional closed boundary surface enclosing a part of the volume of space permeated by the magnetic field coinciding with the part of a target body which is represented and visible in an image of the target body;
- numerically evaluating the magnetic field in the part of the volume of space inside the second three-dimensional closed boundary surface by applying a field expansion equation;
- and
- calculating from the numerical evaluation of the magnetic field the homogeneity variations of the magnetic field for each iteration of the step d).