Abstract
X-Ray Fluorescence (XRF) scanning is a widespread technique of high importance and impact since it provides chemical composition maps crucial for several scientific investigations. There are continuous requirements for larger, faster and highly resolved acquisitions in order to study complex structures. Among the scientific applications that benefit from it, some of them, such as wide scale brain imaging, are prohibitively difficult due to time constraints. However, typically the overall XRF imaging performance is improving through technological progress on XRF detectors and X-ray sources. This paper suggests an additional approach where XRF scanning is performed in a sparse way by skipping specific points or by varying dynamically acquisition time or other scan settings in a conditional manner. This paves the way for Compressive Sensing in XRF scans where data are acquired in a reduced manner allowing for challenging experiments, currently not feasible with the traditional scanning strategies. A series of different compressive sensing strategies for dynamic scans are presented here. A proof of principle experiment was performed at the TwinMic beamline of Elettra synchrotron. The outcome demonstrates the potential of Compressive Sensing for dynamic scans, suggesting its use in challenging scientific experiments while proposing a technical solution for beamline acquisition software.
Similar content being viewed by others
Introduction
X-ray Fluorescence (XRF) spectroscopy and imaging are well established techniques used in a wide range of scientific applications1,2,3. In the case of imaging, the XRF emission signal is acquired for each position of a scanned sample, resulting, after suitable analysis, into a set of elemental maps. This combination of elemental information with spatial distribution provides important information on the analysed areas but being based on a scanning acquisition mode implies that large maps (>1 M points) may require long acquisition times. In the soft X-ray regime also known as Low Energy XRF (LEXRF) the acquisition times are even longer due to the low fluorescence yield below 2 keV. LEXRF on the other hand is crucial for studies and applications that probe light elements, such as C, N, O, Na, Mg, Al, Si and P, important in biological systems, and transition metals (Mn, Fe, Ni, Co, Cu and Zn). Such applications are often biomedical and pose challenges when it comes to imaging large area samples like brain tissues4,5,6,7 or monitoring fast dynamic phenomena like electrochemical processes8,9. Improvements in LEXRF detectors and soft X-ray sources together with advanced instrumentation (i.e. better vacuum conditions, larger detection solid angle, and better motor stages) pave the way for such large scans that may enable new science. Still, additional approaches may be needed as the aforementioned improvements may not translate directly into reduced measurement times. Table 1 shows typical acquisition times and scan range in pixels for the LEXRF system installed at the TwinMic beamline10 (case a). It also shows that by increasing the number of pixels by 100 times (from 100 × 100 to 1000 × 1000), even by reducing the acquisition time by 3 times (case b), the total duration of the scan can reach forbiddingly high numbers compared to the duration of a beamtime experiment. However if the acquisition is based on sparse and compressive sensing approaches such those this paper is proposing (case c), the total measurement can become feasible. Thus, this manuscript suggests reduced and selective ways for acquiring LEXRF maps, which can be obviously applied to any energy range. It is based on Compressive Sensing11,12 which is an emerging and very effective technique for reconstruction from a relatively small number of data samples without compromising the imaging quality; indeed in our case it allows performing scans of a dynamic nature where it is possible to skip points (sparse) and acquire with variable parameters (i.e. acquisition time). Such an approach may lead to a substantial reduction of the required time. This reduction in terms of time, combined with other technological and scientific advances, like new detectors, can produce maps of very large areas that could not be acquired with the traditional ways. This paper reports the results of the suggested method applied in a series of LEXRF acquisitions at the TwinMic synchrotron spectromicroscopy beamline10 of Elettra Sincrotrone Trieste (Trieste, Italy). A flexible and modular beamline control system was used13 in order to perform Compressive Sensing scans while post-processing software has been developed for the reconstruction of the sparse maps into traditional ones that can be processed with standard analysis software. The used detector system is based on a 8 SDD setup14,15 with a novel multi-channel analyser16 (DANTE digital pulse processor, XGLab Bruker).
Results and Discussion
Sparse scans and masking
Typical scanning assumes the acquisition of XRF spectra at positions belonging to a regular cartesian grid. This simplifies various processes but most notably allows for the rectangular representation of the data in the form of images or volumes. The first type of reduced acquisition we implemented is Sparse scanning coupled with masking. It consists of two steps: i) manually selecting certain features of the sample that need to be scanned (Masking) at a certain spatial resolution and ii) acquiring data at sample stage steps larger than the focal spot size of the X-ray beam in the remaining masked areas (Sparse scanning) while at high resolution in the regions of interest. It should be noted that the density of the Sparse scan can also be variable. The workflow of the proposed method is shown in detail in Figure S1 in Supplementary Data through a suitable flowchart scheme. The selection (or masking) is performed through a simple interface (e.g. touch screen, pen stylus, smartphone) on preview data such as a faster scan or scanning transmission X-ray microscopy (STXM) map. In order to assemble the sparse and masked data so that they can be processed, fitted and visualised by software (i.e. PyMca17) in a suitable elemental map, we reconstruct it into a dense matrix by using a suitable in-painting technique18,19. It should be noted that PyMca17 allows for easy visualisation of sparse data without the need to densify the map (Mask Scatter View); still in-painting techniques may improve the visualisation at processing cost. The in-painting fills the missing values of the Sparse scan by suitable interpolation based on the neighbouring XRF data. The result is a 3-dimensional array (width, height, energy) compatible with the standard processing workflows. A visual example of the described method is presented in Fig. 1, where a standard XRF map (Fig. 1d), in this case of Silicon, acquired point by point in a regular square scan on a foraminifera shell is compared with the same scan acquired with the proposed approach (Fig. 1e), based on a mask (Fig. 1b) defined from a previously acquired absorption image (Fig. 1a), and finally reconstructed (in-painted; Fig. 1f) to resemble a full one. The mask is also extended by a set of sparse scan points (Fig. 1c), in order to sample the areas outside the regions of interest. The reported example demonstrates the advantage of the method. The less interesting areas (in this case the ultralene foil, that is the sample support, and the paraffin embedding medium) are under-sampled while the regions of interest (the shell sections) are scanned with a suitable spatial resolution, allowing to provide the same scientific information with a reduced acquisition time. For this particular system the measurements that lead to Fig. 1d required 6 hours, while the ones that produced Fig. 1f just 2 hours.
Conditional scans and multimodal acquisitions
Some XRF instruments are embedded in more complex systems, using additional detectors which allow them to operate in a multimodal way. The TwinMic beamline endstation for instance allows for the concurrent acquisition of XRF and STXM data20 (Fig. 2a). In a Conditional Scanning mode, the system decides on-the-fly whether it should acquire XRF data for a given point according to the transmission signal of that point. Note that in many setups, STXM data may be collected 2 orders of magnitude faster than XRF. Such a conditional scanning represents a case of Compressive Sensing by using a fast probing microscopy technique of less costly nature, in terms of time, to decide whether to acquire data in that specific point. The result is processed in a similar manner to the Masked scans where the missing values are interpolated in order to reconstruct a complete matrix.
Figure S1b in Supplementary Data illustrates in detail the proposed acquisition method by a suitable flowchart while Fig. 2 depict a successful example of it. Based on the simultaneous acquisition of an absorption image (2b) and on the choice of an absorption threshold, which discriminates the sample from the support and the embedding medium (2c), the XRF signal, of Silicon in this case, is acquired only on specific areas (2d), allowing to speed up the acquisition compared to the standard full area (2e). For this specific example, where a soybean root section21 was imaged, the proposed method allowed to reduce the measurement time by around 66%. In order to obtain a complete image, an in-painting reconstruction is performed a posteriori (Fig. 2f), as described in the previous section.
Dynamic XRF scanning
Traditional XRF scans generate maps that are processed as a whole. Step size, spot size, and acquisition time are common parameters across the whole map: they are usually set at the beginning of the acquisition and kept constant for the whole measurement. The proposed Dynamic XRF strategy allows for any parameter to be variable in each position of the scan. The variation (e.g. of acquisition time) at a given scan position depends on the actual XRF signal that is collected there in real-time. During the experiment this compressive sensing approach allows to decrease the acquisition time in the areas of the map which have for instance the composition of the background (i.e. ultralene or Si3N4) and increases it for better statistics for regions containing the elements of interest. The resulting map requires a normalisation of the acquisition time of each pixel prior to fitting it with the traditional software. The workflow of the proposed method is presented in detail in Figure S1c in Supplementary Data through a general description of the procedures involved. The objective is to increase the acquisition time for the scan positions where a predefined element of interest is present.
Figure 3 showcases an example of the proposed approach on a section of a soybean root specimen21 acquired with submicrometric spatial resolution. Figure 3a depicts the absorption image of the analysed area, to highlight its morphology, even though it is not used at any stage of the proposed method. The dynamic scan acquisition assumes the definition of an XRF signal threshold for a specific element. This can be retrieved by basic signal integration of more sophisticated fitting. For each position in the scanned area, a fast XRF acquisition is used to decide dynamically whether to acquire a longer XRF signal for better statistics on that position. For this specific case a ROI window was selected across Na peak in the XRF spectrum and the threshold was applied to this signal. The fast acquisition was set to 1 s while the longer one to 7 s. Where the threshold was met the acquisition was set to 7 s instead of 1 s. By doing so a set of XRF data were collected at variable exposure times (1 and 7 s) that after a suitable normalisation were reconstructed into a regular map (Fig. 3b). In order to estimate the reduction in time compared to acquiring a full 7 s/pixel map, Fig. 3c shows in black the pixels which were acquired at 1 s and in green the ones at 7 s. Considering that 32% of the areas was acquired at 7 s while the remaining one at 1 s, the dynamic scan required 43% of the total time (full XRF map at 7 s). For comparing and validating the results, full Na maps were acquired at 1 s (Fig. 3d) and 7 s (Fig. 3e). The advantage of the proposed method is evident by comparing Figs. 3b,e, where the Na signal is the same on the cell walls of the root, i.e. the regions of interest, while noisy (same as in Fig. 3d) in the remaining ones. This means that maps with similar information on Na can be obtained by saving 57% of the total time for this given sample.
The proposed Dynamic XRF strategy could also by extended by considering more than one chemical element of interest, as proposed in Fig. 4, where a simplified region scanned in 5 × 5 steps is shown in panel 1. The aim is to increase the acquisition time for the scan positions where objects characterized by predefined chemical elements are present. The grey areas represent the background substrate while the blue circle and the red rectangular region are the features of interest, with the red region being a higher priority one. This approach assumes that the regions of interest in the specimen are distinguished by at least one specific characteristic element which is not present in the background or in less interesting regions. Panel 2 depicts possible spectra of the three areas, grey, red and blue, plotted with the same colors as the corresponding areas. The element indicated with the red ROI (c) is not present in the grey and blue areas therefore it can be used as fingerprint for the red region in panel 1. This simplified example of a dynamic scan assumes that higher XRF statistics are required for the red element regions without knowing a priori their location in the scan. With this strategy the acquisition time can be increased for instance to 1.2 seconds when the red “peak” (panel 2) is present while the grey areas of the background are fast scanned at 0.2 s. Since the blue region is still an area of interest but of less importance than the red region, one can decide to increase the acquisition time for instance to 0.6 s when the red peak is absent but the blue one is present. This simple example can be easily extended to more complex methods where ratios of XRF signals are taken into account. Such strategies can be especially useful in XRF scans where there is a hypothesis for the existence of a trace element in an unknown or limited region of the sample.
Current perspective and future directions
The proposed methods [sec. 1,2,3] for Compressive Sensing in XRF scans, other than rendering new experiments feasible (large areas, faster scans, more samples), may pave the way for additional advances both scientific and technological. For instance the authors and their associated labs are outlining a pump-probe inspired experiment where the XRF acquisition is subsequent to an excitation (i.e. sample heating through radiation); since these kinds of experiments have specific timing to track transition or changes in the samples, they could really benefit from the proposed approaches. Fast XRF mapping of large sample areas at high spatial resolution could provide multi-scale insights, since it could be applied to different length-scales (from mm to nm) and promote high impact research in multiple scientific fields from material science to medicine, archaeometry and food science. Elemental maps of large areas (mm) of such samples and nanometric resolution could be acquired faster with the dynamic scanning strategies proposed in this manuscript. Moreover, the proposed methods can be applied not only singularly but also as a combination of different ones and they could benefit from Machine Learning techniques. For instance Machine Learning can be used both for in-painting methods (filling in the missing XRF points in Sparse scans) and for altering the motor steps of the scan (position jumping). Figure 5 reports an example of a successful combination of methods 1 and 2 on a cane root section. A preliminary mask was selected to cover the root section borders adopting an in-painting strategy for the remaining areas. The mask was deliberately left wider than the actual root borders to compensate for possible sample drifting during the scan. In the non-masked areas method 2 was applied in order to acquire the XRF signal only for specific absorption signals, in this case the point corresponding to the root. The deployment of method 2 in the non-masked region assured a faster and safer (free from possible sample drifting) acquisition, then deploying method 1 alone. Figure 5 depicts the overlap of STXM and LEXRF scans over an area of a 2 mm × 0.8 mm of the cane root section. The scan resolution using the techniques of this paper varied from 20 to 2 microns on the masked and the finest resolved areas, respectively. This allowed for examination of C and Mg on the border of the root by performing a scan 3 times faster than that of a traditional dense one.
Eventually the proposed techniques can be used for fly scans (the currently used DANTE electronics permits it16) and may be extended to variable velocity scans. The increase in speed could be also useful for XRF tomography experiments that tend to be very challenging and time-consuming. An extension of conditional scans and multimodal acquisitions [sec. 2] is the use of phase contrast information22,23 rather than simple STXM transmission as a decisive factor for the XRF acquisition. Finally XRF topography artifacts are a topic of research24,25,26,27 and is only natural to use the phenomenon in the context of Dynamic XRF scanning [sec. 3].
Conclusions
This paper suggests a series of methods for performing XRF scans in dynamic ways. It is a Compressive Sensing approach where the data are collected in a reduced manner and later are reconstructed to standard representations. This paves the way for larger and faster scans enabling new science. Through a series of beamtime experiments and suitable software and instrumentation modifications, the feasibility of such an approach was demonstrated. The proposed techniques are presented in three main categories; Sparse scans & Masking, Conditional scans & multimodal acquisitions, and Dynamic XRF scanning. Examples of reduced raw data and final reconstructions are shown and FAIR data and codes are set accessible to the community through a public repository [https://doi.org/10.5281/zenodo.3688316]. Finally certain future perspectives have been presented and hint on the use of Machine Learning for the decision-making and reconstruction of missing data component of the methods. The proposed techniques can be combined with other advances on instrumentation and detectors but it should be noted that they introduce an additional challenge on the post-processing reconstruction phase of the reduced data. The expected impact of this research is the use of powerful synchrotron LEXRF for the study of a high number of biological samples of large areas at very high resolutions. Naturally the potential applications can be across different fields from biology to material science in different energy ranges and potentially could include other scanning microscopy techniques (SEM, FTIR, Ptychography etc).
Materials and Methods
Experimental
The LEXRF experiments were performed at the TwinMic beamline12. The end-station was operated in Scanning Transmission Mode (STXM) where the monochromatic beam is focused on the sample plane by means of zone plate diffractive optics while the specimen is raster-scanned across the microprobe18. For the present experiments a gold 600 μm diameter zone plate with 50 nm outermost zone was used producing a microprobe with 1.6 μm or 800nm diameter size at 2 keV. The samples were raster-scanned with a step size of 20 or 2 micron.
The specimens shown in Figs. 1 and 2 are 10 micron thick sections of foraminifera shells deposited on ultralene foils. The sample depicted in Fig. 5 is a 10 micron thick cross section of a cane root deposited on a ultralene foil.
Software
In order to develop, test and deploy different scanning strategies, major changes in the existing beamline end-station control software were required. Typical software for synchrotron XRM end-stations allows only for raster rectangular acquisitions with few exceptions on Ptychography setups, but even those have predefined sets of scan positions and acquisition parameters. A novel system was developed by engineers among the authors of this paper. It permits for non-regular positions and dynamic parameters that can all be changed during the scan on per-pixel basis. This system includes an advanced workflow manager (DonkiOrchestra13) which allows for easy and flexible changes of the data acquisition process. Other institutes are using similar systems (see Bluesky [https://nsls-ii.github.io/bluesky/ accessed: 25/02/2020]) thus the implementation of the proposed techniques also in other facilities should be quite easy. The data were stored in HDF5 files of non-standard structure and were later reconstructed in traditional dense data structures that can be stored in common formats (i.e. NeXus) and processed with popular analysis software (e.g. PyMca17). Both the acquisition framework and the reconstruction software were done in Python. The experimental data and their reconstructions are available in a public repository [https://doi.org/10.5281/zenodo.3688316] respecting the FAIR principles.
References
Ortega, R., Cloetens, P., Devès, G., Carmona, A. & Bohic, S. Iron storage within dopamine neurovesicles revealed by chemical nano-imaging. PLoS ONE 2, e925 (2007).
Dick, D. A. The distribution of sodium, potassium and chloride in the nucleus and cytoplasm of Bufo bufo oocytes measured by electron microprobe analysis. J. Physiol. (Lond.) 284, 37–53 (1978).
James, S. A. et al. Quantitative comparison of preparation methodologies for X-ray fluorescence microscopy of brain tissue. Anal Bioanal Chem 401, 853–864 (2011).
Robison, G. et al. X-Ray Fluorescence Imaging: A New Tool for Studying Manganese Neurotoxicity. PLOS ONE 7, e48899 (2012).
Robert, R. et al. Scanning X-ray Fluorescence Imaging Study of Lithium Insertion into Copper Based Oxysulfides for Li-Ion Batteries. Chem. Mater. 24, 2684–2691 (2012).
Grochowski, C. et al. Analysis of Trace Elements in Human Brain: Its Aim, Methods, and Concentration Levels. Front. Chem. 7, (2019).
Popescu, B. F. G. & Nichol, H. Mapping Brain Metals to Evaluate Therapies for Neurodegenerative Disease. CNS Neuroscience & Therapeutics 17, 256–268 (2011).
Meirer, F. & Weckhuysen, B. M. Spatial and temporal exploration of heterogeneous catalysts with synchrotron radiation. Nature Reviews Materials 3, 324–340 (2018).
Bozzini, B., Kourousias, G. & Gianoncelli, A. In situ observation of dynamic electrodeposition processes by soft x-ray fluorescence microspectroscopy and keyhole coherent diffractive imaging. J. Phys. D: Appl. Phys. 50, 124001 (2017).
Gianoncelli, A., Kourousias, G., Merolle, L., Altissimo, M. & Bianco, A. Current status of the TwinMic beamline at Elettra: a soft X-ray transmission and emission microscopy station. Journal of Synchrotron Radiation 23, 1526–1537 (2016).
Orović, I., Papić, V., Ioana, C., Li, X. & Stanković, S. Compressive Sensing in Signal Processing: Algorithms and Transform Domain Formulations. Mathematical Problems in Engineering, https://www.hindawi.com/journals/mpe/2016/7616393/ https://doi.org/10.1155/2016/7616393 (2016).
Amin, M. G. & Ahmad, F. Chapter 17 - Through-the-Wall Radar Imaging: Theory and Applications. in Academic Press Library in Signal Processing (eds. Sidiropoulos, N. D., Gini, F., Chellappa, R. & Theodoridis, S.) vol. 2 857–909 (Elsevier, 2014).
Borghes, R., Billè, F., Chenda, V., Kourousias, G. & Prica, M. DonkiOrchestra: A Software Trigger-Driven Framework for Data Collection and Experiment Management Based on Zeromq Distributed Messaging. New York 5 (2019).
Gianoncelli, A., Kourousias, G., Stolfa, A. & Kaulich, B. Recent developments at the TwinMic beamline at ELETTRA: an 8 SDD detector setup for low energy X-ray Fluorescence. J. Phys.: Conf. Ser. 425, 182001 (2013).
Gianoncelli, A. et al. Simultaneous soft X-ray transmission and emission microscopy. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 608, 195–198 (2009).
Bombelli, L. et al. Towards on-the-fly X-ray fluorescence mapping in the soft X-ray regime. X-Ray Spectrometry 48, 325–329 (2019).
Sole, A., Papillon, E., Cotte, M., Walter, P. & Susini, J. A multiplatform code for the analysis of energy-dispersive X-ray fluorescence spectra. Spectrochimica Acta Part B: Atomic Spectroscopy 62, 63–68 (2007).
Richard, M. M. O. B. B., and Chang, M. Y. S. Fast digital image inpainting Proceedings of the International Conference on Visualization, Imaging and Image Processing (VIIP 2001), Marbella, Spain 106–107 (2001).
Xie, J., Xu, L. & Chen, E. Image Denoising and Inpainting with Deep Neural Networks. in Advances in Neural Information Processing Systems 25 (eds. Pereira, F., Burges, C. J. C., Bottou, L. & Weinberger, K. Q.) 341–349 (Curran Associates, Inc., 2012).
Gianoncelli, A. et al. Combining multiple imaging techniques at the TwinMic X-ray microscopy beamline. AIP Conference Proceedings 1764, 030002 (2016).
Kopittke, P. M. et al. Identification of the Primary Lesion of Toxic Aluminum in Plant Roots. Plant Physiol. 167, 1402–1411 (2015).
Gianoncelli, A., Morrison, G. R., Kaulich, B., Bacescu, D. & Kovac, J. Scanning transmission x-ray microscopy with a configurable detector. Applied Physics Letters 89, 251117 (2006).
Feser, M. et al. Integrating Silicon detector with segmentation for scanning transmission X-ray microscopy. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 565, 841–854 (2006).
Billè, F., Kourousias, G., Luchinat, E., Kiskinova, M. & Gianoncelli, A. X-ray fluorescence microscopy artefacts in elemental maps of topologically complex samples: Analytical observations, simulation and a map correction method. Spectrochimica Acta Part B: Atomic Spectroscopy 122, 23–30 (2016).
Bonizzoni, L., Maloni, A. & Milazzo, M. Evaluation of effects of irregular shape on quantitative XRF analysis of metal objects. X-Ray Spectrom. 35, 390–399 (2006).
Rindby, A., Voglis, P. & Attaelmanan, A. Analysis of inhomogeneous and irregularly shaped samples by the use of XRF micro-beam correlation analysis. X-Ray Spectrom. 25, 39–49 (1996).
Trojek, T. Reduction of surface effects and relief reconstruction in X-ray fluorescence microanalysis of metallic objects. J. Anal. At. Spectrom. 26, 1253–1257 (2011).
Acknowledgements
The authors would like to thank Maya Kiskinova from Elettra Sincrotrone Trieste (Italy) for insights on further use of the methods in pump-and-probe experiments, Alfonso Franciosi from Elettra Sincrotrone Trieste (Italy) for raising interest on large scale imaging and Francesco Guzzi from Elettra Sincrotrone Trieste and University of Trieste (Italy) for investigating Machine Learning in-painting techniques. The authors are grateful to Giovanni De Giudici and Daniela Medas from University of Cagliari (Italy) for providing the foraminifera and cane root samples, and Peter Kopittke from Queensland University for the soybean root samples. TwinMic (Elettra) 20180178 and 20190372 beamtimes are acknowledged.
Author information
Authors and Affiliations
Contributions
G.K. conceived the experiments and methods, F.B. and G.K. designed the data analysis software, R.B. developed the acquisition software, A.A. and R.A. provided the detector processing electronics, A.G. supervised the experiments and with S.S. provided support in the beamline. All authors participated in the experiments and contributed to the manuscript.
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.
Supplementary information
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 license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license 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 license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Kourousias, G., Billè, F., Borghes, R. et al. Compressive Sensing for Dynamic XRF Scanning. Sci Rep 10, 9990 (2020). https://doi.org/10.1038/s41598-020-66435-6
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-020-66435-6