K-edge spectral computed tomography with a photon counting detector and discrete reconstruction