A medical instrument (200, 300, 400, 500, 502, 600, 700, 702, 800, 802) comprising: - a LINAC with an X-ray source for directing X-ray radiation at a target zone, wherein the LINAC is adapted for rotating the X-ray source about a rotational axis, - a magnetic resonance imaging system for acquiring magnetic resonance data with a radio frequency coil (228, 328, 428, 504, 602, 704, 804) from an imaging zone, wherein the target zone is within the imaging zone, wherein the magnetic resonance imaging system comprises a magnet for generating a magnetic field within the imaging zone, wherein the X-ray source is adapted for rotating at least partially about the magnet; - a processor for controlling the medical instrument; - a memory for storing an X-ray transmission model of an accessory being sensitive to the X-ray radiation and/or affecting the X-ray radiation and for storing machine executable instructions (280, 282, 284, 286, 288, 290) for execution by the processor, wherein execution of the instructions causes the processor to: - receive a treatment plan for irradiating the target zone; - modify the treatment plan in accordance with the X-ray transmission model such as to account for attenuation of the X-ray radiation through the accessory or such as to avoid damaging the accessory by the X-ray radiation; - acquire the magnetic resonance data using the magnetic resonance imaging system; - reconstruct a magnetic resonance image from the magnetic resonance data; - locate the target zone in the magnetic resonance image; - generate control signals in accordance with the location of the target zone and the modified X-ray transmission model; and - control the LINAC to irradiate the target zone using the control signals. - a LINAC with an X-ray source for directing X-ray radiation at a target zone, wherein the LINAC is adapted for rotating the X-ray source about a rotational axis, - a magnetic resonance imaging system for acquiring magnetic resonance data with a radio frequency coil (228, 328, 428, 504, 602, 704, 804) from an imaging zone, wherein the target zone is within the imaging zone, wherein the magnetic resonance imaging system comprises a magnet for generating a magnetic field within the imaging zone, wherein the X-ray source is adapted for rotating at least partially about the magnet; - a processor for controlling the medical instrument; - a memory for storing an X-ray transmission model of an accessory being sensitive to the X-ray radiation and/or affecting the X-ray radiation and for storing machine executable instructions (280, 282, 284, 286, 288, 290) for execution by the processor, wherein execution of the instructions causes the processor to: - receive a treatment plan for irradiating the target zone; - modify the treatment plan in accordance with the X-ray transmission model such as to account for attenuation of the X-ray radiation through the accessory or such as to avoid damaging the accessory by the X-ray radiation; - acquire the magnetic resonance data using the magnetic resonance imaging system; - reconstruct a magnetic resonance image from the magnetic resonance data; - receive a treatment plan for irradiating the target zone; - modify the treatment plan in accordance with the X-ray transmission model such as to account for attenuation of the X-ray radiation through the accessory or such as to avoid damaging the accessory by the X-ray radiation; - acquire the magnetic resonance data using the magnetic resonance imaging system; - reconstruct a magnetic resonance image from the magnetic resonance data; - locate the target zone in the magnetic resonance image; - generate control signals in accordance with the location of the target zone and the modified X-ray transmission model; and - control the LINAC to irradiate the target zone using the control signals.