Changes in electrical stimulation therapy delivered via a medical device are coordinated with Functional Magnetic Resonance Imaging (fMRI) scans. In one example, a medical device delivers electrical stimulation therapy to a patient in an MRI unit, where the medical device is configured to cycle electrical stimulation therapy between a plurality of stimulation states. An indication that the medical device will cycle the electrical stimulation therapy or has cycled the electrical stimulation therapy while the patient is in the MRI unit or being imaged by the MRI unit is generated, and an MRI scan of the patient via an MRI workstation is initiated based on the indication. In another example, a medical device detects activation of an MRI scan and automatically switches stimulation states based upon the detection of the MRI scan, such that the scan is associated with a particular stimulation state.