A method of performing magnetic resonance imaging of a body using a magnetic resonance imaging scanner comprising a scanner bore, a primary coil, radio frequency coils, gradient coils (GC x, GC y, GC z) and a signal-processing unit, the method comprising the steps of: a. positioning the body in a scanner bore where a static and substantially uniform magnetic field (B 0), called longitudinal field, oriented along a direction (z), called longitudinal direction, is established by the primary coil; b. using all or part of the radio-frequency coils to transmit to said body at least one radio-frequency pulse adapted to excite nuclear spins inside said body; c. after said or each said radio-frequency pulse, using the gradient coils (GC x, GC y, GC z) to apply to said body a time-varying magnetic field gradient (G x, G y, G z) defining a trajectory in k-space and simultaneously using all or part of the radio-frequency coils to acquire samples of a magnetic resonance signal emitted by the excited nuclear spin, each sample corresponding to a point of the k-space belonging to said trajectory; and d. using the signal processing unit to apply a nonlinear reconstruction algorithm to the acquired samples to reconstruct a magnetic resonance image of said body; wherein said trajectory (ST, MT) in k-space is a continuous trajectory complying with a set of constraints including constraints on maximum amplitude and maximum slew rate of said time-varying magnetic field gradient, such that the points of the k-space corresponding to the samples, called sampling points, define a pseudo-random sampling of the k-space, matching a predetermined target sampling density, said trajectory in k-space minimizing, subject to said set of constraints, a cost function defined by the difference between a first term, called attraction term, promoting consistency of the distribution of sampling points in k-space with said predetermined target sampling density, and a second term, called repulsion term, promoting separation in k-space between sampling points, said repulsion term being expressed as a sum of contributions corresponding to respective pairs of sampling points; characterized in that each said contribution is weighted by a weight which increase with temporal separation of the sampling points along said trajectory in k-space. a. positioning the body in a scanner bore where a static and substantially uniform magnetic field (B 0), called longitudinal field, oriented along a direction (z), called longitudinal direction, is established by the primary coil; b. using all or part of the radio-frequency coils to transmit to said body at least one radio-frequency pulse adapted to excite nuclear spins inside said body; c. after said or each said radio-frequency pulse, using the gradient coils (GC x, GC y, GC z) to apply to said body a time-varying magnetic field gradient (G x, G y, G z) defining a trajectory in k-space and simultaneously using all or part of the radio-frequency coils to acquire samples of a magnetic resonance signal emitted by the excited nuclear spin, each sample corresponding to a point of the k-space belonging to said trajectory; and d. using the signal processing unit to apply a nonlinear reconstruction algorithm to the acquired samples to reconstruct a magnetic resonance image of said body; wherein said trajectory (ST, MT) in k-space is a continuous trajectory complying with a set of constraints including constraints on maximum amplitude and maximum slew rate of said time-varying magnetic field gradient, such that the points of the k-space corresponding to the samples, called sampling points, define a pseudo-random sampling of the k-space, matching a predetermined target sampling density, said trajectory in k-space minimizing, subject to said set of constraints, a cost function defined by the difference between a first term, called attraction term, promoting consistency of the distribution of sampling points in k-space with said predetermined target sampling density, and a second term, called repulsion term, promoting separation in k-space between sampling points, said repulsion term being expressed as a sum of contributions corresponding to respective pairs of sampling points; characterized in that each said contribution is weighted by a weight which increase with temporal separation of the sampling points along said trajectory in k-space.