A validation of SpekPy: A software toolkit for modelling X-ray tube spectra

  • Robert Bujila
    Corresponding author at: Medical Radiation Physics and Nuclear Medicine, Karolinska University Hospital, Stockholm, Sweden.
    Medical Radiation Physics and Nuclear Medicine, Karolinska University Hospital, Stockholm, Sweden

    Department of Physics, Royal Institute of Technology, Stockholm, Sweden
    Search for articles by this author
  • Artur Omar
    Medical Radiation Physics and Nuclear Medicine, Karolinska University Hospital, Stockholm, Sweden

    Department of Oncology-Pathology, Karolinska Institutet, Stockholm, Sweden
    Search for articles by this author
  • Gavin Poludniowski
    Medical Radiation Physics and Nuclear Medicine, Karolinska University Hospital, Stockholm, Sweden

    Department of Oncology-Pathology, Karolinska Institutet, Stockholm, Sweden
    Search for articles by this author


      • Improvements to the popular SpekCalc model of photon emission from a tungsten anode.
      • User-friendly software tool available in Python (SpekPy).
      • Validations against reference standards and Monte Carlo simulations.



      To validate the SpekPy software toolkit that has been developed to estimate the spectra emitted from tungsten anode X-ray tubes. The model underlying the toolkit introduces improvements upon a well-known semi-empirical model of X-ray emission.

      Materials and methods

      Using the same theoretical framework as the widely-used SpekCalc software, new electron penetration data was simulated using the Monte Carlo (MC) method, alternative bremsstrahlung cross-sections were applied, L-line characteristic emissions were included, and improvements to numerical methods implemented. The SpekPy toolkit was developed with the Python programming language. The toolkit was validated against other popular X-ray spectrum models (50 to 120 kVp), X-ray spectra estimated with MC (30 to 150 kVp) as well as reference half value layers (HVL) associated with numerous radiation qualities from standard laboratories (20 to 300 kVp).


      The toolkit can be used to estimate X-ray spectra that agree with other popular X-ray spectrum models for typical configurations in diagnostic radiology as well as with MC spectra over a wider range of conditions. The improvements over SpekCalc are most evident at lower incident electron energies for lightly and moderately filtered radiation qualities. Using the toolkit, estimations of the HVL over a large range of standard radiation qualities closely match reference values.


      A toolkit to estimate X-ray spectra has been developed and extensively validated for central-axis spectra. This toolkit can provide those working in Medical Physics and beyond with a powerful and user-friendly way of estimating spectra from X-ray tubes.


      To read this article in full you will need to make a payment

      Purchase one-time access:

      Academic & Personal: 24 hour online accessCorporate R&D Professionals: 24 hour online access
      One-time access price info
      • For academic or personal research use, select 'Academic and Personal'
      • For corporate R&D use, select 'Corporate R&D Professionals'


      Subscribe to Physica Medica: European Journal of Medical Physics
      Already a print subscriber? Claim online access
      Already an online subscriber? Sign in
      Institutional Access: Sign in to ScienceDirect


      1. ICRU. Report 74: Patient dosimetry for X-rays used in medical imaging. J ICRU. 2005;5.

      2. ICRU. Report 70: Image Quality in Chest Radiography. J ICRU. 2003;3.

      3. ICRU. Report 82: Mammography - Assesment of Image Quality. J ICRU. 2009;9.

      4. ICRU. Report 87: Radiation Dose and Image-Quality Assesment in Computed Tomography. J ICRU. 2012;12.

        • Peaple L.H.
        • Burt A.K.
        The measurement of spectra from x-ray machines.
        Phys Med Biol. 1969; 14: 73-85
        • Waggener R.G.
        • Levy L.B.
        • Rogers L.F.
        • Zanca P.
        Measured x-ray spectra from 25 to 110 kVp for a typical diagnostic unit.
        Radiology. 1972; 105: 169-175
        • Ay M.R.
        • Shahriari M.
        • Sarkar S.
        • Adib M.
        • Zaidi H.
        Monte Carlo simulation of x-ray spectra in diagnostic radiology and mammography using MCNP4C.
        Phys Med Biol. 2004; 49: 4897-4917
        • Bazalova M.
        • Verhaegen F.
        Monte Carlo simulation of a computed tomography x-ray tube.
        Phys Med Biol. 2007; 52: 5945-5955
        • Boone J.M.
        • Seibert J.A.
        An accurate method for computer-generating tungsten anode x-ray spectra from 30 to 140 kV.
        Med Phys. 1997; 24: 1661-1670
        • Hernandez A.M.
        • Boone J.M.
        Tungsten anode spectral model using interpolating cubic splines: unfiltered x-ray spectra from 20 kV to 640 kV.
        Med Phys. 2014; 41
        • Siewerdsen J.H.
        • Waese A.M.
        • Moseley D.J.
        • Richard S.
        • Jaffray D.A.
        Spektr: a computational tool for x-ray spectral analysis and imaging system optimization.
        Med Phys. 2004; 31: 3057-3067
        • Punnoose J.
        • Xu J.
        • Sisniega A.
        • Zbijewski W.
        • Siewerdsen J.H.
        Technical Note: spektr 3.0-A computational tool for x-ray spectrum modeling and analysis.
        Med Phys. 2016; 43: 4711
        • Birch R.
        • Marshall M.
        Computation of bremsstrahlung X-ray spectra and comparison with spectra measured with a Ge(Li) detector.
        Phys Med Biol. 1979; 24: 505-517
      5. Birch RM, M., Ardran GM. Catalogue of spectral data for diagnostic X-rays. Report series; v 30: Hospital Physicists' Association. Diagnostic Radiology Topic Group; 1979.

      6. Cranley K, Gilmore BJ, Fogarty GWA, Deponds L. IPEM Report 78: Catalogue of diagnostic x‐ray spectra and other data. The Institute of Physics and Engineering in Medicine; 1997.

        • Poludniowski G.G.
        Calculation of x-ray spectra emerging from an x-ray tube. Part II. X-ray production and filtration in x-ray targets.
        Med Phys. 2007; 34: 2175-2186
        • Poludniowski G.G.
        • Evans P.M.
        Calculation of x-ray spectra emerging from an x-ray tube. Part I. Electron penetration characteristics in x-ray targets.
        Med Phys. 2007; 34: 2164-2174
        • Poludniowski G.
        • Landry G.
        • DeBlois F.
        • Evans P.M.
        • Verhaegen F.
        SpekCalc: a program to calculate photon spectra from tungsten anode x-ray tubes.
        Phys Med Biol. 2009; 54: N433-N438
        • Landry G.
        • deBlois F.
        • Verhagen F.
        ImaSim, a software tool for basic education of medical X-ray imaging in radiotherapy and radiology.
        Front Phys. 2013; 1: 22
        • Hernandez G.
        • Fernandez F.
        A model of tungsten anode x-ray spectra.
        Med Phys. 2016; 43: 4655
        • Seltzer S.M.
        • Berger M.J.
        Bremsstrahlung spectra from electron interactions with screened atomic nuclei and orbital electrons.
        Nucl Instrum Methods Phys Res, Sect B. 1985; 12: 95-134
      7. Poludniowski G. Calculation of X-ray Spectra. Handbook of X-ray Imaging: Physics and Technology. 2017:185.

        • Persson M.
        • Bujila R.
        • Nowik P.
        • Andersson H.
        • Kull L.
        • Andersson J.
        • et al.
        Upper limits of the photon fluence rate on CT detectors: case study on a commercial scanner.
        Med Phys. 2016; 43: 4398
        • Oden J.
        • Zimmerman J.
        • Poludniowski G.
        Comparison of CT-number parameterization models for stoichiometric CT calibration in proton therapy.
        Phys Med. 2018; 47: 42-49
        • Ali E.S.
        • Rogers D.W.
        Quantifying the effect of off-focal radiation on the output of kilovoltage x-ray systems.
        Med Phys. 2008; 35: 4149-4160
      8. Rogers D, Walters B, Kawrakow I. BEAMnrc users manual. Nrc Report Pirs. 2009;509:12.

      9. Kawrakow I, Rogers D. The EGSnrc code system. NRC Report PIRS-701, NRC, Ottawa. 2000.

      10. ESTAR N. Estar-Stopping power and range tables for electrons. 2009.

      11. Ma C, Rogers D. BEAMDP users manual. NRC Report PIRS-0509 (D). 1995.

      12. Salvat F, Fernández-Varea JM, Sempau J. PENELOPE-2008: A code system for Monte Carlo simulation of electron and photon transport. Workshop Proceedings2006. p. 7.

        • Carlson T.
        Photoelectron and Auger spectroscopy.
        Springer Science & Business Media, 2013
        • Perkins S.
        • Cullen D.
        • Chen M.
        • Rathkopf J.
        • Scofield J.
        • Hubbell J.
        Tables and graphs of atomic subshell and relaxation data derived from the LLNL Evaluated Atomic Data Library (EADL), Z= 1–100.
        Lawrence Livermore National Lab, CA (United States)1991
        • Deslattes R.D.
        • Kessler Jr, E.G.
        • Indelicato P.
        • De Billy L.
        • Lindroth E.
        • Anton J.
        X-ray transition energies: new approach to a comprehensive evaluation.
        Rev Mod Phys. 2003; 75: 35
      13. Berger M, Hubbell J, Seltzer S, Chang J, Coursey J, Sukumar R, et al. Xcom: Photon cross sections database, nist standard reference database 8 (xgam). URL http://physics nist gov/PhysRefData/Xcom/Text/XCOM html. 2010.

        • Omar A.
        • Andreo P.
        • Poludniowski G.
        Performance of different theories for the angular distribution of bremsstrahlung produced by keV electrons incident upon a target.
        Radiat Phys Chem. 2018; 148: 73-85