Energy delivered from an implantable medical device to stimulate tissue within a patients body is controlled. An electrical signal used to stimulate the tissue is changed from a first energy state to a second energy state during a magnetic resonance imaging (MRI) scan. The energy delivered is maintained at the second energy state after the MRI scan. A capture threshold of the tissue is then measured, and the energy delivered to the tissue is adjusted based on the measured capture threshold of the tissue.