In the present invention, a current plane which is virtually disposed and surrounds a measurement position is assumed from magnetic field measurement values, and a current distribution (or magnetic moment distribution) which mimics a measured magnetic field is reproduced with current potentials. This is used to perform shimming calculation by a truncated singular value decomposition method with discrete shim trays that are actually used and ideal virtual continuous shim trays to carry out shimming under conditions for shimming having a uniformity that is close to ideal shimming.