1. A magnetic resonance imaging apparatus comprising: an imaging unit configured to acquire image data by imaging with applying a pre-pulse for controlling a contrast; and a compensation unit configured to suppress a remanent magnetic field having an intensity according to a slice position, the remanent magnetic field being at an application timing of the pre-pulse and due to an eddy current generated by at least one gradient magnetic field applied before applying the pre-pulse.