Pacemakers and defibrillators are battery-operated devices that are implanted under the skin of patients with certain heart problems. They are used to treat specific problems with the electrical impulses that control how the heart beats, or to stop abnormally fast heart rhythms. Magnetic resonance imaging (MRI) is a specialized method of taking pictures of the body. Because of concerns that doing MRI might interfere with the normal function of a pacemaker or defibrillator, however, it has been assumed to be unsafe in patients with these devices.