An apparatus and method of processing X-ray projection data including spectral computed tomography (CT) projection data. The spectral CT data is decomposed into material projection lengths using a material-decomposition method that includes an initial-estimate method to provide an initial projection-lengths estimate. The initial-estimate method can include first reconstructing an image using non-spectral CT data, and then subdividing the reconstructed image into materials according to the relative attenuation density of areas within the reconstructed image (e.g., high attenuation areas correspond to a high attenuation material such as bone). The projection length estimates of each material are then obtained by forward projecting the corresponding subdivision of the reconstructed image. Also, the initial estimate can be obtained/refined by selecting the projection lengths with smallest cost-function value from randomly chosen projection lengths within a sample space. The initial estimate can also be conditioned on the X-ray flux at the X-ray source.