Calibrating a photon-counting detector can include receiving a reference signal, by circuitry, where the reference signal is measured by a reference detector that measures an output from an X-ray tube. Determining circuitry can then determine, for a detector channel of the photon-counting detector, a mapping between a first true count rate on the detector channel without an object and the reference signal in accordance with a linear relationship between the reference signal and the first true count rate, based on a measured count rate on the detector channel and a predefined relationship between the first true count rate and the measured count rate.