Application- and patient size-dependent optimization of x-ray spectra for CT