Beam Hardening

xrayphysics.xrayPhysics.setBHlookupTable(self, spectralResponse, gammas, Z, referenceEnergy=0.0, T_atten=0.0, N_atten=0)

Calculate a beam hardening transfer function of a given material

Parameters:
  • spectralResponse (numpy array) – spectra model

  • gammas (numpy array) – energies at which the spectra model is defined

  • Z (scalar or string) – atomic number, chemical formula, mixture of compounds with mass fractions, or member of the material library

  • referenceEnergy (scalar) – the energy (keV) of the monochromatic attenuation (if not specified uses the mean energy of the spectra)

  • T_atten (scalar) – the sampling rate of the monochromatic attenuation

  • N_atten (int) – the number of samples of the monochromatic attenuation

Returns:

A 1D numpy array that maps monochromatic attenuation to polychromatic attenuation

xrayphysics.xrayPhysics.setBHClookupTable(self, spectralResponse, gammas, Z, referenceEnergy=0.0, T_atten=0.0, N_atten=0)

Calculate a beam hardening correction transfer function of a given material

Parameters:
  • spectralResponse (numpy array) – spectra model

  • gammas (numpy array) – energies at which the spectra model is defined

  • Z (scalar or string) – atomic number, chemical formula, mixture of compounds with mass fractions, or member of the material library

  • referenceEnergy (scalar) – the energy (keV) of the monochromatic attenuation (if not specified uses the mean energy of the spectra)

  • T_atten (scalar) – the sampling rate of the polychromatic attenuation

  • N_atten (int) – the number of samples of the polychromatic attenuation

Returns:

A 1D numpy array that maps polychromatic attenuation to monochromatic attenuation

xrayphysics.xrayPhysics.polynomialBHC(self, spectralResponse, gammas, Z, density, referenceEnergy=0.0, maxThickness=10.0, order=2)

Calculate the coefficients of a polynomial-based beam hardening correction transfer function of a given material

Parameters:
  • spectralResponse (numpy array) – spectra model

  • gammas (numpy array) – energies at which the spectra model is defined

  • Z (scalar or string) – atomic number, chemical formula, mixture of compounds with mass fractions, or member of the material library

  • density (scalar) – the mass density (g/cm^3) of the matial

  • referenceEnergy (scalar) – the energy (keV) of the monochromatic attenuation (if not specified uses the mean energy of the spectra)

  • maxThickness (scalar) – the maximum thickness (cm) that one expects to penetrate of this material (defines the range of values for the polynomial fit)

  • order (int) – the order of the polynomial

Returns:

A numpy array of the coefficients of the BHC polynomial

xrayphysics.xrayPhysics.setTwoMaterialBHClookupTable(self, spectralResponse, gammas, sigma_1, sigma_2, referenceEnergy=None, T_atten=0.0, N_atten=0)

Calculate a two-material beam hardening correction transfer function of the two given materials

Parameters:
  • spectralResponse (numpy array) – spectra model

  • gammas (numpy array) – energies at which the spectra model is defined

  • sigma_1 (numpy array) – the mass cross section of the lower attenuating material

  • sigma_2 (numpy array) – the mass cross section of the higher attenuating material

  • referenceEnergy (scalar) – the energy (keV) of the monochromatic attenuation (if not specified uses the mean energy of the spectra)

  • T_atten (scalar) – the sampling rate of the polychromatic attenuation (if unspecified, uses default values)

  • N_atten (int) – the number of samples of the polychromatic attenuation (if unspecified, uses default values)

Returns:

A 2D numpy array that maps polychromatic attenuation to monochromatic attenuation