# Multi-Modal X-ray Imaging and Analysis for Characterization of Urinary Stones
## 2 Materials and Methods
### X-ray Speckle-Based Imaging (SBI)  
A typical experimental configuration of speckle-based imaging is depicted in Figure 1. The system is basically similar to a conventional X-ray radiography and tomography, except for a random-pattern diffuser which is placed upstream or downstream of the sample. The diffuser modulates the partially coherent X-ray wave front by creating random speckles  
Figure 1: Depiction of the experimental setup for the X-ray speckle tracking imaging.  
on the detector. The speckle pattern can be used as a wave marker to detect any phase shifts and scattering from the sample by displacing the speckles, compared with a reference image without the sample. The system can operate with only two projections, a sample and a reference; such a sustem is then called X-ray speckle tracking (XST). However, one can scan the diffuser along one or two orthogonal directions to increase the spatial resolution when unraveling the speckle modulation [39].  
Radiography images were acquired from three stone samples in an XST-SBI setup. The system was implemented with a Hamamatsu L10801 X-ray tube operated at 80-100 kVp and 1.5-2 mAs with 10 average frames. The source was placed 100 cm from a digital flat-panel detector, consisting of a 700 \(\upmu\)m-thick CsI-scintillator layer. The detector elements were arranged in 1496 \(\times\) 1880 pixels with 127 \(\upmu\)m width. A sandpaper sheet with an average grit size of 18 \(\upmu\)m was used as the diffuser. Two images were acquired from each sample, one with the diffuser and the sample and one without the sample. The images were analyzed in MATLAB to retrieve the multimodal signals. For the phase-contrast images, an implicit speckle tracking method was employed to extract the average refraction angles along two orthogonal directions [40]:  
\[\alpha_{x(y)}=\frac{1}{k}\frac{\partial}{\partial x(y)}\Bigg{[}\frac{1}{\mu} log_{e}F^{-1}\Bigg{(}LFF\Bigg{(}\frac{F[1-I(x,y)/I_{0}(x,y)]}{1+\tau\tau D\lambda(u_{x} ^{2}+u_{y}^{2})}\Bigg{)}\Bigg{]} \tag{1}\]  
where \(\gamma\) is \(\frac{\delta}{\beta}\), for which \(\delta\) and \(\beta\) are the real and imaginary parts of the complex refractive index of X-rays at the mean X-ray energy. In addition, \(\mu\) is the linear attenuation coefficient, D is the propagation distance, \(\lambda\) is the X-ray wavelength, and \((u_{x},u_{y})\) are the spatial frequency components in the Fourier space, corresponding to \((x,y)\) in the image space. \(F\) and \(F^{-1}\) are the Fourier and the inverse Fourier transform, respectively. \(LFF\) is an optional low-frequency filter applied in the Fourier space to eliminate the effect of low-frequency random noise introduced when retrieving the phase. The pure attenuation image (T) is obtained by:  
\[T(x_{i},y_{j})=\frac{\overline{I}(x^{\prime},y^{\prime})}{\overline{I_{0}}(x, y)} \tag{2}\]  
where \(\overline{I_{0}}(x,y)\) describes the mean reference signal value in a 15 \(\times\) 15 sliding analysis window with a central pixel at \((x_{i},y_{j})\). As such, the modulated \(\overline{I}(x^{\prime},y^{\prime})\) is the mean intensity value centered at \((x_{i},y_{j})\). The dark-field (D) image implies the diffusion of partially coherent X-rays inside the sample, calculated as:  
\[D(x_{i},y_{j})=\frac{1}{T(x_{i},y_{j})}\frac{\sigma}{\sigma_{0}} \tag{3}\]  
where \(\sigma_{0}\) and \(\sigma\) are the standard deviations of the reference and the sample images in the subset window, respectively.