An imaging system, comprising: a detector array, with a plurality of direct conversion detector pixels, that is configured to detect radiation traversing an examination region of the imaging system and generates a signal indicative of the detected radiation; a pulse shaper configured to process the signal and generate a pulse with a height indicative of the energy of the processed radiation; a discriminator with comparators configured to energy discriminate the pulse based on a set of thresholds and generate, for each energy threshold of the set of energy thresholds, a signal which indicates whether the height of the pulse exceeds the energy threshold; a counter that is configured to process the signals output by the discriminator and counts, for each threshold, if the signal indicates that the height of the pulse exceeds the energy threshold; a threshold calibrator that is configured to generate energy threshold calibration data that defines a relationship between a set of calibration thresholds and input calibration electrical pulses having heights that correspond to known energy levels based on the input calibration electrical pulses injected into the shaper, to increment or decrement each of the calibration thresholds over corresponding predetermined ranges of threshold values one or more times for one or more data acquisition frames using completion of the one or more data acquisition frames as a trigger for incrementing or decrementing the calibration thresholds, and to analyse the corresponding count values of each threshold for each change in threshold value; and an energy-binner that is configured to bin the counts corresponding to the processed signals into energy ranges based on the set of energy thresholds and the calibration data defining a relationship between the threshold levels and the energy of incoming radiation, thereby energy-resolving the detected radiation. a detector array, with a plurality of direct conversion detector pixels, that is configured to detect radiation traversing an examination region of the imaging system and generates a signal indicative of the detected radiation; a pulse shaper configured to process the signal and generate a pulse with a height indicative of the energy of the processed radiation; a discriminator with comparators configured to energy discriminate the pulse based on a set of thresholds and generate, for each energy threshold of the set of energy thresholds, a signal which indicates whether the height of the pulse exceeds the energy threshold; a counter that is configured to process the signals output by the discriminator and counts, for each threshold, if the signal indicates that the height of the pulse exceeds the energy threshold; a threshold calibrator that is configured to generate energy threshold calibration data that defines a relationship between a set of calibration thresholds and input calibration electrical pulses having heights that correspond to known energy levels based on the input calibration electrical pulses injected into the shaper, to increment or decrement each of the calibration thresholds over corresponding predetermined ranges of threshold values one or more times for one or more data acquisition frames using completion of the one or more data acquisition frames as a trigger for incrementing or decrementing the calibration thresholds, and to analyse the corresponding count values of each threshold for each change in threshold value; and an energy-binner that is configured to bin the counts corresponding to the processed signals into energy ranges based on the set of energy thresholds and the calibration data defining a relationship between the threshold levels and the energy of incoming radiation, thereby energy-resolving the detected radiation.