A method implemented in a data-processing device for converting spectral CT datasets into electron density datasets, the method comprising: retrieving at least a set of fitted parameter of a function predicting electron densities of material mixtures, said set of fitted parameter being obtained by carrying out a preparation method comprising the steps of; modelling first attenuation coefficients representing attenuation characteristics of at least one material mixture as a combination of second attenuation coefficients of constituent elements of the at least one material mixture for a first set of at least two different values of physical phenomena contributing to attenuation; determining base components of a material decomposition model for each of the at least one material mixtures, each component being a function of the first attenuation coefficients, the determining being performed by solving a system of equations relating said first attenuation coefficients to combinations of known base material attenuation coefficients determined by a second set of at least two different values of physical phenomena contributing to attenuation; fitting a parametrized function of said two base components to an obtained reference value for the electron densities of said material mixtures, thus obtaining a function with a set of fitted parameters predicting electron densities of the material mixtures; obtaining a spectral CT dataset comprising a plurality of measurement points, extracting base components for each measurement point within the CT dataset, and applying the function with the set of fitted parameters to the extracted base components, thus obtaining an electron density dataset, the method being characterised in that: said fitting a parametrized function of said two base components to obtained electron densities of said material mixtures involves fitting a polynomial function of the form ρ x, CT r = ∑ ij g ij c 1 i r c 2 j r where ρ x,CT electron density, g ij polynomial coefficients, c 1, c 2 coefficients of the base material decomposition. retrieving at least a set of fitted parameter of a function predicting electron densities of material mixtures, said set of fitted parameter being obtained by carrying out a preparation method comprising the steps of; modelling first attenuation coefficients representing attenuation characteristics of at least one material mixture as a combination of second attenuation coefficients of constituent elements of the at least one material mixture for a first set of at least two different values of physical phenomena contributing to attenuation; determining base components of a material decomposition model for each of the at least one material mixtures, each component being a function of the first attenuation coefficients, the determining being performed by solving a system of equations relating said first attenuation coefficients to combinations of known base material attenuation coefficients determined by a second set of at least two different values of physical phenomena contributing to attenuation; fitting a parametrized function of said two base components to an obtained reference value for the electron densities of said material mixtures, thus obtaining a function with a set of fitted parameters predicting electron densities of the material mixtures; modelling first attenuation coefficients representing attenuation characteristics of at least one material mixture as a combination of second attenuation coefficients of constituent elements of the at least one material mixture for a first set of at least two different values of physical phenomena contributing to attenuation; determining base components of a material decomposition model for each of the at least one material mixtures, each component being a function of the first attenuation coefficients, the determining being performed by solving a system of equations relating said first attenuation coefficients to combinations of known base material attenuation coefficients determined by a second set of at least two different values of physical phenomena contributing to attenuation; fitting a parametrized function of said two base components to an obtained reference value for the electron densities of said material mixtures, thus obtaining a function with a set of fitted parameters predicting electron densities of the material mixtures; obtaining a spectral CT dataset comprising a plurality of measurement points, extracting base components for each measurement point within the CT dataset, and applying the function with the set of fitted parameters to the extracted base components, thus obtaining an electron density dataset, the method being characterised in that: said fitting a parametrized function of said two base components to obtained electron densities of said material mixtures involves fitting a polynomial function of the form ρ x, CT r = ∑ ij g ij c 1 i r c 2 j r where ρ x,CT electron density, g ij polynomial coefficients, c 1, c 2 coefficients of the base material decomposition. ρ x,CT electron density, g ij polynomial coefficients, c 1, c 2 coefficients of the base material decomposition.