The disclosure is directed to techniques in which magnetic resonance imaging (MRI) is coordinated with the operation of an implantable medical device (IMD). By using an IMD to sense conditions, MRI can be improved because the sensed conditions can accurately define timing for application of electromagnetic radiation bursts. Moreover, by applying stimulation pulses specifically to coordinate the electromagnetic radiation bursts, the MRI may also be improved.