Method for providing an optimized energy bin parameter set for photon-counting spectral computed tomography, the method comprising the following steps: - receiving (RD) photon-counting spectral computed tomography data related to a plurality of energy bins and an initial energy bin parameter set, - performing (PI) iteration steps of a plurality of iteration steps, - wherein the input of the first iteration step of the plurality of iteration steps comprises the initial energy bin parameter set as an input energy bin parameter set, - wherein the input of each further iteration step of the plurality of iteration steps comprises an adjusted energy bin parameter set calculated in the preceding iteration step of the plurality of iteration steps as the input energy bin parameter set, - providing (PP) the optimized energy bin parameter set based on the adjusted energy bin parameter set calculated in the last iteration step of the plurality of iteration steps, - wherein each iteration step of the plurality of iteration steps comprises the following steps: a) calculating (CI) medical image data by applying at least one reconstruction algorithm onto the photon-counting spectral computed tomography data and the input energy bin parameter set, b) calculating (CS) segmentation data related to an anatomical structure in the medical image data by applying at least one segmentation algorithm onto the medical image data, c) calculating (CE) evaluation data by applying an evaluation algorithm onto the segmentation data, d) calculating (CO) the adjusted energy bin parameter set by applying an optimization algorithm onto the evaluation data and the input energy bin parameter set. - receiving (RD) photon-counting spectral computed tomography data related to a plurality of energy bins and an initial energy bin parameter set, - performing (PI) iteration steps of a plurality of iteration steps, - wherein the input of the first iteration step of the plurality of iteration steps comprises the initial energy bin parameter set as an input energy bin parameter set, - wherein the input of each further iteration step of the plurality of iteration steps comprises an adjusted energy bin parameter set calculated in the preceding iteration step of the plurality of iteration steps as the input energy bin parameter set, - providing (PP) the optimized energy bin parameter set based on the adjusted energy bin parameter set calculated in the last iteration step of the plurality of iteration steps, - wherein each iteration step of the plurality of iteration steps comprises the following steps: a) calculating (CI) medical image data by applying at least one reconstruction algorithm onto the photon-counting spectral computed tomography data and the input energy bin parameter set, b) calculating (CS) segmentation data related to an anatomical structure in the medical image data by applying at least one segmentation algorithm onto the medical image data, c) calculating (CE) evaluation data by applying an evaluation algorithm onto the segmentation data, d) calculating (CO) the adjusted energy bin parameter set by applying an optimization algorithm onto the evaluation data and the input energy bin parameter set. a) calculating (CI) medical image data by applying at least one reconstruction algorithm onto the photon-counting spectral computed tomography data and the input energy bin parameter set, b) calculating (CS) segmentation data related to an anatomical structure in the medical image data by applying at least one segmentation algorithm onto the medical image data, c) calculating (CE) evaluation data by applying an evaluation algorithm onto the segmentation data, d) calculating (CO) the adjusted energy bin parameter set by applying an optimization algorithm onto the evaluation data and the input energy bin parameter set. <EOS>