## 2 Materials and Methods
### Simulation Study  
A simulation study was conducted using the measured incident polychromatic X-ray spectrum of the lab source shown in Figure 1. The simulation study assumed an energy sampling frequency of 0.2 keV and did not take into account the actual finite experimental energy resolution of the PiXirad detector (Figure S2). For the simulation, the MATLAB (The MathWorks Inc., Sydney, Australia) programming package was used to model the experiment. The simulation includes the effect of the energy threshold, the spectral distribution of the source, information about the linear attenuation as function of energy, as well as experimental geometry and sample size and thickness. However, we note that the simulation study did not take into account the effect of charge-sharing due to the complex nature of this phenomenon for polychromatic X-rays. The transmitted intensity is calculated via a summation over all energies present in the spectrum weighted by their spectral contribution. A schematic diagram providing an overview of the simulation is presented in Figure S3 in the Supplementary Material. In the simulation, three different phantom samples were considered, shown in Figure 2. Each phantom consisted of a 10-mm diameter cylinder of epoxy resin (density 1.13 g/cm\({}^{3}\)) with three different inserts of the same resin enriched with varying amounts of hydroxyapatite (HA), Ca\({}_{5}\)(PO\({}_{4}\))\({}_{3}\)(OH), with densities of 1.39, 1.65 and 1.90 g/cm\({}^{3}\), corresponding to HA400, HA800 and HA1200 respectively, see Table 1. The diameter of all the inserts was 2 mm. The absorption coefficients for the elements comprising the phantom as a function of X-ray energy were obtained from the NIST materials database [50]. The polychromatic intensity in the simulations was calculated via a summation of the monochromatic intensities over all incident wavelengths, weighted by their relative contribution to the measured incident X-ray spectrum, _S(E)_. \(s_{i}\) is the one-dimensional projected thickness of the phantom (as viewed from the XZ plane). Figure 3 summarizes the workflow for the simulations applying the matrix method to separate epoxy and HA400 (using the first phantom shown in Figure 2a). The top row of Figure 3 shows the four transmitted intensity projections corresponding to four energy thresholds. The second row shows the projection intensity difference at \(I(\Delta E_{a})\) which is obtained from Equation (1) and at \(I(\Delta E_{b})\) which is obtained from Equation (2). The third row shows the normalized intensity difference for \(\overline{I}(\Delta E_{a})\) and \(\overline{I}(\Delta E_{b})\) such that the value in the absence of a sample is equal to unity. These results form the input for Equation (7) (the matrix equation). The linear attenuation parameters for epoxy and HA400 in the matrix equation at energies \(\Delta E_{a}\) and \(\Delta E_{b}\) were calculated using Equation (3). The bottom row shows the retrieved thickness of the separated epoxy and HA400 components respectively based on the solution of the matrix equation. In order to investigate the optimum conditions required to separate the epoxy and HA, three different energy bandwidths for energy threshold positions ranging from 16 keV to 30 keV were investigated as shown in Table 2. Note that the two bandwidths at 9 keV are overlapping. All three simulated phantom samples were analyzed. The matrix method, employing four intensity images, enabled the separation of epoxy and HA400, epoxy and HA800, and epoxy and HA1200. An example result of the separation of epoxy from HA400 is shown in Figure 4, together with the actual thickness value based on the input sample parameters for comparison. \begin{table}
\begin{tabular}{c c c c} \hline
**Material** & **Density \(\pm\) 0.02 (g/cm\({}^{3}\))** & **Base (Epoxy Resin) (\%)** & **HA Content (\%)** \\ \hline epoxy & 1.13 & 100 & 0 \\ HA400 & 1.39 & 71.31 & 28.87 \\ HA800 & 1.65 & 51.2 & 48.8 \\ HA1200 & 1.9 & 36.51 & 63.49 \\ \hline \end{tabular}
\end{table}