A detection device for X-rays, comprising: at least one sensor adapted to provide a current in response to electromagnetic radiation exposure during at least one image acquisition frame; at least one electronics board comprising at least one integrator providing a capacitor that is configured to discharge in response to the current provided by the sensor, wherein a full discharge of the capacitor completes a cycle ; a capacitor discharge analyzer configured to analyze the discharge of the capacitor and to provide a full-discharge signal when the capacitor is fully discharged in response to the current provided by the sensor; a counter configured to measure a cycle time, defined as a period between a start of a new cycle and a full discharge of the capacitor based on the full-discharge signal provided to the counter by the capacitor discharge analyzer; and a processor unit configured to: obtain the cycle time measured by the counter; store the obtained cycle time; and in case of a discontinuity of the electromagnetic radiation causing an incomplete cycle having a cycle time which is less than the cycle time for the last completed cycle time, acquire an estimate of the capacitor discharge during the incomplete cycle by calculating a ratio of the time of the incomplete cycle to the stored cycle time of the last completed cycle, wherein the discontinuity is a change or interruption in a beam of the electromagnetic radiation or in an intensity of the electromagnetic radiation. at least one sensor adapted to provide a current in response to electromagnetic radiation exposure during at least one image acquisition frame; at least one electronics board comprising at least one integrator providing a capacitor that is configured to discharge in response to the current provided by the sensor, wherein a full discharge of the capacitor completes a cycle ; a capacitor discharge analyzer configured to analyze the discharge of the capacitor and to provide a full-discharge signal when the capacitor is fully discharged in response to the current provided by the sensor; a counter configured to measure a cycle time, defined as a period between a start of a new cycle and a full discharge of the capacitor based on the full-discharge signal provided to the counter by the capacitor discharge analyzer; and a processor unit configured to: obtain the cycle time measured by the counter; store the obtained cycle time; and in case of a discontinuity of the electromagnetic radiation causing an incomplete cycle having a cycle time which is less than the cycle time for the last completed cycle time, acquire an estimate of the capacitor discharge during the incomplete cycle by calculating a ratio of the time of the incomplete cycle to the stored cycle time of the last completed cycle, wherein the discontinuity is a change or interruption in a beam of the electromagnetic radiation or in an intensity of the electromagnetic radiation. obtain the cycle time measured by the counter; store the obtained cycle time; and in case of a discontinuity of the electromagnetic radiation causing an incomplete cycle having a cycle time which is less than the cycle time for the last completed cycle time, acquire an estimate of the capacitor discharge during the incomplete cycle by calculating a ratio of the time of the incomplete cycle to the stored cycle time of the last completed cycle, wherein the discontinuity is a change or interruption in a beam of the electromagnetic radiation or in an intensity of the electromagnetic radiation. <EOS>