|
1.INTRODUCTIONWhen a sample interacts with a coherent X-ray beam, it will cause reduction in the intensity and change in the direction of the beam. The latter effect comes from the phase shift of the X-ray wave. Using the first effect to image samples in tomography, known as X-ray absorption-contrast tomography, is a widely used technique at synchrotron facilities. However, using the second effect for imaging samples is much more challenging in the near-field region. The resulting images, i.e. phase-shift images, can be used for tomography to visualize internal features of samples having small differences in densities at high contrast quality. This is the advantage of the technique, known as X-ray phase-contrast tomography (X-PCT), over conventional X-ray tomography. To retrieve a phase-shift image, there are two basic approaches: measuring change in the direction of a beam then performing surface reconstruction; or matching a wave-propagation model to measured intensities. Well-known methods using the second approach are propagation-based methods1. These techniques, however, require highly spatial-coherent sources and narrow PSF (point-spread-function) detectors, which are important conditions for measured intensities to be close to the prediction of wave-propagation models. Many techniques use the first approach and employ specialized optical components to measure change in the direction of a beam. Readers are recommended to refer to Momose2 for more detailed information about these methods. Speckle-based techniques3-5 are the most recently added to the category. They are very simple to use in terms of set-up, data acquisition, and data processing. The idea of the techniques is to measure the shift of each speckle-image pixel, caused by a sample, by comparing the images with and without the sample. Because the speckle-pattern size is larger than the pixel-size of a detector, to resolve the shift for each pixel we use a stack of speckle-images scanned at different positions, with and without sample, and analyze the images using a small window around each pixel. The use of speckle-based technique for tomography can be depicted as shown in Fig. 1. Figure 1.Demonstration of the speckle-based phase-contrast tomography. Projections with and without sample are acquired at several diffuser positions (blue stacks). By comparing the two, positional shifts in speckle locations are quantified and converted into phase-shift through the sample. Finally, tomographic reconstruction is performed from the processed projections. ![]() There are a few approaches to acquire and process data of the speckle-based X-PCT technique, called SX-PCT for short6-8. SX-PCT has been proven to be practical and demonstrated its advantage on various types of samples by different developer groups9,10. They used their own codes, written in Malab and closed source6,9 or Python and open source11-13. These codes, however, have not been packaged to an installable software and optimized to run on GPU. To make SX-PCT accessible to generic users and practical for use; it is important that data processing methods should be implemented and packaged properly in an open-source software; which is easy-to-install, easy-to-use, well-documented, and optimized for speed. This is the key motivation of the work. There are many ways to implement the SX-PCT techniques and choices for data processing methods4-11. This work focuses on implementing methods which are practical and robust. 2.METHOD2.1Data acquisitionFor producing a random speckle-pattern, a diffuser made of a sandpaper can be used. The purpose of a diffuser is to provide a reference-image used to detect local displacements caused by a sample. It is crucial to get a high-contrast reference-image with the average feature size of a few pixels, e.g. 5-9 pixels. A reference-image with the visibility, calculated as the ratio between the standard deviation value and the mean value of pixel intensities, above 10% is good enough for use. For high-energy X-ray sources, users can stack sandpapers together or using a box of material powder to improve the contrast of a speckle-image. Other practical considerations for setting up an SP-XCT experiment are as follows:
2.2Data processing2.2.1Finding pixel shiftsThe core idea of the technique is to find the shift of each pixel of a speckle-image caused by a sample. This is done by: selecting a small window (5-11 pixels) around each pixel of the sample-stack image; sliding this window around a slightly larger window (margin ~10 pixels) taken from the reference-stack image and calculating the cost function11,15 or the correlation coefficient8,14 between two windows at each position. The resulting correlation-coefficient/cost-function map is used to locate the maximum/minimum point where sub-pixel accuracy can be achieved by using a differential approach16 or a polynomial fitting approach17. The shift of a pixel is the distance from the maximum/minimum point to the center of the map. The procedure of finding the shift of each pixel is depicted in Fig. 2. Performing 2D searching for every pixel of a 2k×2k image is computationally very expensive which is why using multicore-CPU and GPU for computing is crucially needed. An approximate approach to reduce the computational cost is to perform 1D search using middle slices in vertical and horizontal direction of image stacks, to find shifts in x and y-direction separately14. 2.2.2Surface reconstructionThe result of the previous step is separated into an x-shift image and a y-shift image, i.e. gradient images. A phase-shift image is then retrieved by applying a method of surface reconstruction, or normal integration (Fig. 3). There are many available options18 for implementing this step. However, Fourier-transform-based methods19-20 are preferred over least-squares methods due to their low computational cost which is critical for tomography. The disadvantage of these Fourier methods is that the DC-component (average value of an image) is undefined resulting in the fluctuations in background between phase-retrieved images. This effect, however, can be corrected (Fig. 4) by using the double-wedge filter as described in Ref. [21]. 2.2.3Extracting transmission and dark-field signalsAnother interesting capability of the speckle-based technique is that transmission image (absorption-contrast image) and dark-field image (small-angle scattering signal, not to be confused with dark-noise of a camera) can be extracted from data together with the phase-shift image. The advantage of extracting the transmission image using the speckle-based technique over conventional X-ray imaging is that the image is less prone to the change of intensity profile of a source as shown in Fig. 5. Figure 5.Comparison between transmission images acquired using conventional X-ray tomography (a,b) and extracted using SX-PCT (c,d). (a) Flat-field corrected projection at 0-degree. (b) Flat-field corrected projection at 180-degree showing the impact of the change of intensity profile of the source. (c) Extracted transmission-image at 0-degree. (d) Extracted transmission-image at 180-degree. ![]() As presented in section 2.2.1, the speckle-based technique can detect small-angle scattering signal which needs to be converted to dark-field image suitable for tomographic reconstruction, i.e. the relationship between dark-field projections is linear. There are several ways to convert the signal6,14,22,23. Fig. 6 shows the result of using an approach as described in Ref. [11] where the dark-field image is put side by side with the other images for visual comparison. Figure 6.All imaging signal retrieved by the speckle-based technique can be used for tomography. (a) Phase-shift image. (b) Transmission image. (c) Dark-field image. ![]() All above processing steps are repeated for every projection then the results are used for tomographic reconstruction as shown in Fig. 1. 2.3Implementation2.3.1Design principlesMethods are implemented in Python due to its rich ecosystem of libraries and supporting tools for packaging, distributing, and documenting software. To work with other methods in the pipeline of processing tomographic data, speckle-related methods are packaged as a module of the Algotom software21,24. Practical design-principles have been followed in the implementation:
Top layer methods, API (application programming interface), for the software are as follows:
2.3.2Building blocksA dedicated module in Algotom, named correlation.py, is a collection of methods as the building blocks for the top layer methods described in section 2.3.1. The first block is a method to generate correlation-coefficient map between two 2D/3D images (Fig. 2). This is the core method to find the shift between images. It works by sliding the second image over the reference image and calculating the correlation coefficient at each position. There are many formulas to calculate this coefficient. Here, we use Pearson’s coefficient as it has been proven to be one of the most reliable metrics4,6,8,9. The method includes low-level implementations for specific cases: 2D or 3D input, using CPU or GPU. The second block is a method to locate the maximum/minimum point of a correlation-coefficient/cost-function map with sub-pixel accuracy where there are two approaches selected: either a differential approach16 or a polynomial fitting approach17. At low-level are implementations to handle different cases: 1D or 2D input, using the differential method or fitting method. The above blocks are for finding the shift of each pixel using a small window around it. This operation is applied to ~ 2k × 2k pixel. In practice, input data for retrieving a phase-shift image is two stacks of images; each stack is around 20 images (20 speckle-positions); each image has a size of 2k × 2k. Total shape of the input is 2 × 20 × 2k × 2k with the size of ~300MB (16-bit image). As can be seen, many strategies can be used to parallelize workload. Here we find that processing data using chunk-by-chunk of image-rows in one go and calculating the shifts row-by-row in parallel is the most efficient way in term of memory management, performance, and code readability. As mentioned above, the next building block is a method for finding the shift of each pixel in a chunk of image-rows in parallel. The method includes low-level implementations for different cases: 1D or 2D search, 2D or 3D input, CPU or GPU computing. For GPU, to reduce the overhead of transferring data and compiling functions, the first two blocks are implemented at GPU-kernel level. The top building block is a method for processing full-size images. It includes many options for processing at the lower-level blocks. The chunk-size option enables the method to run on either small memory or large memory of RAM or GPU. The above blocks are for correlation-based methods. We also implemented another approach which is based on a cost function, known as the UMPA method11, using the similar building structure. Other top-layer methods listed in section 2.3.1 are straightforward to implement either directly or by making use of the methods in the correlation.py module. 3.RESULTS AND DISCUSSIONMethods implemented in this work are available in Algotom from version 1.1. The software can be installed using either Conda or Pip. The document page was published at https://algotom.github.io/ with example codes on how to process the SX-PCT data step-by-step. The software was used to process data collected at beamline B1626 (Fig. 1), K1127 (Fig. 2), and I1228 at Diamond Light Source where the I12-data were collected at optimum conditions to give the best quality of reconstructed images possible. Details of how data were acquired are as follows:
Figure 7.Demonstration of the impact of image alignment. (a) Small area of an image which is the result of dividing between speckle-image with sample and without sample. (b) Same as (a) but after image alignment. ![]() The following presents how the data were processed:
Figure 8.(a) Speckle-image stack. (b) Sample-image stack. (c) Phase-shift image retrieved from (a) and (b). ![]() Table 1.Comparison of computing time using different approaches.
We processed the full size of the data and reconstructed all slices using 3 approaches: the correlation-based method using 1D and 2D search, and the UMPA approach. Figs. 10 shows phase-retrieved images of each approach where they are colorized for visual comparison. As can be seen (white frame in each image) the main difference among the methods is the DC-component and the background profile. The cause is from the FFT-based surface-reconstruction method20. To justify this statement, another surface reconstruction method is used19 and the results are shown in Fig. 11. The nature of these methods is that the DC-component is undefined and they are sensitive to boundary conditions18. Figure 10.Phase-retrieved images from three approaches where the FC (Frankot-Chellappa) method20 is used for surface reconstruction. (a) 1D-search correlation-based method. (b) 2D-search correlation-based method. (c) the UMPA approach. (d) Intensity profiles of each result at locations indicated by the colour lines. ![]() Figure 11.Phase-retrieved images from three approaches where the SCS (Simchoney-Chellappa-Shao) method19 is used for surface reconstruction. (a) 1D-search correlation-based method. (b) 2D-search correlation-based method. (c) the UMPA approach. (d) Intensity profiles of each result at locations indicated by the colour lines. ![]() An interesting finding from the comparison is that the 1D-search method is less prone to large defects of the scintillator in the detecting system as can be seen in Fig. 12. Figure 12.Comparison between the 1D-search and 2D-search in the area indicated by the red circle in Fig. 11(a) and Fig. 11(b). (a) x-shift image from the 1D-search method. (b) x-shift image from the 2D-search method. (c) phase-shift image from the 1D-search method. (d) phase-shift image from the 2D-search method. ![]() Figure 13 shows reconstructed images in horizontal and vertical direction from the 3 approaches where ring artifact removal methods24,29 and the FBP reconstruction method30 were used. There are several interesting findings from the results. Firstly, the 1D-search method gives less-sharp images than other methods but with better contrast and clearer features. There is not much different between the 2D-search method and the UMPA method out of the low-pass component. However, the main advantage of the UMPA approach over the others is that three modes of image can be retrieved at the same time as shown in Fig. 14. How to determine dark-signal image is still up-to-debate for correlation-based methods. For the UMPA approach, dark-signal image is easily to obtain as a part of the model equation. Figure 14 is also a showcase for the SX-PCT technique where phase-shift images give better contrast than transmission-signal images (red arrows). The technique reveals interesting features of the sample which are mineral olivine31. Because the olivine is a crystal it can enhance dark signal as shown in Fig. 14(c,f). Making use of dark-signal images to gain deeper understanding of materials is a very promising application of the SX-PCT technique. 4.CONCLUSIONSIn summary, we have implemented speckle-based phase-retrieval methods and their supporting methods in Algotom, a tomographic open-source software in Python which is easy-to-install. The documentation has been published (https://algotom.github.io/) and the source-code is at https://github.com/algotom/algotom. The methods can run on either multicore-CPU or GPU. Data can be processed chunk-by-chunk to fit the size of RAM memory or GPU memory. Comparing different methods implemented in the software leads to several interesting findings. Firstly, the 1D-search method is practical for use, particularly for users not having access to GPU. Secondly, dark-signal image retrieved from the UMPA approach is very promising for real applications. Lastly, the low-pass component of phase-shift image is varied depending on a surface-reconstruction method used. This will hamper the post-analysis of reconstructed images. A better approach for surface reconstruction is still desirable. ACKNOWLEDGMENTSThis work was carried out with the support of the Diamond Light Source. Data were collected using beamtime: NT27987, “Development of data processing pipeline for X-ray speckle-based phase contrast tomography”; EE20763, “Fast 3D multimodal imaging combining the speckle scanning technique with helical sample movement”; CM31131-1, “DIAD Commissioning Directory 2022”; and NT27144-1, “Super precision at-wavelength metrology and advancing X-ray imaging using speckle-based technique”. This research used resources of the National Synchrotron Light Source II, a U.S. Department of Energy (DOE) Office of Science User Facility, operated for the DOE Office of Science by Brookhaven National Laboratory under Contract No. DE-SC0012704. The authors would like to thank Beverley Coldwell and Matt Pankhurst for providing the basaltic rock. REFERENCESSnigirev, A., Snigireva, I., Kohn, V., Kuznetsov, S., and Schelokov, I.,
“On the possibilities of x‐ray phase contrast microimaging by coherent high‐energy synchrotron radiation,”
Review of scientific instruments, 66
(12), 5486
–5492
(1995). https://doi.org/10.1063/1.1146073 Google Scholar
Momose, A.,
“Recent advances in X-ray phase imaging,”
Japanese journal of applied physics, 44
(9R), 6355
(2005). https://doi.org/10.1143/JJAP.44.6355 Google Scholar
Cerbino, R., Peverini, L., Potenza, M. A. C., Robert, A., Bösecke, P., and Giglio, M.,
“X-ray-scattering information obtained from near-field speckle,”
Nature Physics, 4
(3), 238
–243
(2008). https://doi.org/10.1038/nphys837 Google Scholar
Berujon, S., Wang, H., and Sawhney, K.,
“X-ray multimodal imaging using a random-phase object,”
Physical Review A, 86
(6), 063813
(2012). https://doi.org/10.1103/PhysRevA.86.063813 Google Scholar
Morgan, K. S., Paganin, D. M., and Siu, K. K.,
“X-ray phase imaging with a paper analyzer,”
Applied Physics Letters, 100
(12), 124102
(2012). https://doi.org/10.1063/1.3694918 Google Scholar
Wang, H., Berujon, S., Herzen, J., Atwood, R., Laundy, D., Hipp, A., and Sawhney, K.,
“X-ray phase contrast tomography by tracking near field speckle,”
Scientific reports, 5
(1), 1
–6
(2015). Google Scholar
Zanette, I., Zdora, M. C., Zhou, T., Burvall, A., Larsson, D. H., Thibault, P., Hertz H. M., and Pfeiffer, F.,
“X-ray microtomography using correlation of near-field speckles for material characterization,”
in Proceedings of the National Academy of Sciences,
12569
–12573
(2015). Google Scholar
Berujon, S., and Ziegler, E.,
“X-ray multimodal tomography using speckle-vector tracking,”
Physical Review Applied, 5
(4), 044014
(2016). https://doi.org/10.1103/PhysRevApplied.5.044014 Google Scholar
Wang, H., Atwood, R.C., Pankhurst, M.J., Kashyap, Y., Cai, B., Zhou, T., Lee, P.D., Drakopoulos, M. and Sawhney, K.,
“High-energy, high-resolution, fly-scan X-ray phase tomography,”
Scientific Reports, 9
(1), 1
–11
(2019). Google Scholar
Zdora, M.C., Thibault, P., Kuo, W., Fernandez, V., Deyhle, H., Vila-Comamala, J., Olbinado, M.P., Rack, A., Lackie, P.M., Katsamenis, O.L. and Lawson, M.J.,
“X-ray phase tomography with near-field speckles for three-dimensional virtual histology,”
Optica, 7
(9), 1221
–1227
(2020). https://doi.org/10.1364/OPTICA.399421 Google Scholar
Zdora, M.C., Thibault, P., Zhou, T., Koch, F.J., Romell, J., Sala, S., Last, A., Rau, C. and Zanette, I.,
“X-ray phase-contrast imaging and metrology through unified modulated pattern analysis,”
Physical review letters, 118
(20), 203903
(2017). https://doi.org/10.1103/PhysRevLett.118.203903 Google Scholar
Thibault, P.,
(2017) https://github.com/pierrethibault/UMPA Google Scholar
Wang, H. and Sawhney, K.,
“Hard X-ray omnidirectional differential phase and dark-field imaging,”
in Proceedings of the National Academy of Sciences,
e2022319118
(2021). Google Scholar
Zanette, I., Zhou, T., Burvall, A., Lundström, U., Larsson, D.H., Zdora, M., Thibault, P., Pfeiffer, F. and Hertz, H.M.,
“Speckle-based x-ray phase-contrast and dark-field imaging with a laboratory source,”
Physical review letters, 112
(25), 253903
(2014). https://doi.org/10.1103/PhysRevLett.112.253903 Google Scholar
Fisher G. H., and Welsch B. T.,
“FLCT: A Fast, Efficient Method for Performing Local Correlation Tracking,”
(2007). https://doi.org/10.48550/arXiv.0712.4289 Google Scholar
Bing, P., Hui-Min, X., Bo-Qin, X. and Fu-Long, D.,
“Performance of sub-pixel registration algorithms in digital image correlation,”
Measurement Science and Technology, 17
(6), 1615
(2006). https://doi.org/10.1088/0957-0233/17/6/045 Google Scholar
Quéau, Y., Durou, J.D. and Aujol, J.F.,
“Normal integration: a survey,”
Journal of Mathematical Imaging and Vision, 60
(4), 576
–593
(2018). https://doi.org/10.1007/s10851-017-0773-x Google Scholar
Simchony, T., Chellappa, R. and Shao, M.,
“Direct analytical methods for solving Poisson equations in computer vision problems,”
IEEE transactions on pattern analysis and machine intelligence, 12
(5), 435
–446
(1990). https://doi.org/10.1109/34.55103 Google Scholar
Frankot, R.T. and Chellappa, R.,
“A method for enforcing integrability in shape from shading algorithms,”
IEEE Transactions on pattern analysis and machine intelligence, 10
(4), 439
–451
(1988). https://doi.org/10.1109/34.3909 Google Scholar
Vo, N.T., Atwood, R.C., Drakopoulos, M. and Connolley, T.,
“Data processing methods and data acquisition for samples larger than the field of view in parallel-beam tomography,”
Optics Express, 29
(12), 17849
–17874
(2021). https://doi.org/10.1364/OE.418448 Google Scholar
Zdora, M.C.,
“State of the art of X-ray speckle-based phase-contrast and dark-field imaging,”
Journal of Imaging, 460
(5),
(2018). https://doi.org/10.3390/jimaging4050060 Google Scholar
Wang, H., Kashyap, Y. and Sawhney, K.,
“Quantitative X-ray dark-field and phase tomography using single directional speckle scanning technique,”
Applied Physics Letters, 108
(12), 124102
(2016). https://doi.org/10.1063/1.4944462 Google Scholar
Vo N. T.,
“Data processing algorithms for tomography,”
(2021) https://github.com/algotom/algotom Google Scholar
Pearson K.,
“Contributions to the mathematical theory of evolution. III. Regression, heredity, and panmixia,”
Philos. Trans. R. Soc. Lond. Ser. A, 187 253
–318 Google Scholar
Sawhney, K.J.S., Dolbnya, I.P., Tiwari, M.K., Alianelli, L., Scott, S.M., Preece, G.M., Pedersen, U.K. and Walton, R.D.,
“A test beamline on diamond light source,”
in AIP conference proceedings,
387
–390
(2010). Google Scholar
Reinhard, C., Drakopoulos, M., Ahmed, S.I., Deyhle, H., James, A., Charlesworth, C.M., Burt, M., Sutter, J., Alexander, S., Garland, P. and Yates, T.,
“Beamline K11 DIAD: A new instrument for dual imaging and diffraction at Diamond Light Source,”
Journal of Synchrotron Radiation, 28
(6),
(2021). https://doi.org/10.1107/S1600577521009875 Google Scholar
Drakopoulos, M., Connolley, T., Reinhard, C., Atwood, R., Magdysyuk, O., Vo, N., Hart, M., Connor, L., Humphreys, B., Howell, G. and Davies, S.,
“I12: the joint engineering, environment and processing (JEEP) beamline at diamond light source,”
Journal of synchrotron radiation, 22
(3), 828
–838
(2015). https://doi.org/10.1107/S1600577515003513 Google Scholar
Vo, N.T., Atwood, R.C. and Drakopoulos, M.,
“Superior techniques for eliminating ring artifacts in X-ray micro-tomography,”
Optics express, 26
(22), 28396
–28412
(2018). https://doi.org/10.1364/OE.26.028396 Google Scholar
Ramachandran, G.N. and Lakshminarayanan, A.V.,
“Three-dimensional reconstruction from radiographs and electron micrographs: application of convolutions instead of Fourier transforms,”
in Proceedings of the National Academy of Sciences,
2236
–2240
(1971). Google Scholar
Pankhurst, M.J., Vo, N.T., Butcher, A.R., Long, H., Wang, H., Nonni, S., Harvey, J., Guđfinnsson, G., Fowler, R., Atwood, R. and Walshaw, R.,
“Quantitative measurement of olivine composition in three dimensions using helical-scan X-ray micro-tomography,”
American Mineralogist: Journal of Earth and Planetary Materials, 103
(11), 1800
–1811
(2018). https://doi.org/10.2138/am-2018-6419 Google Scholar
|