A method of correcting a magnetic field of an MRI radiotherapy apparatus (300) includes a magnetic resonance imaging system (302) and a radiation therapy system (304). The MRI system includes a magnet (306) for generating the magnetic field within an imaging zone 318. The magnet generates a magnetic field with a zero crossing (346, 404) outside of the imaging zone. The medical apparatus further comprises a gantry (332) configured for rotating a ferromagnetic component (336, 510) about a rotational axis (333). The method comprises the step of installing (100, 200) a magnetic correcting element (348, 900, 1000) located on a radial path (344, 504) perpendicular to the rotational axis. The magnetic correcting element is positioned on the radial path such that change in the magnetic field within the imaging zone due to the ferromagnetic component is reduced. The method further comprises repeatedly: measuring (102, 202, 1204) the magnetic field within the imaging zone; determining (104, 204, 1206) the change in the magnetic field in the imaging zone; and adjusting (106, 206, 1208) the position of the magnetic correcting element along the radial path if the change in the magnetic field is above a predetermined threshold.