A medical device includes a sensor for sensing for an MRI gradient magnetic field and a microprocessor configured to operate in a signal processing mode in which electrical signals induced by the gradient magnetic field are not counted as cardiac events.