There is provided a method and corresponding system and apparatus for image reconstruction based on image data from a photon-counting multi-bin x-ray detector. The method includes determining (S1) parameter(s) of a given functional form of the relationship between comparator settings expressed in voltage in the read-out chain of the x-ray detector and the corresponding energy threshold values expressed in energy based on a fitting procedure between a first set of data representative of a measured pulse height spectrum and a second set of data representative of a reference pulse height spectrum. The method also includes performing (S2) image reconstruction based on the image data and the determined parameter(s). In this way, efficient high-quality image reconstruction can be achieved.