A method of operating a magnetic resonance imaging (MRI) system is
described. A magnetic element in an implanted medical device is
demagnetized by exposing it to an external demagnetizing magnetic field.
Magnetic resonance imaging of the patient is performed. Then the magnetic
element is remagnetized without removing it from the implanted medical
device by exposing the magnetic element to an external remagnetizing
magnetic field.