Abstract
The study of Xray fluorescence (XRF) emission spectra is a powerful technique used in applications that range from biology to cultural heritage. Key objectives of this technique include identification and quantification of elemental traces composing the analyzed sample. However, precise derivation of elemental concentration is often hampered by selfabsorption of the XRF signal emitted by light constituents. This attenuation depends on the amount of sample present between the radiation source and detection system and allows for the exploitation of selfabsorption in order to recover a sample topography. In this work, an Xraytracing application based on the use of multiple silicon drift detectors, is introduced to inversely reconstruct a 3D sample with correct topographical landscape, from 2D XRF count rates maps obtained from spectroscopy. The reconstruction was tested on the XRF maps of a simulated sample, which is composed of three cells with different size but similar composition. We propose to use the recovered 3D sample topography in order to numerically compute the selfabsorption effects on the Xray fluorescence radiation, thereby showing that a quantitative correction is possible. Lastly, we present a web application which implements the suggested methodology, in order to demonstrate its feasibility and applicability, available at: https://github.com/ElettraSciComp/xrfstir.
Similar content being viewed by others
Introduction
Xray fluorescence (XRF) spectroscopy is a versatile and wellestablished investigation tool for qualitative detection and quantification of elemental distributions within different types of samples^{1}. As such, this technique finds a wide range of applications, spanning from fields such as archeology^{2}, cultural heritage^{3,4}, geology^{5} and biology^{6,7}. Systems that are based at synchrotrons often constitute the most advanced technological examples of these applications, having at their disposal a series of features, such as variable spot size below the micrometer and high particle flux^{8,9}, that allow for finer analysis of complex samples.
The XRF radiation, which is generated within the constituent atoms of a sample by the photoelectric absorption of the incident beam, is emitted isotropically in every direction. Despite this characteristic behavior, the actual amount of XRF radiation emitted from a point source within the sample, may not be detected evenly among the available silicon drift detectors (SDD). This inconsistency in count rates can be attributed mainly to the selfabsorption of the XRF radiation by the sample itself, which in turn depends on the difference in path length encountered by the XRF photons when traveling from the production point within the sample to different SDDs. In other words, the surface topography and the orientation of SDDs with respect to the sample surface and incident beam direction is responsible for modulating the XRF signal observed by the single detectors^{10}. Depending on the severity in path length differences, the selfabsorption effect could yield misleading results on the actual mass and concentration of the element being examined^{11}. However, no straightforward solution has yet been found, due to the fact that there is no explicit way to decouple the absorption effects due to the sample topography and those due to its composition^{12,13}.
Over the years, different attempts have been made to introduce data analysis techniques capable of modeling XRF behavior within the scanned samples, in order to also provide a basis for quantitative information retrieval and correct for the selfabsorption effect. For example, Monte Carlo algorithms have been implemented in order to simulate the emission of XRF radiation and its detection^{14,15,16}. Alternatively, data analysis methods have also been implemented to correct for the angular dependence directly on the twodimensional (2D) XRF maps that are collected by the SDDs, through the use of the Fundamental Parameter (FP) Method^{17,18,19}. In particular, Trojek 2011 successfully demonstrated the application of the FP Method to reconstruct the 2D surface relief map of a metallic object and reduce the effects of selfabsorption on its XRF map^{17}. This was achieved through the use of a single detector and knowledge of the angles between the source, the sample and the detector. However, this method does not provide a threedimensional (3D) way to analyze the selfabsorption effect at various depths, focusing primarily on the surface of the object and may not be appropriate for all scanned samples.
Steps towards a 3D characterization and correction of the problem, have been taken in more recent years^{20,21}. In particular, in a work by Malucelli et al.^{19} the authors implemented a multimodal approach employing XRF Microscopy, Scanning Transmission Xray microscopy (STXM) and Atomic Force Microscopy (AFM) on top of the FP method. Here, for each pixel in the 2D XRF maps, the absorption of both the incident beam and XRF radiation, is calculated by integrating the absorption term formulated in the FP method over the sample’s thickness derived from the AFM^{22}. The density map, also required in this process, is then derived from the STXM data. By adopting this approach, the authors were successful in retrieving quantitative maps of molar concentration of different elements contained within two cell types from information coming from 8 detectors pertaining to the Low Energy XRF (LEXRF) system present at the TwinMic beamline Sincrotrone Trieste (Trieste, Italy)^{23}. However, the implementation of such multimodal approaches may be impractical to adopt, as it requires different types of image data acquisitions with different positioning and resolutions to be carefully registered together. Furthermore, the selfabsorption term pertaining to the XRF radiation, is calculated for each pixel by summing together the emission within the corresponding sample volume and considering only a single possible path to be undertaken by the emitted radiation to reach its respective detector. In this manner, it is not possible to fully exploit the 3D topographic information of the sample and calculate for each 3D emission voxel, all the possible paths leading the radiation to the detectors. As a consequence, the effective length of the paths traveled may be underestimated by not considering gaps produced by valleys and hills in the topography, resulting in an inaccurate quantification of the attenuation.
The presented study builds on the findings of a previous work by Billè et al.^{11}, in which an XRF simulation framework was presented, to verify the effects of the selfabsorption artifact on the elemental distribution of XRF imaging of cells. It was shown how strongly the topographical effects can dampen the count rates of fluorescence emission lines pertaining to light elements such as Carbon (C), Nitrogen (N) and Oxygen (O). In the current work, we present a raytracing based method to inversely reconstruct a 3D sample with its topographical landscape, simply from 2D XRF maps acquired on multidetector systems, together with an STXM map, an average density value and a maximum thickness value for the sample. Once the 3D sample structure has been reconstructed and its similarity with the actual simulated structure has been established, we propose to use it in order to numerically calculate the selfabsorption effects exerted by the sample on the XRF radiation at a 3D level and show that a quantitative correction is possible.
Methods
We introduce a novel 3D Inversion Reconstruction (IR) algorithm, which derives a 3D sample topography starting from 2D XRF images. The IR can be summarized into 3 main steps. First, we define a numerical simulation approach that from a 3D sample of known shape and composition, derives the corresponding 2D XRF maps that would be collected during a XRF experiment. Secondly, through the FP Method^{24}, we obtain the sample’s elemental composition information necessary to run the simulation directly from the 2D XRF maps. Lastly, an inhouse developed optimization approach based on raytracing, is employed to probe an ensemble of possible 3D sample topographies, and isolate the one minimizing the L1 norm between the actual experimental XRF maps and the simulated ones.
XRF simulation
To numerically resolve the absorption effects of the sample, we first characterize the data acquisition process for the SDD. The following considerations are based on the LEXRF detection system of TwinMic Beamline in Elettra Synchrotron^{23}, comprising a set of 8 SDDs with an incident energy \({E}_{0}\) between 400 and 2200 eV. Analogous considerations can be made for similar systems carrying out lowenergy XRF experiments.
Figure 1 shows a typical XRF setup for one SDD. The incident radiation is aligned parallel to the zaxis of the sample’s frame of reference, investing the sample for a certain exposure time and with a specific spot, whose size defines the final image resolution of the XRF images. In this work the spot size was 1 μm^{2} isotropic and the incident intensity (\({I}_{0}\)) was \(1{0}^{8}\) photons/μm^{2} integrated over the entire time of exposure, mimicking the conditions of a real experiment.
As radiation traverses the sample from its surface to the point of XRF radiation production, it is attenuated following the Beer–Lambert’s Law of Absorption \({I={I}_{0}e}^{{\mu }_{s}({E}_{0})\rho z}\), where \({I}_{0}\) is the incident beam’s intensity, \({\mu }_{s}({E}_{0})\) represents the total mass attenuation coefficient of the sample at the beam energy \({E}_{0}\), \(\rho\) represents the sample density and z is the traveled distance within the sample. As the incident radiation invests the sample, an absorption profile \(AB{S}_{s}={\mu }_{s}({E}_{0}) \rho dz\) is generated along the z−axis. Here, we propose to derive the sample thickness map along the incident beam direction (zmap) in an iterative fashion, starting from a Scanning Transmission Xray Microscopy (STXM) map.
Not all elements absorb the incoming radiation equally. To retrieve the fraction of the radiation which is absorbed via photoionization by every jth element \(AB{S}_{j}\), we need to multiply \(AB{S}_{s}\) by the mass fraction \({w}_{j}\) and by the ratio of the photoionization crosssection of the jth element (\({\tau }_{j}({E}_{0})\)) to \({\mu }_{s}\) at \({E}_{0}\)^{25}:
We then take into account the solid angle fraction covered by each detector \((\Omega /4\pi )\) and physical information related to the emission process for XRF line i, such as the fluorescence yield \({\omega }_{j}\), the transition probability \({p}_{ij}\) and the absorption jump ratio \({J}_{j}\), through the factor \(Y_{ij}({E}_{0},{E}_{i})=(\Omega /4\pi ){\omega }_{j}\,{p}_{ij}\,{ J}_{j}\). We then compute the 3D fluorescence emission matrix \(E{M}_{ij}\) of any element j in the sample^{25}:
During the acquisition, photons emitted from the same voxel can take \(\alpha\) different linear paths of length \({\delta }_{\alpha }\) towards the SDD. As it can be seen in Fig. 1, the differences in \({\delta }_{\alpha }\) depend on the portion of the sample traveled by the photon and in turn by the sample’s topography. The probability \({{P}^{\alpha }}_{T}\) that an XRF photon of energy \({E}_{i}\), directed along a single path α, will be able to arrive unabsorbed at the SDD’s interface, is as follows:
We construct the 3D response matrix of any SDD (\({XRF}_{3D}\)) by multiplying Eq. (2) by Eq. (3) for every voxel and summing over all the possible \(\alpha\) directions:
Here \(N_{\alpha }\) represents the total number of α paths available to reach a given SDD. We divide \(E{M}_{ij}\) by \(N_{\alpha }\) to redistribute photons among all available paths. As fluorescence emission is an isotropic phenomenon, we expect the same number of photons to be emitted in all directions. \(E{M}_{ij}\) is thus independent of the undertaken path and can be moved outside of the summation:
where K is a 3D matrix representing the selfabsorption effects exerted by the sample. K represents an average of all \({P}_{T}^{\alpha }\) across all possible paths. Equation (4) is a numerical construction, built from the FP method, that can be employed to simulate the 3D experimental response of any SDD, having provided the necessary information on sample geometry and composition. Furthermore, one can move from the 3D response matrix for an SDD, to its 2D analogous \({XRF}_{2D}\), by summing Eq. (4) over the axis parallel to the incident beam:
Following, it will be shown how to obtain the sample’s compositional information from 2D experimental XRF maps. These will be then used to generate an ensemble of possible 3D sample topographies to be evaluated through an iterative optimization procedure based on raytracing and Eqs. (2) and (4).
Deriving sample thickness map
We retrieve thickness information from the STXM data concurrently acquired with XRF data. Through approximate knowledge of the average sample density, maximum sample thickness and of the ranges of existence of both these quantities, it is possible to create an iterative procedure which at first generates a zmap according to the Law of absorption^{19}, by considering the product of \({\mu }_{s}({E}_{0})\rho\) initially constant. Successively, the algorithm identifies pixels where the derived thickness changes abruptly from its nearest neighbors, by choosing a threshold according to the average rate of change observed throughout the whole sample. These pixels are then adjusted iteratively in terms of both thickness and density.
Deriving compositional information for XRF simulation
The FP Method^{19,25} can be employed at a pixel level to retrieve the necessary compositional information, namely: \({w}_{j}\) and \({\mu }_{S}\) at the different \({E}_{i}\) considered. \({w}_{j}\) is calculated by first finding the mass of each element \({m}_{j}\):
where S is the surface area of the pixel, \({C}_{i}\) represents the cumulative counts of the emission line i recorded in the XRF spectra, and \({K}_{FP}\) is an absorption correction factor related to both the incident and XRF radiation, as derived from the FP method:
where h is the total sample thickness along the zaxis for the pixel under consideration in the 2D XRF image, \(\theta\) is the angle at which the incident beam invests the sample and \(\varphi\) represent all the possible different α paths available to reach the SDD. In the last passage of the equation, the term \({\sum }_{\alpha =1}^{{N}_{\alpha }}\frac{\mathrm{cosec}({\varphi }_{\alpha })}{{N}_{\alpha }}\) has been substituted with \({\langle \mathrm{cosec}(\varphi )\rangle }_{\alpha }\). For most setups, like the one treated in this work, the incident beam is perpendicular to the sample and therefore the term \(\mathrm{cosec}(\theta )=1\) and can be omitted.
Once all masses in a pixel are known, a single \({w}_{j}\) is calculated by dividing the mass of said element \({m}_{j}\) by the total mass \({m}_{s}\) as follows, \({w}_{j}={m}_{j}/{m}_{s}\). The maps for \({\mu }_{s}({E}_{0})\) and for \({\mu }_{s}({E}_{i})\), can then be calculated pixelwise, using the elemental mixture rule^{26,27,28,29}:
which takes into account the mass absorption coefficients of the single elements \({\mu }_{j}\), known from universal tables, and \({w}_{j}\).
We propose to firstly retrieve the mass fractions \({w}_{j}\) by discarding \({K}_{FP}\) in Eq. (5). Successively, maps of \({\mu }_{s}({E}_{0})\) and \({\mu }_{s}({E}_{i})\) are calculated from Eq. (6) and employed by the raytracing IR algorithm to find a 3D topography. This topography attempts to minimize the L1 norm between the experimental XRF maps and the \({XRF}_{2D}\) maps obtained through simulation using the newly reconstructed sample and Eq. (4). At a second stage, we employ the reconstructed sample topography to calculate the emission matrix \(E{M}_{ij}\), thereby attempting to retrieve the correct cumulative counts for each emission line i, before selfabsorption takes place.
Raytracing based inverse reconstruction
The presented IR algorithm exploits both complementary and redundant information from the multiple detectors available to infer a sample topography. The general idea is to:

1.
iteratively derive a zmap from a STXM scan with the use of Beer–Lambert’s Law, an average density value and a maximum thickness value for the sample;

2.
use the zmap to generate an ensemble of possible topographies. This is limited by a geometric constraint imposing that along the beam’s axis the sample is continuous and free from gaps;

3.
verify the goodness of each sample topography by calculating Eq. (4) and confronting the result of each simulated \({XRF}_{2D}\) map with the actual data, by means of the L1norm.
The zmap derivation is an iterative procedure that requires estimates of the average sample density and the maximum sample thickness we can expect. In the first iteration we associate the most absorbing pixels in the STXM with the maximum expected thickness. We then consider temporarily, the product of density and mass attenuation coefficient as constant for every pixel. In this way we can calculate a thickness map for all the remaining pixels. We then calculate over this thickness map the average slope present between each pixel and its nearest neighbors. This value is used as a threshold to select those pixels which seem to change thickness too abruptly with respect to the average change observed in the sample. All the identified pixels are then selected and their thickness value is replaced with the average thickness value of its nearest neighbors. At the same time the linear attenuation coefficient is recalculated for these pixels from the STXM using the newly found thickness. A new iteration can now begin and repeat the whole process until completion.
During the IR, each SDD reconstructs a topography independently of the other detectors. Subsequently, the information from the different detectors is merged together to yield a single 3D representation of the sample. Let us therefore consider a single SDD. Through the use of raytracing, each pixel in the XRF_{2D} maps is assigned a value that quantifies fraction present between it and the center of the detector’s face, as shown in Fig. 2a. We then select a seed pixel among the ones with the lowest amount of sample shielding from the detector (white circle) and we identify all the pixels lying on the line going through this seed and the detector’s center, as shown in Fig. 2b. We then pick a number of equally spaced pixels from this line (blue), in the direction moving away from the SDD which is placed in the SouthEast corner of the image. For each of these new pixels a conical region of interest (green) is identified, which encloses all the possible directions that an XRF photon can take to hit the SDD’s active surface as shown in Fig. 2c. Within this green region, we then need to identify all the possible geometrical permutations there can be in placing the sample. This is accomplished by firstly recovering the sample thickness map along z and expanding the sample in 3D, starting from a flat support in the xy plane and then growing each pixel along z. Secondly, all viable permutations are generated by rigidly translating each pixel in the green region along the zaxis in different combinations. The rationale behind this point is that among the generated topography permutations there is also the correct 3D topography, or at least a close representation. The only assumption made here to make a topography viable, is to have sample continuity along z. In other words, the rigid translations that bring about gaps along z between adjacent pixels in the 2D conical region of interest are not allowed. This is done in order to reduce the ensemble’s size and therefore ease the computational load.
Each 3D topography is then tested, by generating the elemental XRF_{2D} maps through Eq. (4) and computing the L1norm map with respect to the corresponding XRF_{2D} maps from the experiment. A score is assigned to each candidate, which is equal to the pixelwise sum of the L1norm map. After all candidates have been validated, the lowest scoring topography is fixed in 3D for the green region and the whole process is repeated in the next conical region of interest in Fig. 2d (red region). This new conical ROI, will therefore partly contain an already resolved portion of sample (green region), rendering the complete reconstruction process along the blue line affordable in terms of computation. Once the reconstruction of a full blue line is finished, a new line is identified which covers different portions of the sample and the whole process is repeated until completion.
In order to speed up the reconstruction, two different parameters were introduced in the algorithm: the permutations threshold (δ) and the Inverse Reconstruction oversampling parameter (\(I{R}_{os}\)). Regarding the former, it determines the maximum number of candidate topographies that will be generated and tested inside the conical regions of interest shown in Fig. 2c,d. If for example, one such region has 10^{4} total permutations available, by setting δ equal to 10^{3}, the system will take a permutation in every 10 for testing. In this process the candidate topographies are always sampled equidistantly from each other, in order to avoid selection biases. As for the latter parameter, thanks to coverage level maps such as the one in Fig. 2a, it is possible to establish for each pixel what is the most attenuated detector and normalize all coverage levels from the remaining detectors with this value. If the normalized coverage level value of a detector for a specific pixel is smaller or equal to the selected \(I{R}_{os}\), then the pixel will be reconstructed for that detector, otherwise it will be excluded from the process (\(I{R}_{os}=0\) closest detector only, \(I{R}_{os}=1\) all detectors). The last step to be considered before the final single 3D sample can be derived, involves the merging of the different topographies computed independently from each detector. For each pixel, we set the normalized coverage level values associated to each SDD, as the weights of a weighted average. In this manner, the final 3D sample configuration is constructed in each pixel, by giving more weight to the detectors which are least attenuated by the sample. The presented algorithm was developed inhouse with Python (Python Software Foundation) and the justintime compiler Numba^{30}.
Simulated sample
The sample simulated in this study consists of three hemispheres of radii 6, 9 and 12 \(\mu m\) respectively to simulate cells of different sizes. The \({w}_{j}\) composition was based on the characteristic one of human colon carcinoma cells LoVo^{19}, which consists of 61% C, 17% N and 16% O and average density value of 1.25 g/cm^{3}. Three small regions of interest were chosen, in order to introduce an additional element, Magnesium (Mg), with a \({w}_{j}\) of 4%. As required assumptions, the sample’s elemental composition is considered homogeneous along the zaxis and also the sample’s thickness along the same axis is considered to be continuous with no interleaving gaps.
Quantitative evaluations
\(E{M}_{ij}\) In Eq. (2) describes the XRF photons in every voxel source, prior to selfabsorption, allowing us to retrieve the mass of each element composing the sample. Calculating \(E{M}_{ij}\) precisely involves knowledge of both the sample’s 3D structure and the \({w}_{j}\) of all the elements therein. The latter could be found by using the sample structure retrieved through the IR to compute Eq. (4) for different sets of mass fractions. The optimal set could then be chosen as the one minimizing the L1 norm between the \({XRF}_{2D}\) images produced by varying the \({w}_{j}\) sets, and the experimental XRF maps. However, the generation of such a system to fit \({w}_{j}\) goes beyond the scope of this work. Here we simply show that knowledge of a 3D structure, as reconstructed with the proposed algorithm, allows us to perform a quantitative correction of the elemental presence, provided the correct \({w}_{j}\) are known.
Two \(E{M}_{ij}\) matrices were calculated using the same 3D sample structure recovered through the IR: one with the correct \({w}_{j}\) for all the elements (\(E{M}^{c}\)) and one with the incorrect \({w}_{j}\) using Eq. (5) by omitting \({K}_{FP}\) (\(E{M}^{u}\)). \(E{M}^{c}\) and \(E{M}^{u}\) are compared against the true emission matrix simulated (\(E{M}^{s}\)) via Eq. (2), obtained using the correct \({w}_{j}\) and the true 3D sample. The same comparison is carried out, on the \({XRF}_{2D}\) maps summed across all detectors, having defined the image generated with: the correct mass fractions and IR sample structure (\(\Sigma XR{F}^{c}\)); the incorrect mass fractions and the IR sample structure (\(\Sigma XR{F}^{u}\)); the correct mass fractions and the true 3D sample matrix (\(\Sigma XR{F}^{s}\)).
The statistical analysis consisted in determining the least square differences from the true images (\(\overline{\Delta {EM}_{u}}\), \(\overline{\Delta {EM}_{c}}\), \(\overline{\Delta {XRF}_{u}}\), \(\overline{\Delta {XRF}_{c}}\)). All images were summed along the zaxis before the analysis, which was then carried out over 778 pixels constituting the entire 2D sample. Statistical significance in the difference of the mean values was assessed through a paired ttest, after verifying the normality assumption, through the 1sample Kolmogorov–Smirnov test. Differences were considered to be significant for p < 0.001.
Results
3D sample reconstruction
All necessary compositional information, such as the mass fractions of the different elements \({w}_{j}\) present, the mass absorption coefficients of the elemental mixture making up the sample at the different line energies \({\mu }_{s}({E}_{i})\) and beam energy \({\mu }_{s}({E}_{0})\), were derived through Eqs. (5) and (6). The count rate maps \(XR{F}^{s}\) pertaining to the \({K}_{\alpha }\) emission line of Carbon, were chosen as the target images for the optimizer of the raytracing IR algorithm. Carbon emission lines were chosen as an example since due to their low energy, they are most subject to selfabsorption. Thickness information was successfully extracted from STXM data through the proposed iterative procedure, as can be observed in Fig. 3. After 1000 iterations the observed average percentage difference between the true zmap and the recovered one was − 3.4 ± 5.3%, while for \({\mu }_{s}({E}_{0})\rho\) the difference was 2.9 ± 5.5%.
Figure 4 shows the comparison between various profiles of the actual artificial sample (top row) and the reconstructed sample (bottom row). As it can be seen, most of the reconstructed sample already qualitatively shows a good resemblance with the actual sample in terms of topographic features such as the slopes and valleys present when moving from one hemisphere to another. The overall similarity of the two structures is also highlighted by the more quantitative evaluation of the volume percentage overlap which was found to be at 82% with \(I{R}_{os}=0.2\) and 86% with \(I{R}_{os}=1\).
Cumulative counts correction
After the retrieval of a 3D sample structure through the IR, the exact mass fractions of the elements present were employed in order to calculate \({XRF}_{3D}\) and \({XRF}_{2D}\) through Eq. (4) for all SDDs. This was done in order to quantitatively evaluate the effects of the absorption correction based on the newly acquired 3D sample structure, which is derived from inexact mass fractions directly from the XRF data. Figure 5a–c shows \({XRF}_{2D}\) maps of the cumulative counts for the \({K}_{\alpha }\) line of C for the \(XR{F}^{s}\), \(XR{F}^{u}\) and corrected data \(XR{F}^{c}\) respectively, displayed with the same range. The \(XR{F}^{u}\) and \(XR{F}^{c}\) maps are both generated using the same structure from the IR. While the former are obtained via the inexact mass fractions through Eq. (5) by omitting the \({K}_{FP}\) term, the latter are obtained using the exact mass fractions. The simulated data on the other hand, is obtained by using the actual structure and mass fractions and is therefore used as the target to be achieved by the correction. As it can be seen, the maps from the corrected structure qualitatively show a good level similarity with the simulated data in terms of count rate, intensity and absorption features. The same does not hold true for the uncorrected data which deviates more strongly from the simulated images, especially in terms of count rates.
Figure 6a shows the sum of the count rates across all the SDDs for C, N and O, specifically for the line \({K}_{\alpha }\) and for the \(\Sigma XR{F}^{s}\), \(\Sigma XR{F}^{u}\) and \(\Sigma XR{F}^{c}\) data respectively. As it can be observed in the uncorrected maps, there is a global and substantial drop in the count rates associated with all the elements. By directly confronting the uncorrected images with the simulated ones it is evident that most of the count rates lost in the uncorrected data, predominantly come from the central part of the cells. On the other hand the corrected maps overall show count rates much closer to the simulated data. However, stronger deviation from the simulated intensities can also be observed in regions of the corrected maps that correspond to a stronger deviation of the reconstructed sample from the actual sample. Figure 6b shows the fluorescence emission matrices EM for line \({K}_{\alpha }\), and for the \(E{M}^{u}\), \(E{M}^{s}\) and \(E{M}^{c}\) images of C, N and O, respectively. Similarly to Fig. 6a, we can appreciate the stronger resemblance between the corrected and simulated data over the uncorrected and simulated data. Once again, the uncorrected images systematically show lower count rates, especially as we move from the borders to the inner parts of the cells. It is also interesting to notice that in Fig. 6a, the \({\Sigma XRF}^{s}\) map of C shows a drop in signal within the central part of the largest cell facing the other two cells, which is not observed in the homologous \(E{M}^{s}\) map.
The quantitative evaluation regarding the average least squares difference of the uncorrected and corrected maps from the simulated ones, was carried out on the \(\Sigma XRF\) maps and \(E{M}_{ij}\) matrices for line \({K}_{\alpha }\) of C, N and O and is reported in Table 1. All ttests resulted to be statistically significant to the 1sample Kolmogorov–Smirnov test and the paired sample ttest (p < 0.001). Confirming the visual inspection of Figs. 5 and 6a,b, the corrected images systematically demonstrated values close to the ground truth, both in the case of \(\Sigma XRF\) (1.36 × 10^{5} ± 1.33 × 10^{5} for C, 1.52 × 10^{5} ± 1.35 × 10^{5} for N and 3.99 × 10^{5} ± 3.24 × 10^{5} for O) and in case of \(E{M}_{ij}\) (2.27 × 10^{4} ± 1.45 × 10^{4} for C, 2.29 × 10^{4} ± 1.46 × 10^{4} for N and 5.73 × 10^{4} ± 3.65 × 10^{4} for O) images.
Lastly, the performance of the IR was investigated across different intensities for I0 (from 10^{3} to 10^{10}), demonstrating a good level of robustness, with volume percentage overlap values ranging from 76 to 82%.
Discussion
Results seem to indicate that the proposed method recovered with good fidelity, the total volume of the analyzed sample, which was attested at − 4.2% with respect to the exact sample volume (4651 μm^{3}). This figure is also in line with the pixelwise average percentage difference found between the true thickness map and the one recovered iteratively after 1000 steps from the STXM map, which was − 3.4 ± 5.3%. After recovering thickness information, the IR algorithm was able to derive a 3D sample which overlapped with the original one by 82% in terms of volume with \(I{R}_{os}=0.2\). It was also found that precision in the reconstruction may be increased by choosing higher values of this parameter. In this case for example, choosing \(I{R}_{os}=1\) yielded a modest increase of 4% in precision.
The IR was robust against the inexact mass fractions which were derived directly from the data and deviated on average from the correct ones by 53 ± 5% for C, 15 ± 6% for N and 12 ± 8% for O, respectively. This robustness can probably be attributed to the optimization cost function, which consists of an L1 norm between the count rates of the XRF experimental image versus the ones from the simulated image, for the specific pixel being reconstructed. With this type of cost function, if the mass fractions being used are not exact, we will observe in the simulated XRF maps a displacement in intensity which renders absolute quantification challenging. On the other hand, since we are fixing the thickness and thus the available sample mass, we can expect the observed intensity displacements to have a common order of magnitude throughout a given map, following a change in the set of mass fractions. This translates into generating XRF simulated maps that have different absolute count rates from the real images but have conserved intensity proportionality among pixels within each SDD. At the same time, the intensity variation which is due to the topography variation only, while maintaining a fixed thickness, operates at different orders of magnitude and can alter the aforementioned proportionality. The IR algorithm developed for this study makes use of the intensity variation observed due to the topography variation once thickness has been fixed and attempts to derive a 3D sample by recovering the intensity proportionality among pixels rather than recovering exact count rates.
It was then verified whether the 3D reconstructed sample could be used as a way to calculate a 3D correction for selfabsorption of the XRF radiation. At a first glance, the individual \({XRF}_{2D}\) images reported in Fig. 5 and the \(\Sigma XRF\) images in Fig. 6a, highlighted the strong resemblance between the corrected and simulated images. This result was confirmed by the quantitative analysis reported in Table 1, where the average least squares difference in the pixelwise count rates for \(\Sigma XR{F}^{c}\) resulted to be at most 1.36 × 10^{5} ± 1.33 × 10^{5} and 2.27 × 10^{4} ± 1.45 × 10^{4} for \(E{M}^{c}\). Furthermore, by investigating into the \(XR{F}^{s}\) of Carbon of Fig. 6a, it can be seen that the largest cell demonstrates an absorption pattern moving towards the center of the image where the three cells meet. This pattern is not observed instead in the \(E{M}^{s}\) map of C in Fig. 6b, where the spherical symmetry in the signal is well conserved. This found complementarity suggests firstly that for the energies (i.e. 277 eV for the \({K}_{\alpha }\) line of C) and spatial scales involved (i.e. μm scale for cells) the absorption artefact is present and that a quantitative correction of such effect can be feasible through the presented methodology. Overall, the quantitative analysis seems to suggest that it is possible to employ the recovered 3D sample structure to numerically correct for the selfabsorption effects.
The results obtained in the selfabsorption correction evaluation of this study are in good qualitative agreement with the findings reported in a previous study by Malucelli et al.^{19}. Namely, the recovery of the count rates in the raw XRF maps of a human cell, which are strongly asymmetric prior to the correction due to selfabsorption and are modulated according to the position of their respective detector. The selfabsorption correction proposed by Malucelli et al. integrates the absorption term formulated in the FP method over the entire sample’s thickness derived from the AFM, considering for each step of the integration, a single path defined by a single exit angle, traveled equally by all particles. On the other hand, the presented method exploits RayTracing in an attempt to accurately quantify all the paths traveled by the particles in each different voxel source. In this way, if gaps or valleys are present between the source voxel and the detector, they are fully taken into account and do not contribute to the attenuation of the XRF radiation. In other words, we argue that a true absorption correction must be carried out at a 3D level as is suggested by Eq. (4).
In order to verify the robustness of the IR algorithm on datasets coming from different radiation sources, including ones at lower energies than synchrotrons, a series of reconstructions were carried out on the same simulated sample for a range of I0 values (between 10^{3} and 10^{10} photons). It was found that the IR works well also at lower I0 intensities (76% volume overlap with I0 = 10^{3}). Furthermore, it was evaluated how varying the oversampling parameter IR_{OS} and the permutations threshold δ would affect the reconstruction time of an upscaled version of the simulated sample. This representation is exactly 2.5 times the size of the original sample and is contained in a cubic grid of 100 × 100 × 100 μm^{3}. It was found that when fixing δ and using a value of 0.2 for the IR_{OS,} instead of 1.0, always yielded a 3D sample within 6% difference and up to a factor of 5 in speed gain. At the same time, varying the δ when fixing IR_{OS,} could yield a maximum gain factor of 3. By varying these two parameters together, we could find a combination (IR_{OS} = 0.2 and δ = 10^{4}) that yielded a 3D sample of similar precision (85% volume overlap with simulated sample) in just above 10 min.
The presented work also offers the basis for a 3D XRF simulation framework which can be used to simulate the experimental outcome of synchrotron XRF experiments with virtually any acquisition geometry. The same framework could also be used as the basis for developing a system capable of fitting different sets of mass fractions over the STXM and XRF data provided for the IR. In this manner it would be possible in principle, after having retrieved a 3D structure through the IR, to find an optimal set of mass fractions for the fixed thickness chosen. Such a fitting system has not yet been developed and goes beyond the initial aims of this study which involve recovering a 3D sample structure and showing that 3D selfabsorption correction of XRF maps can in principle be carried out through this structure. Future developments should therefore focus on the application and evaluation of the proposed framework with actual XRF datasets for which the average density is known and STXM data is available. At present, we are currently testing the IR algorithm on different types of samples that could recently be acquired and that will be the object of future works.
Conclusion
In conclusion, through the presented IR algorithm based on raytracing and the use of multidetector systems, we aim to provide a novel methodology to retrieve a 3D representation of the sample with resolved topographical landscape, from XRF data. Furthermore, we hope to have shown that starting from this sample representation it is also possible to open the way for a quantitative correction of the selfabsorption artifact at the 3D level.
Data availability
The data that support the findings of this study are available from the corresponding author upon reasonable request.
Code availability
We have provided a demo web application of the IR algorithm, where users can select from three simulated XRF samples and experiment with the reconstruction parameters. The web application, together with usage instructions and anonymous login, can be found at: https://github.com/ElettraSciComp/xrfstir.
References
Rivers, M. L., Sutton, S. R. & Jones, K. W. Xray microscopy III. Springer Ser. Opt. Sci. 67, 212–216 (1992).
Powers, J. et al. Xray fluorescence imaging analysis of inscription provenance. J. Archaeol. Sci. 36, 343–350. https://doi.org/10.1016/j.jas.2008.09.030 (2009).
Mantler, M. & Schreiner, M. Xray fluorescence spectrometry in art and archaeology. XRay Spectrom. 29, 3–17. https://doi.org/10.1002/(SICI)10974539(200001/02)29:1%3C3::AIDXRS398%3E3.0.CO;2O (2000).
Gianoncelli, A., Castaing, J., Bouquillon, A., Polvorinos, A. & Walter, P. Quantitative elemental analysis of Della Robbia glazes with a portable XRF spectrometer and its comparison to PIXE methods. XRay Spectrom. 35, 365–369. https://doi.org/10.1002/xrs.920 (2006).
Lintern, M., Anand, R., Ryan, C. & Peterson, D. Natural gold particles in Eucalyptus leaves and their relevance to exploration for buried gold deposits. Nat. Commun. 4, 2614. https://doi.org/10.1038/ncomms3614 (2013).
Limburg, K., Huang, R. & Bilderback, D. Fish otolith trace element maps: New approaches with synchrotron microbeam Xray fluorescence. XRay Spectrom. 36, 336–342. https://doi.org/10.1002/xrs.980 (2007).
Kaulich, B. et al. Lowenergy Xray fluorescence microscopy opening new opportunities for biorelated research. J. R. Soc. Interface 6, S641–S647. https://doi.org/10.1098/rsif.2009.0157.focus (2009).
Kopittk, P. M. et al. Synchrotronbased Xray fluorescence microscopy as a technique for imaging of elements in plants. Plant Physiol. 178, 507–523. https://doi.org/10.1104/pp.18.00759 (2018).
Kaulich, B., Thibault, P., Gianoncelli, A. & Kiskinova, M. Transmission and emission xray microscopy: Operation modes, contrast mechanisms and applications. J. Phys. Condens. Matter Inst. Phys. J. 23, 083002. https://doi.org/10.1088/09538984/23/8/083002 (2011).
Bonizzoni, L., Maloni, A. & Milazzo, M. Evaluation of effects of irregular shape on quantitative XRF analysis of metal objects. XRay Spectrom. 35, 390–399. https://doi.org/10.1002/xrs.926 (2006).
Billè, F., Kourousias, G., Luchinat, E., Kiskinova, M. & Gianoncelli, A. Xray fluorescence microscopy artefacts in elemental maps of topologically complex samples: Analytical observations, simulation and a map correction method. Spectrochim. Acta B 122, 23–30. https://doi.org/10.1016/j.sab.2016.05.012 (2016).
Geil, E. C. & Thorne, R. E. Correcting for surface topography in Xray fluorescence imaging. J. Synchrotron Radiat. 21, 1358–1363. https://doi.org/10.1107/S160057751401875X (2014).
Smilgies, D.M., Powers, J. A., Bilderback, D. H. & Thorne, R. E. Dualdetector Xray fluorescence imaging of ancient artifacts with surface relief. J. Synchrotron Radiat. 19, 547–550. https://doi.org/10.1107/S0909049512021164 (2012).
Scot, V., Fermandez, J. E., Vincze, L. & Janssens, K. 3D extension of the Monte Carlo code MCSHAPE for photonmatter interactions in heterogeneous media. Nucl. Instrum. Methods Phys. Res. B 263, 204–208. https://doi.org/10.1016/j.nimb.2007.04.205 (2007).
Hansson, M. & Isaksson, M. A Monte Carlo (MC) based individual calibration method for in vivo Xray fluorescence analysis (XRF). Phys. Med. Biol. 52, 2009–2019. https://doi.org/10.1088/00319155/52/7/015 (2007).
Trojek, T., Cechak, T. & Musilek, L. Monte Carlo simulations of disturbing effects in quantitative insitu Xray fluorescence analysis and microanalysis. Nucl. Instrum. Methods Phys. Res. A 619, 266–269. https://doi.org/10.1016/j.nima.2009.11.079 (2010).
Trojek, T. Reduction of surface effects and relief reconstruction in Xray fluorescence microanalysis of metallic objects. J. Anal. At. Spectrom. 26, 1253–1257. https://doi.org/10.1039/C0JA00187B (2011).
Trojek, T. Reconstruction of the relief of an investigated object with scanning Xray fluorescence microanalysis and Monte Carlo simulations of surface effects. Appl. Radiat. Isotopes 70, 1206–1209. https://doi.org/10.1016/j.apradiso.2011.11.012 (2012).
Malucelli, E. et al. Quantitative chemical imaging of the intracellular spatial distribution of fundamental elements and light metals in single cells. Anal. Chem. 86, 5108–5115. https://doi.org/10.1021/ac5008909 (2014).
Ge, M. et al. Threedimensional imaging of grain boundaries via quantitative fluorescence Xray tomography analysis. Commun. Mater. 3, 37. https://doi.org/10.1038/s4324602200259x (2022).
Di, Z. W. et al. Joint reconstruction of Xray fluorescence and transmission tomography. Opt. Express 25, 13107–13124. https://doi.org/10.1364/OE.25.013107 (2017).
Malucelli, E. et al. Xray fluorescence microscopy of light elements in cells: Selfabsorption correction by integration of compositional and morphological measurements. J. Phys. Conf. Ser. 463, 012022. https://doi.org/10.1088/17426596/463/1/012022 (2013).
Gianoncelli, A., Kourousias, G., Merolle, L., Altissimo, M. & Bianco, A. Current status of the TwinMic beamline at Elettra: A soft Xray transmission and emission microscopy station. J. Synchrotron Radiat. 23, 1526–1537. https://doi.org/10.1107/S1600577516014405 (2016).
Janssens, K. H. A., Adams, F. C. V. & Rindby, A. Microscopic Xray Fluorescence Analysis 171–190 (Wiley, 2000).
Thomsen, V. Basic fundamental parameters in Xray fluorescence. Spectroscopy 22, 46–50 (2007).
Storm, L. & Israel, H. I. Photon cross sections from 1 keV to 100 MeV for elements Z=1 to Z=100. At. Data Nucl. Data Tables 7, 565–681. https://doi.org/10.1016/S0092640X(70)800171 (1970).
Hubbell, J. H. & Seltzer, S. M. Tables of Xray mass attenuation coefficients and mass energyabsorption coefficients 1 keV to 20 MeV for elements Z = 1 to 92 and 48 additional substances of dosimetric interest. NISTIR5632. https://doi.org/10.18434/T4D01F (1995).
Icelli, O., Erzeneoglu, S. & Gurbulak, B. Mass attenuation coefficients for ntype InSe, InSe:Gd, InSe: Ho and InSe: Er single crystals. J. Quant. Spectrosc. Radiat. Transf. 90, 3–4. https://doi.org/10.1016/j.jqsrt.2004.04.012 (2005).
Mohammed, F. M., Razooqi, R. N., Majeed, M. A., Vijay, Y. K. & Surve, S. Self mass attenuation coefficients for mixture of some 3D elements Ni100x Alx and Zn100xAlx at Am241 (40mCi). Int. J. Recent Res. Rev. 3, 26–31 (2012).
Lam, S., Pitrou, A. & Seibert, S. Numba: A LLVMbased Python JIT compiler. In Proc. Second Workshop on the LLVM Compiler Infrastructure in HPC, 1–7 (ACM, 2015).
Acknowledgements
The authors gratefully acknowledge the support of Dr. Francesco Guzzi from Elettra Sincrotrone Trieste, Italy.
Author information
Authors and Affiliations
Contributions
F.B., G.K. and A.G. conceived of the original idea, were in charge of direction and planning, supervised the findings of this work and aided in the interpretation of the results. M.I. developed the algorithm, performed the computations, numerical simulations, statistical analyses, drafted the manuscript, designed the figures and aided in the interpretation of the result. A.K. supervised the findings of this work, aided in the interpretation of the results. All authors discussed the results and with their comments and feedback contributed to the final manuscript. All authors verified the numerical methods and the proposed web application of the algorithm.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Ippoliti, M., Billè, F., Karydas, A.G. et al. Reconstruction of 3D topographic landscape in soft Xray fluorescence microscopy through an inverse Xraytracing approach based on multiple detectors. Sci Rep 12, 20145 (2022). https://doi.org/10.1038/s4159802224059y
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s4159802224059y
This article is cited by

Selfabsorption correction on 2D Xray fluorescence maps
Scientific Reports (2023)
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.