The invention provides for a medical instrument (200, 300, 400, 500, 502, 600, 700, 702, 800, 802) comprising a LINAC guided by a magnetic resonance imaging system (204). Execution of the instructions by processor to controlling the medical instrument cause the processor to: receive (100) a treatment plan (260) for irradiating the target zone modify (102) the treatment plan in accordance with an X-ray transmission model of an accessory acquire (104) magnetic resonance data using the magnetic resonance imaging system reconstruct (106) a magnetic resonance image (268) from the magnetic resonance data register (108) a location (272) of the target zone in the magnetic resonance image generate (110) control signals (274) in accordance with the location of the target zone and the X-ray transmission model and control (112) the LINAC to irradiate the target zone using the control signals.