In NMR and MRI, shimming is used prior to the operation of the magnet to eliminate inhomogeneities in its field.
Iron constructions in walls and floor of the examination room become magnetized and disturb the field of the scanner.
Field homogeneity of the order of 1 ppm over a volume of several liters is needed in an MRI scanner.
High-resolution NMR spectroscopy demands field homogeneity better than 1 ppb within a volume of a few milliliters.
Passive shimming involves pieces of steel with good magnetic qualities.