A method of designing a static-magnetic-field shimming coil system for magnetic resonance imaging, comprising the steps of: a) for each member of a cohort of magnetic resonance imaging subjects (S 1, S 2, S 3): a1) acquiring a map of a static magnetic field (FM 1, FM 2, FM 3) within a region of interest, common to all members, comprising a bodily portion of the member; a2) determining a corrective static magnetic field such that a sum of the acquired static magnetic field and the corrective static magnetic field is equal to a target static magnetic field within the region of interest; a3) determining a stream function (I, I 1,, I 2., I 3, I 4), defined on a reference surface (RS, RS 1) enclosing the region of interest and corresponding to a current density distribution on said surface, minimizing either a cost function representative at least of a difference between the corrective static magnetic field and a static magnetic field generated by said current density distribution, or a cost function representative at least of an electric parameter of the coil system subject to at least one constraint representative of said difference; b) performing a Principal Component Analysis of the stream functions determined for at least a plurality of members of the cohort; and c) determining at least one coil wiring pattern defined on said reference surface by discretizing at least a most significant principal component ( I 1 SVD) of said stream functions; steps a2), a3), b) and c) being carried out using a computer. a) for each member of a cohort of magnetic resonance imaging subjects (S 1, S 2, S 3): a1) acquiring a map of a static magnetic field (FM 1, FM 2, FM 3) within a region of interest, common to all members, comprising a bodily portion of the member; a2) determining a corrective static magnetic field such that a sum of the acquired static magnetic field and the corrective static magnetic field is equal to a target static magnetic field within the region of interest; a3) determining a stream function (I, I 1,, I 2., I 3, I 4), defined on a reference surface (RS, RS 1) enclosing the region of interest and corresponding to a current density distribution on said surface, minimizing either a cost function representative at least of a difference between the corrective static magnetic field and a static magnetic field generated by said current density distribution, or a cost function representative at least of an electric parameter of the coil system subject to at least one constraint representative of said difference; a1) acquiring a map of a static magnetic field (FM 1, FM 2, FM 3) within a region of interest, common to all members, comprising a bodily portion of the member; a2) determining a corrective static magnetic field such that a sum of the acquired static magnetic field and the corrective static magnetic field is equal to a target static magnetic field within the region of interest; a3) determining a stream function (I, I 1,, I 2., I 3, I 4), defined on a reference surface (RS, RS 1) enclosing the region of interest and corresponding to a current density distribution on said surface, minimizing either a cost function representative at least of a difference between the corrective static magnetic field and a static magnetic field generated by said current density distribution, or a cost function representative at least of an electric parameter of the coil system subject to at least one constraint representative of said difference; b) performing a Principal Component Analysis of the stream functions determined for at least a plurality of members of the cohort; and c) determining at least one coil wiring pattern defined on said reference surface by discretizing at least a most significant principal component ( I 1 SVD) of said stream functions;