A medical imaging method and associated device for generating an image data record of a recording region of a patient, which region is influenced by a cyclical cardiac motion, in which an EKG signal is used to derive a series of recording pulses matched to the cardiac motion, by which pulses the imaging is actuated in a pulsed fashion. In at least one embodiment, a time window of a future recording pulse is calculated taking into account at least one dispersion parameter characterizing the variation in the cycle duration and a location parameter characterizing the expected value of the cycle duration, wherein the dispersion parameter is included into the calculation of the time window using a weighting determined on the basis of the location parameter. Taking into account the dispersion parameter depending on the location parameter allows a reduction in the applied X-ray dose in the situations with irregular heart rates when a low mean heart rate is present at the same time, without significantly reducing the image quality of the generated image data record.