State of the Art of X-ray Speckle-Based Phase-Contrast and Dark-Field Imaging

In the past few years, X-ray phase-contrast and dark-field imaging have evolved to be invaluable tools for non-destructive sample visualisation, delivering information inaccessible by conventional absorption imaging. X-ray phase-sensing techniques are furthermore increasingly used for at-wavelength metrology and optics characterisation. One of the latest additions to the group of differential phase-contrast methods is the X-ray speckle-based technique. It has drawn significant attention due to its simple and flexible experimental arrangement, cost-effectiveness and multimodal character, amongst others. Since its first demonstration at highly brilliant synchrotron sources, the method has seen rapid development, including the translation to polychromatic laboratory sources and extension to higher-energy X-rays. Recently, different advanced acquisition schemes have been proposed to tackle some of the main limitations of previous implementations. Current applications of the speckle-based method range from optics characterisation and wavefront measurement to biomedical imaging and materials science. This review provides an overview of the state of the art of the X-ray speckle-based technique. Its basic principles and different experimental implementations as well as the the latest advances and applications are illustrated. In the end, an outlook for anticipated future developments of this promising technique is given.


Introduction
The first large-scale applications of X-ray imaging can be found in the medical field soon after the discovery of X-rays by Röntgen [1,2].Radiography [3-6] and a few decades later computed tomography (CT) [7][8][9] quickly became routine methods in clinics.
In the mid-20th century, the discovery of X-ray synchrotron radiation and the later construction of dedicated synchrotron radiation facilities [10,11] allowed access to X-rays much more powerful than produced by conventional tube sources.The increasing availability of synchrotrons and in particular the development of high-brilliance third-generation synchrotron sources [12] at the end of the 20th century significantly pushed the advances in X-ray science.Soon, imaging with unprecedented resolution and image quality was achieved.
The main advantage of phase-contrast imaging in the hard X-ray regime over conventional absorption imaging is the significantly higher sensitivity to small density differences [15].Samples with a low atomic number generally show only little contrast in X-ray attenuation images, while the induced X-ray phase shift can be several orders of magnitude higher, leading to greatly improved signal contrast.However, the practical implementation of X-ray phase-contrast imaging is not straightforward.X-ray detectors can only measure the intensity and not the phase of the X-ray wavefront, so ways had to be found to translate the phase shift into detectable intensity differences.In the past decades, a number of X-ray phase-sensitive imaging methods have been developed [17], starting from the first demonstration by Bonse and Hart using a crystal interferometer [14,41] and followed by analyser-based (diffraction-enhanced) [42][43][44][45][46] and propagation-based (in-line) phase-contrast imaging [47][48][49][50][51][52], as well as Talbot(-Lau) grating interferometry [53][54][55][56][57] and the edge-illumination and coded-aperture approaches [58][59][60][61][62].A detailed description of all of these methods would go beyond the scope of this article, but the interested reader is referred to the cited literature.
Since it was first proposed a few years ago, X-ray speckle-based phase-contrast and dark-field imaging has drawn significant attention due to its simple, robust and flexible experimental arrangement, cost-effectiveness and relatively low spatial and temporal coherence requirements.These properties also led to the swift translation of the technique to polychromatic laboratory sources [85][86][87] and its extension from two-dimensional (2D) projection imaging to three-dimensional (3D) tomography implementation [88,89].Furthermore, it has been shown that, in addition to its great potential for phase-contrast and dark-field imaging for the investigation and visualisation of specimens, X-ray near-field speckle can be employed in the field of metrology for highly precise and accurate X-ray optics characterisation, beam phase sensing and beam coherence measurements [65,[90][91][92][93].
Despite being a relatively recent approach, the rapid development and increasing interest in the X-ray near-field speckle method promise a widespread implementation and expanding range of applications in the near future.
This review provides an overview of the principles and state of the art of the X-ray speckle-based imaging and metrology technique.Starting from the basic concept of X-ray near-field speckle, the different experimental implementations with their advantages, limitations and challenges are discussed, followed by a more detailed description of the proposed dark-field reconstruction approaches.Subsequently, further progress such as the translation to laboratories and the extension to tomographic imaging is illustrated.In the end, recent applications of the technique are shown, and a summary and outlook for anticipated future developments are given.

X-ray Speckle as a Wavefront Marker
A speckle pattern is created when (partially) coherent light impinges on an object consisting of randomly distributed scatterers.The phenomenon of speckle has been explored extensively for laser light [94,95].Laser speckle is on the one hand often an undesired effect, e.g., for laser-based displays [96][97][98] and in coherent optical imaging [99,100].On the other hand, it has found many applications such as speckle imaging in astronomy [101][102][103], electronic speckle pattern interferometry for stress, strain and vibration measurements of rough surfaces [104][105][106][107][108] and dynamic speckle for the investigation of biological processes [109][110][111][112][113][114].Even the use of laser speckle for eye testing has been demonstrated [115].
The phenomenon of speckle exists in the far-as well as the near-field regime.However, it is important to note that the properties of these two types of speckle patterns are fundamentally different.While far-field speckles are linked to the illuminating beam, its dimensions and wavelength, it has been shown that in the near field the properties of the speckles are closely related to the scattering features themselves, and the speckle size is independent of the propagation distance and the energy of the beam [116][117][118][119][120][121][122].
Just ten years ago, it was demonstrated that the concept of near-field speckle can be directly transferred from the optical to the X-ray regime, and the same criteria and properties apply [123].
Here, it should be noted that the first applications of X-ray near-field speckle were reported already a few years earlier, although not explicitly classifying the observed effects as near-field speckle.In [124,125], the authors report on speckle produced by lung tissue when imaging small animals using the propagation-based phase-contrast technique.They show that the arising speckle can enhance the visible appearance of the lungs in the acquired images, and they explain the occurrence of the speckle by multiple refraction of the X-ray beam in the alveoli of the lung and subsequent free-space propagation.In [126], Kim et al. demonstrate the characterisation of blood flow by means of cross-correlation of X-ray near-field speckle created by scattering off the blood cells.
For X-rays, the near-field regime is much more accessible than for visible light due to their short wavelength.Therefore, it is easily possible to record X-ray near-field speckle created by shining an X-ray beam on small randomly scattering structures.Thanks to the special properties of near-field speckle, the speckle size can be controlled by the size of the scattering particles, and distortions of the speckle pattern upon propagation are only determined by the shape of the wavefront [123].The above properties make X-ray near-field speckle suitable for use as a wavefront marker for sensing the beam phase.This was soon realised, and the first demonstrations of X-ray speckle-based imaging followed [63,64].
The principle of X-ray speckle imaging is simple: an object in the X-ray beam will lead to a distortion of the X-ray wavefront, which can be observed as a modulation of the speckle pattern.The object can be a sample to investigate, but also optical elements in the experimental setup resulting in desired or undesired changes to the beam.By tracking the modulations of the speckle pattern, the differential phase shift of the X-ray wavefront can be obtained, which allows one to determine the refractive properties of the object.Additionally, the transmission and small-angle scattering information of the specimen can be retrieved.Typically, commercially distributed sandpaper, consisting of small silicon carbide grains, or biological filter membranes with µm-sized pores are used as so-called diffusers to produce a speckle pattern.They are available in different grain sizes [127] and with different pore sizes, respectively, which allows controlling the speckle size and visibility [128].Other materials containing small scattering features such as finely ground sand, glass or similar and even simple cardboard could also be used as diffusers.
The speckle size is an important property of the speckle pattern that has an influence on the quality of the reconstructed multimodal images acquired with the speckle-based technique.As the speckles have an irregular, random shape and a distribution of sizes, only an average speckle size can be estimated.This is done for example by determining the spatial frequency at the maximum of the power spectrum [86,87,123,129] or from a 2D auto-correlation of the speckle pattern [88,128,[130][131][132][133][134].Generally, well-defined, small speckles that can be resolved easily and cover a few pixels in the detector plane are desired.The speckle size sets a limit for the achievable spatial resolution for the single-shot speckle-tracking reconstruction approach (see Section 3.1), whereas it is not as crucial for implementations based on diffuser stepping (see Sections 3.2 and 3.3).
Another important characteristic of the speckle pattern is the speckle visibility or contrast, which is of significant importance for the reconstruction result.A high visibility of the speckle pattern is beneficial for a successful operation of the reconstruction algorithm.The speckle contrast v is commonly defined in one of the following ways: where σ I and Ī are the standard deviation and the mean intensity value, respectively, of the speckle pattern in a small region of interest (typically around 150 × 150 pixels), as, e.g., used in [87,88,133,135,136], or: where I max and I min are the maximum and minimum intensity values of the speckle pattern in a region of interest, as, e.g., used in [85,137,138], or as, e.g., used in [86,135].
It should be noted that the above ways to quantify the visibility of the pattern will give different values and should not be directly compared to each other.Generally Equations ( 2) and (3) will result in a higher v.This is due to the fact that in these definitions, which use the maximum and minimum intensity values, extreme outliers strongly influence and artificially increase the measured visibility.Furthermore, the impact of outliers makes the quantification of visibility using Equations ( 2) and (3) somewhat unstable as the measured visibility values will change for different realisations of the speckle map from the same setup and even for different regions of a single speckle image.Equation (1) on the other hand will give a more reliable and stable result as outliers have less effect on the visibility calculation.

Differential Phase, Transmission and Dark-Field Signals
As mentioned above, near-field speckle can be used to obtain information about the phase shift of X-rays in an object.In addition to the phase-contrast signal, the method also allows the reconstruction of the sample's X-ray transmission and small-angle scattering properties, which can carry valuable complementary information.The principles of image formation for the different signals are outlined in this section.
To keep the explanations and formulas simple for the sake of clarity, in the following we only consider a parallel beam as it is given at synchrotron X-ray sources to a good approximation.However, the concepts discussed here can easily be applied to diverging sources, as mostly encountered in the laboratory [85,87] or for microscopy applications with a magnifying geometry implemented, e.g., with a Fresnel zone plate [139].The concepts and reconstruction approaches presented here still hold in these cases, but one needs to take into account the magnification of the speckle pattern and sample.A magnifying geometry allows one to significantly increase the spatial resolution by decreasing the effective pixel size in the sample plane, while maintaining a high angular sensitivity that can be influenced by the distances between the (secondary) source, sample and diffuser.
The basic setup for a speckle imaging experiment is shown in Figure 1a.An X-ray beam impinges on a diffuser, e.g., a piece of sandpaper, producing a random speckle pattern, the reference interference pattern, in the detector plane.When a sample is inserted into the beam, the speckle pattern is modulated by the presence of the sample, and this sample interference pattern is recorded by the detector.The modulation appears in three ways as illustrated in Figure 1b: The speckles are displaced in the horizontal x and vertical y directions by a vector u = (u x , u y ) due to refraction in the specimen; the mean intensity changes due to absorption; and the visibility of the pattern, i.e., the amplitude after taking into account the absorption, is reduced due to small-angle scattering from unresolved features.From these effects, the refraction angle α = (α x , α y ), which is related to the differential phase shift, the transmission T (or absorption A = 1 − T) and the dark-field signal D, respectively, can be retrieved in a quantitative manner.The reconstruction is performed in real space and pixel-by-pixel using different analysis methods, depending on the experimental implementation; see Section 3. The displacement of the speckle pattern when a phase-shifting sample is inserted into the beam is visualised in Figure 2 for a phantom sample consisting of a silicon sphere on a wooden toothpick.When looking at a region of interest in the top part of the sphere, it can be observed that the speckles are shifted by several pixels, as can be seen from comparing Figure 2b,c, while outside the sphere no displacement is detected.It should be noted that the order of the diffuser and the sample is not crucial for a setup with a parallel beam in combination with the commonly employed experimental implementations used for imaging applications, which are based on comparing reference and sample interference images.However, for the case of diverging beams, the magnification of speckle and sample should be carefully considered.Furthermore, for acquisition schemes that operate without the use of a reference speckle pattern, as often used, e.g., for the characterisation of X-ray mirrors (see Section 7.1), the two configurations give different information (see Section 3.2.3).
The reconstructed transmission signal is obtained from the ratio of the measured local intensities in the sample and reference interference patterns and is similar to the image that would have been obtained without any optical elements and just the sample in the beam.It shows the absorption of the X-rays in the sample, but typically also contains contributions from edge enhancement effects that arise upon propagation in the near-field regime.In this sense, it is not a pure transmission or absorption signal.However, the expression "transmission signal" is still used throughout this article as it is the term commonly found for this contrast modality in the literature on X-ray speckle-based imaging.
The dark-field is given as the local ratio of sample and reference visibilities, i.e., it measures the local reduction in amplitude of the speckle pattern after correcting for the transmission.The dark-field signal can be obtained with different analysis approaches, as discussed in Section 4.
The phase information about the sample is delivered as the differential phase signal, measuring the first derivative of the phase shift induced by the specimen.The direct output from the reconstruction is the displacement u of the speckle pattern, which can be converted into the refraction angle α of the X-rays.With the speckle method, the displacement can be measured in the horizontal and vertical directions separately from a single dataset, and the refraction angle α = (α x , α y ) is obtained.The refraction angle is directly related to the differential phase shift (∂Φ/∂x, ∂Φ/∂y): where λ is the X-ray wavelength.The information from the differential phase signals in the two orthogonal directions can then be combined via phase integration to obtain the phase shift Φ of the wavefront.This can be done with various methods, e.g., Fourier-based approaches [64,[139][140][141], two-dimensional numerical integration using least-squares minimisation [91,142] or matrix inversion [135].

Practical Experimental Considerations
For a practical implementation of the speckle-based technique, there are a few main points to consider.They can be found throughout this article, but are summarised in this section.
The method relies on the use of the near-field speckle pattern as a wavefront marker.For this purpose, speckles should be fully resolved with the detector system to achieve a well-defined speckle pattern of good contrast, yet not too large, in particular for the single-shot implementation of speckle imaging (see Section 3.1), as discussed in Section 2.1.Hence, one should aim for a speckle size in the range of a few times the effective pixel size.As mentioned in Section 2.1, a high speckle visibility improves the quality of the reconstructed images.
The size and visibility of the speckles can be controlled by the type of diffuser used to create the interference pattern.As discussed above, in the near field the speckle dimensions are directly related to the size of the scattering features.Commonly used diffuser materials are commercial abrasive paper and biological filter membranes.The size of the silicon carbide grains of the sandpaper or the membrane pores can be chosen depending on the desired speckle size.Generally, any object containing small scattering particles can be used, and the exploration of further suitable diffuser materials is anticipated.
Regarding the X-ray source, the requirements imposed by the speckle-based technique are moderate.As demonstrated in Section 5, X-ray speckle-based imaging can be performed at polychromatic laboratory sources [85], and the demands on the temporal coherence are low [64,133].For the creation of speckle, which is based on interference effects, a certain degree of spatial coherence of the X-ray source is required, and the coherence length of the X-ray beam at the diffuser should be larger than the size of the scatterers for an optimum speckle pattern.Reduced spatial coherence leads to a blurring of the interference pattern, which will deteriorate the reconstructed images.It has been demonstrated that microfocus laboratory sources provide sufficient spatial coherence for successful implementation of X-ray speckle-based imaging [85].Alternatively, it has been proposed to use a random pattern created by absorption rather than interference effects to track the beam wavefront under conditions of low spatial coherence [89,136]; see Section 5.
Another point to consider are setup instabilities during image acquisition.Instabilities in the diffuser or beam position, caused, e.g., by mechanical or thermal instabilities of the diffuser mounting or of optical elements in the beam, lead to a displacement of the speckle pattern in the detector plane.This displacement can be corrected for if the sample is smaller than the field of view by realigning the sample and reference images to the same positions.For the speckle-scanning methods (see Section 3.2), this can give rise to artefacts due to the change in effective step size.
Speckle-based phase-contrast imaging is quite robust against intensity fluctuations of the X-ray beam.As long as the speckle visibility is sufficient, intensity changes between reference and sample scans do not have an impact on the measured refraction signal.They can be observed in the transmission and dark-field images, but corrections can also be performed.

Related Techniques
The principle of observing the modulations of an X-ray reference pattern to get information about an object is not new, and other established X-ray imaging methods rely on the same phenomenon.For example, X-ray grating interferometry uses a 1D [53][54][55] or 2D [143,144] phase grating to produce a periodic reference interference pattern in the detector plane.Typically, the fine pattern cannot be resolved directly, and a second so-called analyser grating, placed in front of the detector, is used in combination with a phase-stepping or moiré fringe acquisition approach to translate the pattern into measurable intensity variations in the detector pixels.It has been shown that X-ray grating interferometry in a phase-stepping implementation can in fact be described as a special case of the speckle scanning mode in Section 3.2 [65].A direct experimental comparison of speckle-based imaging and grating interferometry can be found in [145].The use of a 1D [146] or 2D [147] transmission grid pattern for the analysis of the sample-induced changes to the reference pattern instead of a phase grating has also been reported for single-shot imaging with the spatial-harmonic technique.The reconstruction processes of the described grating-based methods all exploit the periodic nature of the interference pattern and are based on Fourier transformation.
An alternative reconstruction approach is the analysis by cross-correlation in real space.This was demonstrated with a 1D periodic phase grating [148], a 2D attenuation grid [149] and a 2D phase grid [150].In contrast to the above mentioned grid method by Wen et al. [147], this approach enables quantitative single-shot imaging of objects with features similar or smaller than the grid pitch as well as objects larger than the field of view.Furthermore, in principle, a periodic structure is not necessary for this approach, and the grid pattern can be replaced by a random interference pattern.In this sense, the single-grid method can be seen as a precursor to X-ray single-shot speckle tracking, discussed in Section 3.1, which uses the same analysis concept.
Compared to the approaches using gratings and grids, speckle-based imaging does not suffer from phase-wrapping effects that can occur for periodic reference patterns.However, artefacts can still arise at the edges of the sample or sample features due to the strong distortions of the speckle pattern in this region, particularly caused by the mixing of the speckle pattern and edge enhancement fringes.This can be reduced by a shorter propagation distance, which, however, also affects the sensitivity of the measurement; see Section 3.4.Furthermore, methods have been investigated to mitigate these artefacts, e.g., by considering the effect of the second derivative of the wavefront [91] or attempting to eliminate the edge effect from the image before reconstruction [151].
As with the single-grid real-space method, large samples with periodic structures of any pitch can be imaged with the speckle-based technique using an easily implemented experimental setup that does not require precise alignment as would be necessary for the two gratings in X-ray grating interferometry.Moreover, the setup for speckle imaging is flexible and the propagation distance can be chosen in the near field without any restrictions that are imposed by the fractional Talbot distances [152] for grating-based imaging with a phase grating.
Furthermore, the use of commercially available sandpaper is very cost-effective and enables accessing the refraction information in the horizontal as well as the vertical directions without the need for elaborate fabrication of 2D structures with small, high-precision period.
It should be noted that one needs to be careful for samples that produce speckle themselves at a similar size to the speckle of the reference pattern.This can lead to artefacts in the reconstruction as the algorithm might not be able to distinguish between the reference interference pattern and the "sample speckle".The size of the reference speckle should be carefully chosen in these cases.
From a resources point of view, the reconstruction in real space is more computationally expensive than Fourier-based algorithms.Fast processing can, however, be achieved by GPU-based computation.
For many applications, the advantages of the speckle-based technique outweigh its challenges.In particular, some of the limitations of both speckle-and grating-based imaging can be overcome simultaneously by our recently proposed advanced operational approach, which can be applied to both random and periodic reference patterns [134]; see Section 3.3.2.

Experimental Implementations
The principle of contrast generation in X-ray speckle-based imaging was outlined in Section 2.2.Several operational modes have been developed to quantify the modulations of the interference pattern.The most suitable mode for a certain application depends on the desired speed of data acquisition, spatial resolution and signal sensitivity.

Single-Shot X-ray Speckle-Tracking Mode (XST)
The first implementations of X-ray speckle-based imaging were demonstrated in single-shot mode, so-called X-ray speckle-tracking (XST), which only requires one reference image with the diffuser, but without the sample in the beam and one sample image with both the diffuser and the sample in the beam [63,64].As mentioned in the previous section, this approach can be seen as a generalisation of single-shot 2D grid-based methods [149,150] to a random interference pattern.
A schematic of the setup for this approach is shown in Figure 3a.One single sample image is acquired, as illustrated in Figure 3b, and one reference image without the sample; see Figure 3c.As explained in Section 2.2, the X-ray absorption, refraction and small-angle scattering properties of the specimen lead to local changes of the mean intensity, position and visibility of the speckle pattern.Examples of subsets around a pixel of interest in the sample and reference image, respectively, can be seen in Figure 3d,e.The speckle pattern is shifted in Figure 3d compared to the reference in Figure 3e, and the intensity is reduced due to the presence of the sample.In the XST implementation, the local displacement of the pattern is analysed using a windowed zero-normalised cross-correlation [153] in real space [63][64][65].This means that the refraction signal in each pixel of the image is reconstructed by selecting an analysis window around this pixel, as shown in Figure 3d,e, and performing a normalised cross-correlation between the reference and the corresponding sample window.
The cross-correlation coefficient γ between reference and sample windows is given by [63]: Here, I 0 (x i , y j ) describes the value in a pixel of the subset of the reference speckle pattern centred at (x 0 , y 0 ) and I(x i , y j ) the value in a corresponding subset of the sample speckle pattern centred at (x 0 , y 0 ).The sums run over all pixels in the analysis window of size 2M + 1. Ī and Ī0 are the mean values and ∆I and ∆I 0 the standard deviations of the sample and reference patterns in the window.If only a rigid translation of the subset is considered, we can write x i = x i + u x and y i = y i + u y , and the location of the cross-correlation peak γ max corresponds to the local displacement (u x , u y ) of the speckle pattern in the two orthogonal directions.This can then be converted to a refraction angle signal (α x , α y ) by geometrical considerations (in small-angle approximation): where p eff is the effective pixel size in the detector plane and d the propagation distance (The propagation distance d corresponds to the sample-detector distance for the configuration in Figure 3a where the diffuser is placed upstream of the sample, but to the diffuser-detector distance if the diffuser is placed downstream of the sample.).The analysis window slides across the whole image, and refraction, transmission and dark-field signals are obtained locally for each pixel.
The transmission signal can be calculated from the ratio of the mean intensities in the sample and reference windows: The dark-field image is typically retrieved as the ratio of the sample and reference visibilities, which can be quantified for each pixel as the ratio of the standard deviation divided by the mean intensity in the respective sample and reference analysis windows [65]: It has also been proposed that alternatively the reduction of the cross-correlation peak value can be taken as a measure for the dark-field signal [89]; see Section 4.
A different approach for the image reconstruction of XST data was introduced a bit later [85].The idea is based on a physical model of the speckle interference pattern in the detector plane that takes into account the modulations of the pattern by the presence of the sample.For a certain pixel (x, y), the sample interference pattern I can be described in terms of the reference interference pattern I 0 , but modulated in intensity, amplitude and position by the properties of the sample: Here, Ī0 is the mean intensity of the reference pattern and T(x, y) the local transmission through the sample reducing the intensity of the speckle pattern.The amplitude I 0 (x + u x , y + u y ) − Ī0 of the reference pattern is reduced by the factor D(x, y) corresponding to the local dark-field signal.The refraction in the sample is taken into account by the quantities u x , u y , describing the displacement of the interference pattern in the horizontal and vertical directions, respectively.For image reconstruction, a windowed least-squares minimisation between the model in Equation ( 9) and the measured sample speckle pattern is performed.The minimisation procedure is conducted pixel-by-pixel using the sum over the pixels in an analysis window w around the pixel of interest (x 0 , y 0 ): Minimisation of the function L delivers the multimodal image signals u x , u y , T and D. From the speckle displacement (u x , u y ), the refraction angle (α x , α y ) can be obtained via Equation (6).
The extent of the analysis window w should be larger than the average speckle size to achieve a good reconstruction result.Different window types can be used from a simple square window with equal weighting for all pixels to Hamming or Tukey (tapered cosine) windows that give less weight to pixels at the edges.The latter can often lead to improved results with reduced artefacts.
Commonly, in the XST analysis approach, as outlined above, only a rigid translation of the speckle pattern is considered, and higher-order modulations of the sample subset compared to the reference subset are neglected.However, it has been shown that considering the distortions of the analysis subset can improve the robustness and accuracy of the reconstruction algorithm and furthermore delivers additional information, e.g., on the local curvature of the X-ray wavefront [91].The coefficients of the higher-order distortions can be obtained from a minimisation approach after determining the rigid translation of the subset.Consideration of higher-order subset distortions can be beneficial, e.g., for analysing focussing samples such as X-ray refractive lenses.The information from higher-order distortions could in this case help to reduce artefacts arising from the demagnification of the reference pattern in the lens.
The main advantage of the XST implementation is the fast image acquisition, which makes it suitable for dynamic imaging and in-vivo studies.It was demonstrated that a successful reconstruction can be achieved from a single image with sub-µs exposure time at a synchrotron source [128].Furthermore, XST does not require any special equipment, such as high-accuracy, high-precision scanning stages that are needed for the speckle-scanning method discussed in the next section.As it is essential that the position of the diffuser is identical for the reference and the sample scan, some stability of the setup is required.However, a slight displacement of the speckle pattern caused by drift or movement of the diffuser or beam instabilities can be corrected for by realigning the reference and sample images in the empty space background, e.g., via cross-correlation, as discussed in Section 2.3.
The main drawback of the single-shot approach is the limited spatial resolution that is given by twice the full width at half maximum (FWHM) of the size of the analysis window, which needs to be larger than the speckle size.The ultimate limit for the resolution of this operational mode is the speckle size.

X-ray Speckle-Scanning Modes (XSS)
For applications where high resolution is more important than image acquisition speed, the speckle-scanning (XSS) mode, also called speckle-stepping mode, is more suitable.It was proposed shortly after the single-shot approach and can be considered as a generalised version of X-ray grating interferometry in phase-stepping mode [65].However, the analysis of speckle scanning data is performed in real space, as opposed to the Fourier analysis for X-ray grating interferometry.The speckle-scanning mode has been demonstrated in two experimental ways [138]: 2D and 1D scanning, which are described in the following.

2D Scanning (2D XSS)
The first speckle-stepping implementation was reported for scanning of the diffuser in both the horizontal and the vertical direction in small equidistant steps [65], as illustrated in Figure 4a.This way, a signal is recorded at each diffuser position, with and without the sample in the beam; see Figure 4b,c.
A sample and a reference 2D array, which contain the intensities at each diffuser step with and without the sample in the beam, respectively, are obtained for each pixel in the detector plane.Examples of these arrays for one pixel are shown in Figure 4d,e.The reconstruction can then be performed pixel-wise and effectively in the sample plane (The reconstruction is effectively performed in the sample plane if the sample is placed downstream of the diffuser, but in the diffuser plane if the sample is placed upstream of the diffuser.)by zero-normalised cross-correlation (see Equation ( 5)) of these sample and reference arrays.The retrieval of the three complementary image signals-transmission, refraction and dark field-is conducted analogous to the single-shot case, but with the analysis arrays built from the signals at different diffuser positions rather than different pixels of an analysis window.The displacement (u x , u y ) of the speckle pattern between reference and sample arrays is now given in units of diffuser steps and can be converted to a refraction angle signal in the horizontal and vertical direction separately: where s is the diffuser step size (To be precise: s is the diffuser step size in the sample plane in the case that the sample is placed downstream of the diffuser, but the step size in the diffuser plane in the case that the sample is placed upstream of the diffuser.)and d the propagation distance.The sensitivity of the refraction angle measurement critically depends on the diffuser step size (see Section 3.4), and typically small steps in the range of the pixel size or smaller are chosen.For step sizes much smaller than the effective pixel size, it is important to ensure that the intensity variation between subsequent steps is sufficient.For a certain experimental arrangement, this sets the limit of the achievable angular sensitivity.Typically, the diffuser is scanned on a grid of several tens of steps across in each direction, adding up to a total number of hundreds of frames for the reconstruction of one image, which makes this approach unsuitable for fast imaging applications.Furthermore, due to the small regular step sizes, XSS requires delicate and costly high-accuracy, high-precision scanning stages, which should be aligned carefully with the beam direction to ensure equal step sizes in both directions.
Compared to the XST approach, XSS is significantly more sensitive to instabilities of the setup.The technique requires the speckle pattern to be shifted by a known constant step.Deviations from the desired position of the speckle pattern, caused by instabilities of the beam or setup (see Section 2.3), cannot be corrected for as this would alter the effective step size.
In contrast to the XST approach, however, where several pixels in an analysis window contribute to the signal reconstruction of one pixel, the stepping mode allows a real pixel-wise analysis.This enables a much higher resolution down to the pixel size, which is the main advantage of the XSS technique.In practice, the point-spread function of the detector and other factors might deteriorate the resolution.

1D Scanning (1D XSS)
To reduce the number of acquired images, it was proposed that two orthogonal 1D scans could be used instead of a full 2D grid scan in cases of small speckle displacement, i.e., for short propagation distances or moderately phase-shifting samples [65].
This was simplified further by taking only one single 1D scan to obtain the 2D refraction information [87].In this mode, here called 1D XSS, the diffuser is stepped only in one direction-horizontally or vertically-in equidistant steps that are much smaller than the average speckle size and in the order of the pixel size.This is done with and without the sample in the beam; see Figure 5b,c for scanning in the horizontal direction.To be able to track the 2D speckles, a few nearby pixels are selected in the orthogonal direction that is not scanned.For each pixel to be reconstructed, one gets a signal at each diffuser step and takes a 1D window of a few pixels in the other direction, giving a 2D array per pixel.A cross-correlation is now performed between the sample and the reference arrays constructed this way.An example of the signal for one pixel is shown with and without the sample in Figure 5d,e, respectively.Typically several tens of steps are taken in one direction, and only a few pixels are selected in the orthogonal direction.Effectively, the 1D XSS approach can be considered a hybrid between the 2D XSS and the XST cases.The reconstruction of the transmission and dark-field signals is performed the same way as in the 2D XSS and XST implementations by looking at the local changes in mean intensity and visibility within the analysis arrays for each pixel.The location of the cross-correlation peak gives the displacement (u x , u y ) of the speckle pattern in the two directions.However, the two axes of the analysis array are not the same, and the displacement is given in units of diffuser steps in the scanning direction and in units of effective pixel size in the orthogonal direction.For horizontal scanning, the conversion from the measured displacement to refraction angle signal is hence given by: where d is the propagation distance, s the diffuser step size and p eff the effective pixel size.The 1D XSS approach allows a significantly faster image acquisition than 2D XSS.However, still several tens of frames have to be acquired for a successful image reconstruction.For most experimental realisations of 1D XSS found in the literature, a set of 60 diffuser steps was used, and a minimum of 40 steps has been reported [87,136].The more steps are taken, the smaller the required number of pixels in the other direction and vice versa.This makes the approach more flexible than 2D XSS, while allowing a better spatial resolution than XST.On the other hand, the spatial resolution is reduced compared to 2D XSS as several surrounding pixels contribute to the reconstruction of the signal in one pixel.Furthermore, the sensitivity of the reconstructed images is not the same in the two orthogonal directions [138].The sensitivity is generally reduced along the non-scanned direction as it is dependent on the effective pixel size, but on the step size for the scanning direction.1D XSS could be used effectively in cases with a preferred direction of interest, for which the signals of the sample in the other direction are not crucial.The additional refraction information in the orthogonal direction can still be used to improve and reduce artefacts in the integrated phase signal.

Scanning with Self-Correlation Analysis
For imaging purposes, 2D XSS or 1D XSS is typically performed in differential mode relying on the acquisition of reference and sample scans, as explained in the previous sections.However, for metrology applications (see Section 7.1), in particular for the characterisation of strongly focussing optics, often another mode is used, which is sometimes called self-correlation mode [93].In this implementation, the local curvature, i.e., the second derivative, of the wavefront is measured as opposed to the first derivative obtained from the commonly employed differential mode [65].
For the self-correlation mode, image acquisition is performed by scanning the diffuser following the same schemes as for the common XSS methods, but no reference images are taken.The correlation procedure is then applied to the signals recorded in two nearby pixels during the same image acquisition.The two pixels that are separated in the detector plane by a pixels in the x-direction and b pixels in the y-direction (i.e., by the absolute distances ap eff and bp eff , respectively) will see the same signal, but at different times depending on the diffuser step size s.Cross-correlation between the signals in the two pixels gives the delay (χ x , χ y ) = (u x s, u y s) for the observation of the same signal in the pixels, where (u x , u y ) is the position of the maximum of the correlation coefficient.
From geometrical considerations, one can approximate the local radius R of the wavefront in the xand y-directions as follows [65]: Here, d is the propagation distance and p eff the effective pixel size.For small angles, the local radius R of the wavefront W is directly related to its local curvature or second derivative, which is in turn proportional to the second derivative of the beam phase Φ: where λ is the wavelength.The self-correlation analysis approach can deliver two different kinds of information, depending on the location of the diffuser: It gives the wavefront distortions induced by the object under study, if the diffuser is mounted upstream of the sample, or the wavefront distortions caused by all optics and components in the beam upstream, if the diffuser is mounted downstream of the sample.
The self-correlation analysis is often used for metrology applications, in particular for the characterisation of X-ray mirrors; see Section 7.1.Self-correlation analysis of 1D scanning data can be applied to obtain the 1D slope of mirrors, and in this case, not the signal delay between two different single pixels, but between two rows (The signal delay between two rows is analysed if the diffuser is scanned vertically.For the case of scanning the diffuser horizontally, the signal delay between two columns is determined.) of the detector image is considered.A 2D array is built for each row by stacking the signals in the row at each diffuser position.The correlation procedure is applied to the arrays of two neighbouring rows delivering the delay signal that can then be converted to the local wavefront curvature [90].The retrieval of the 2D wavefront curvature can be achieved by scanning the diffuser in two separate orthogonal 1D scans along the vertical and the horizontal directions.Furthermore, it has been shown that the 2D information on the wavefront curvature can also be accessed from only a single 1D scan by looking at the signal delay in two neighbouring pixels along the scanning direction and at the same time noting the displacement of the speckle pattern in the direction that is not scanned [154,155].One should be aware that for this approach, the displacement of the speckles along the non-scanned axis needs to be small, and the sensitivity in this direction is typically lower than in the scanning direction, similar to the conventional 1D XSS mode.The technique can be useful to reduce artefacts in the reconstructed 2D slope profile of a mirror arising when only the 1D speckle displacement is considered.

2D Scanning with Sparse Sampling
The 1D XSS approach requires significantly less diffuser steps than 2D XSS, which, however, comes at the cost of a reduced sensitivity in the direction orthogonal to the scanning axis.Moreover, still several dozens of diffuser positions are needed for a successful reconstruction.Recently, a stepping scheme has been proposed that uses the concept of 2D XSS, but with a sparse sampling for the sample scan [156].The acquisition of the reference patterns without the specimen in the beam is performed with a 2D raster scan of the diffuser as for classic 2D XSS, while sample images are taken only at every n-th point of the diffuser scanning grid of the reference scan.The missing sample images are then obtained via interpolation.It was demonstrated that a coarse scanning grid of only 5 × 5 steps for the sample acquisition and subsequent interpolation to 25 × 25 step arrays is sufficient to obtain images of good quality comparable to the full 2D XSS data.This significantly reduces the scan time and dose to the sample.However, a four-fold reduction of the sensitivity has been reported for the 5 × 5-step sparse scanning scheme compared to a conventional 25 × 25-step 2D XSS scan [156].

Analysis of the Scattering Distribution
A conceptually different approach for retrieving the information about the sample from 2D diffuser scanning data is the recovery of the ultrasmall-angle scattering distribution of the sample [157].This was inspired by an analogue reconstruction process introduced for 1D and 2D grating interferometry [158,159].In general, the sample interference pattern can be expressed as the convolution of the reference signal without the sample in the beam and the optical transfer function of the specimen, equivalent to the sample scattering distribution.The reconstruction approach relies on recovering the optical transfer function using iterative methods like the Richardson-Lucy deconvolution [160,161].The moments of the scattering distribution carry different information about the sample [158,159].The zeroth moment is equivalent to the transmission through the specimen, while the first order moments can be interpreted as the differential phase signals in the two directions.The second moments give directional information about the small-angle scattering strength, equivalent to the common dark-field signal.The third and fourth moments quantify the skewness and kurtosis of the distribution, respectively.
Although this approach gives a large number of contrast channels, some of which are not accessible with the other reconstruction methods, and has been shown to have improved angular sensitivity [158,159], the cumbersome and computationally expensive reconstruction procedure has so far impeded its wider implementation for speckle-based imaging.

Acquisition with Random Diffuser Positions
As discussed in the previous sections, there are some crucial limitations of the classic implementations of speckle-based imaging in the single-shot XST and XSS modes.While the XST approach is quite limited in spatial resolution, the XSS modes require a large number of acquired frames.The 1D XSS scheme results in different sensitivities for the horizontal and vertical directions and a reduced resolution.Recently, efforts have been made to develop experimental implementations that provide a trade-off between the advantages and drawbacks of the two classic modes XST and XSS.
Three approaches for this purpose have been proposed, namely the speckle-vector tracking technique (XSVT) [157], the mixed XSVT approaches [135,156] and the unified modulated pattern analysis (UMPA) [134].They all rely on taking sample and reference scans at several different diffuser positions, as shown in Figure 6a.In contrast to the XSS mode, in the case of the advanced methods, the diffuser positions can be randomly chosen, and step sizes should be significantly larger than the speckle size.This allows the use of less accurate, less costly stepping stages.They, however, still need to be precise and repeatable to ensure that sample and reference images are taken at the same diffuser positions.The number of required steps is much lower than for the XSS case, allowing shorter scan times.For the UMPA and XST-XSVT approaches, a small subset window is chosen around the pixel under consideration in each of the (f) sample and (g) reference images at the different diffuser positions, allowing one to reduce the number of steps and improving the reconstruction result.For the XSS-XSVT reconstruction, a (h) sample vector is built as for the XSVT case, while for (i) the reference vector, the diffuser is scanned in small equidistant steps around each of the initial diffuser positions.

X-ray Speckle-Vector Tracking (XSVT) and Mixed XSVT Approaches
The XSVT method considers the signal in each pixel to be a vector made up from the measured intensities at all N diffuser positions.A sample vector i r = (i r,1 , . . ., i r,N ) (see Figure 6d) and a reference vector o r = (o r,1 , . . ., o r,N ) (see Figure 6e) can be created for each pixel r = (x, y).For the reconstruction of the multimodal images, a zero-normalised cross-correlation is performed between the reference and sample speckle vectors [157]: where h is a small displacement and īr and ōr+h are the mean values of the sample and reference vectors, respectively, for the pixel r.The position of the correlation peak u = arg max h γ(i r , o r+h ) gives the displacement u = (u x , u y ) of the speckle pattern due to refraction in the sample, which can then be converted into a refraction angle signal using Equation ( 6).Here, arg max stands for "arguments of the maxima" and arg max h γ(i r , o r+h ) corresponds to the displacement h for which γ(i r , o r+h ) reaches its maximum value.The transmission signal of a pixel can be obtained from the ratio of the mean intensities of the sample and reference speckle vectors.The dark-field signal is retrieved from the ratio of the standard deviations of the sample and reference speckle vectors normalised by the transmission.
To allow reducing the number of diffuser steps further and to make the method more flexible, a mixed XST-XSVT approach was proposed [135].The principle of image reconstruction based on the correlation of speckle vectors is the same.However, for each of the acquired images, at the same time, a small analysis window is chosen around the pixel under consideration (similar to XST), as illustrated in Figure 6f,g.The information from the surrounding pixels in the analysis window at the different diffuser positions contributes to the speckle vector of each pixel and is included in the correlation analysis to obtain the image signals.This is done analogous to Equation ( 15), but the sum now runs not only over all diffuser positions, but also over all pixels in the window.
Recently, also a mixed XSS-XSVT approach has been proposed [156].The acquisition of the sample interference patterns follows the normal XSVT scheme, and sample images are taken at several random diffuser positions building up a sample vector for each pixel to be reconstructed; see Figure 6h.For the reference images, the diffuser is additionally scanned in small regular steps around each of the diffuser positions of the sample scan.The recorded signals for all of the positions can be arranged in a reference vector for each pixel; see Figure 6i.The reconstruction of the multimodal images is performed by the correlation of sample and reference vectors.The displacement of the speckles is obtained from the location of the cross-correlation peak, and the refraction angle can be calculated via Equation (11).

Unified Modulated Pattern Analysis (UMPA)
The same acquisition scheme as for the combined XST-XSVT approach is used for the recently proposed UMPA method.Images at a few different random diffuser positions are recorded, and a small analysis window around the pixel of interest is applied, as shown in Figure 6f,g.However, UMPA proposes a different concept for data analysis that is based on a least-squares minimisation between a model and the measurement of the sample interference pattern summed over all diffuser positions [134].This model was first proposed for the XST mode [85]; see Equation (9).For the UMPA approach, the model in Equation ( 9) holds for each interference pattern at diffuser position n.In the least-squares minimisation process (see Equation ( 10)) of the function L, the sum now runs not only over all pixels in the analysis window, but also over all diffuser positions n: Here, w(x i , y j ) is the window function, which has typically a much smaller extent than for the XST case; I n (x i , y j ) and I 0n (x i , y j ) are the intensities in pixel (x i , y j ) at step n of the diffuser with and without sample, respectively; and Ī0 the mean intensity of the reference pattern over all diffuser positions.The local speckle displacement (u x , u y ), transmission T and dark-field signal D are obtained directly from the reconstruction, and the refraction angle can be calculated from the displacement using Equation (6).
For both the XST-XSVT and the UMPA approaches, the use of an analysis window around the pixel to be reconstructed allows one to significantly reduce the number of acquired frames by adding information from the surrounding pixels.The size of the analysis window is typically only a few pixels across, resulting in a moderate reduction in spatial resolution.However, the choice of the number of steps and window size are always coupled.The exact parameter combinations depend on the focus of the specific experiment, in particular on the desired spatial resolution and refraction signal sensitivity.Larger window sizes generally allow the use of fewer diffuser steps, but lead to a reduced spatial resolution, while a larger number of diffuser positions enables high-resolution imaging with a small analysis window at the cost of long acquisition times and a high dose to the sample.Therefore, these approaches can be seen as a trade-off between the XST and XSS modes, and they allow flexible tuning of the reconstruction result.This will aid the straightforward implementation of speckle-based techniques for a wider range of applications with different requirements on scan times, spatial resolution and signal sensitivity, also at laboratory sources.
Furthermore, it has been demonstrated that UMPA can be successfully applied not only to random speckle patterns, but also periodic reference patterns such as the Talbot self-image created by a beam-splitter phase grating [134].This will facilitate the implementation of flexible and tunable phase-contrast and dark-field imaging at most existing X-ray phase-contrast imaging setups without the need for significant modifications.

Angular Sensitivity and Spatial Resolution
The two main criteria for assessing the quality of the reconstructed phase-contrast images are the spatial resolution and the angular sensitivity.
The spatial resolution strongly depends on the experimental implementation and processing method.For XST (Section 3.1), it is determined by the size of the subset window chosen in the reconstruction process and is ultimately limited by the speckle size.For 2D XSS (Section 3.2.1), it can go down to the effective detector pixel size as a pixel-wise reconstruction is performed.In practice, the point-spread function of the detector and other factors might deteriorate the resolution.For 1D XSS (Section 3.2.2), the spatial resolution is reduced as a few pixels taken along the axis orthogonal to the scanning direction contribute to the signal formation.For the sparse sampling variation of 2D XSS, a pixel resolution could in principle be realised, but due to the interpolation step used for the sample image, it might be lower.The XSVT as well as the mixed XSS-XSVT approaches (Section 3.3.1)can also achieve a resolution down to the pixel size.On the other hand, the mixed XST-XSVT (Section 3.3.1)and UMPA (Section 3.3.2) approaches show a lower spatial resolution that is determined by the extent of the subset window taken around the pixel of interest.Typically, the window sizes are much smaller than for XST, and hence a higher resolution can be achieved with UMPA and XST-XSVT.The resolution limit can be quantified as twice the FWHM of the window extent [134].
The second property commonly used to evaluate the quality of the reconstructed phase-contrast images is the angular sensitivity, which is a measure of the smallest refraction angle or differential phase shift that can be measured with a certain setup and acquisition scheme.The sensitivity is typically quantified as the standard deviation of the reconstructed refraction angle signal in a small region of interest in the air background without sample.As for the spatial resolution, it also strongly depends on the processing scheme.In general, it is inversely proportional to the propagation distance and dependent on the accuracy of the reconstruction algorithm and the photon noise, amongst other factors.A detailed study on the noise, directly related to the angular sensitivity, in the differential phase signals for XST measurements based on simulations and experimental validation can be found in [162].For the XST, XSVT, mixed XST-XSVT and UMPA methods that perform the reconstruction in the detector plane, the angular sensitivity is furthermore directly proportional to the effective pixel size p eff .For the approaches that operate in the sample (diffuser) plane (Depending on the mounting of the diffuser upstream or downstream of the sample, the reconstruction is effectively performed in the sample or the diffuser plane, respectively.),such as 2D XSS and mixed XSS-XSVT, it is proportional to the diffuser step size s in the sample (diffuser) plane instead.This means that these operational modes can achieve a better sensitivity for a given setup (An up to 100-fold improvement of the sensitivity for 2D XSS compared to XST has been reported [135].), as s is typically smaller than p eff .For the 1D XSS analysis, a high sensitivity dependent on the step size can be achieved in the scanning direction, whereas the sensitivity in the other direction that is not scanned is proportional to the pixel size.
Further quantities influencing the angular sensitivity are the number N of diffuser steps for the reconstruction of the image and the extent w of the analysis subset.It can be shown that the angular sensitivity is inversely related to w and √ N [134].This relationship makes the UMPA and XST-XSVT approaches very attractive since the angular sensitivity can be controlled by changing N and w.As mentioned above, the choice of w also determines the spatial resolution of the reconstructed images.Hence, the UMPA and XST-XSVT modes allow flexible tuning of the resolution and sensitivity that can be adjusted to specific experimental requirements.In a practical implementation, also the constraints in scan time and dose, which inherently increase with N, might play a role.The choice of N and w ultimately depends on the focus and the desired outcome of the experiment.

Speckle-Based X-ray Dark-Field Imaging Approaches
In the very first demonstrations of X-ray speckle-based imaging [63,64], the focus was solely on the phase-contrast signal.However, it was soon recognised that complementary dark-field information can be obtained simultaneously from a speckle imaging dataset [65].Although the capabilities of the dark-field image have not yet been extensively exploited for X-ray speckle-based imaging applications, there is great potential in particular for dark-field tomography (see Section 6) for medical and materials science applications.
The dark-field signal gives information about the small-angle scattering in the sample [66,68].For speckle imaging, it is related to the loss in visibility of the speckle pattern caused by a decrease in the coherence of the X-rays after undergoing scattering in the specimen.Different models have been developed to measure the dark-field signal from the acquired speckle data.The first proposed method is analogous to the treatment in X-ray grating interferometry, where the dark-field is defined as the ratio of the amplitudes of the sample and reference phase-stepping curves normalised by the transmission [66].For speckle-based imaging, the same concept can be used, and the standard deviation of the interference pattern can be taken as a measure for the amplitude.The equivalent description of the dark-field signal D for speckle imaging is then given by the ratio of the sample and reference standard deviations, σ sam and σ ref , normalised by the transmission T [65].For a pixel (x, y), this can be expressed as: where u x and u y are the displacements of the sample interference pattern in the two orthogonal directions and σ is the standard deviation operator over all diffuser positions for the scanning-based modes or all pixels in the subset window for XST.Although first derived for 2D XSS, the same procedure for the calculation of the dark-field signal can also be applied to the other operational modes such as XSVT [157] and mixed XSVT approaches [135].
Another way to extract the dark-field signal was first proposed for the single-shot XST method [85] and was later extended for the UMPA mode [134].As outlined in Section 3.1, the reduction of amplitude due to small-angle scattering can be included in a model that expresses the sample speckle pattern in terms of the reference speckle pattern; see Equation (9).A windowed least-squares minimisation procedure delivers here directly the dark-field signal D. The same model is used in the UMPA approach (see Section 3.3), but the signal from several diffuser positions is combined, which allows a higher sensitivity and spatial resolution, also for the dark-field signal [138].
It should be noted that, although the reconstruction approaches in the previous two paragraphs differ, the physical principle of the dark-field contrast generation that they are based on is the same, as pointed out in [163].
An alternative view on the dark-field signal was presented by Wang et al. for the XSS technique [137].Here, the reconstruction is performed by taking a normalised cross-correlation of the interference patterns in neighbouring pixels.This is done separately for the sample as well as the reference pattern.The normalised maximum correlation coefficient in a pixel (x, y) is defined as the ratio of the maximum sample and the maximum reference correlation coefficients [137]: The change in M(x, y) is taken as a measure for the small-angle scattering in the sample, and a reduction of M(x, y) from one pixel to a neighbouring pixel is interpreted as an increased dark-field signal.The absolute dark-field signal in this approach is defined as [137]: Using 1D scanning, Wang et al. report that this approach can deliver directional dark-field images that include contributions from small-angle scattering as well as the second derivative of the wavefront phase [137].However, Berujon claims in [163] that the normalised maximum correlation coefficient cannot accurately describe the scattering behaviour of a sample.He furthermore argues that, rather than the second derivative of the phase, the method senses optical phase discontinuities at pixel boundaries that are larger than the pixel size and hence cannot be regarded as a dark-field signal [163].
In another implementation, Wang et al. used an approach based on the reduction of the peak value of the local cross-correlation coefficient between reference and sample signals to calculate the dark-field image for the XST single-shot analysis [89].The dark-field signal is here defined as D = 1 − γ max , where γ max is the maximum (peak) value of the cross-correlation coefficient, which is obtained for each pixel from the zero-normalised cross-correlation of the sample and reference subset windows.
The correlation coefficient was also used in a dark-field approach proposed for 1D XSS dark-field tomography [87,129,136].The sample speckle pattern is modelled as the convolution of the reference speckle pattern and the optical transfer function of the specimen.The latter can be approximated by taking into account the phase shift as well as the scattering in the sample, where the scattering is modelled as Gaussian and isotropic.Cross-correlation is performed between the sample arrays and the reference arrays.From these considerations and with some further approximations, the maximum of the cross-correlation coefficient can be expressed as [87]: where d is the propagation distance, σ 2 the second moment of the scattering angle distribution and ζ speckle the average speckle size, which can be estimated from the position of the maximum of the speckle pattern power spectrum.This can be rearranged to obtain the dark-field signal D: The model of the sample interference pattern as a convolution of the sample scattering distribution and the reference pattern is also used in [157].However, here the full scattering distribution is analysed using iterative methods (see Section 3.2.5),and the transmission, differential phase and dark-field signals are interpreted as its different moments.In this framework, the two second normalised moments can be seen as the characteristic scattering width in the two orthogonal directions, equivalent to the dark-field signal.Further complementary scattering signals corresponding to various physical phenomena can also be obtained with this approach.

Translation to Laboratory Sources and High X-ray Energies
The relatively low requirements on the temporal and spatial coherence of the X-ray beam [133] make speckle-based imaging an ideal candidate for the application at laboratory-based systems with conventional X-ray tubes.The translation of the speckle-based technique to a laboratory source was first demonstrated with the single-shot XST technique [85] at a liquid metal-jet source (Excillum) [164].Transmission, differential phase and dark-field images were successfully reconstructed for several samples, such as the plastic flower shown in Figure 7. Shortly after, the implementation of the 2D XSS method at the same laboratory source was also reported [86].The liquid metal-jet source used in [85,86] is a laboratory source with relatively high flux and a small spot size that has a polychromatic spectrum dominated by the gallium, indium and tin emission lines of the liquid anode material [164].However, it has been shown that also conventional micro-focus sources with lower flux and a broader spectrum can be used for speckle-based imaging [87,136].As the transverse coherence length for conventional sources is lower than for the liquid metal-jet source, it is more challenging to produce X-ray near-field speckle, which relies on scattering and interference effects.It has been demonstrated that a high-visibility reference pattern can also be created by exploiting the absorption of small random structures, e.g., from coarse sandpaper [87] or a "random absorption mask" such as steel wool [136].The "absorption-speckle" method can be easily applied to a large range of laboratory sources.However, one should be aware that this approach is not speckle imaging in its original definition as the reference pattern is not a speckle pattern based on interference effects.It has been shown that absorption speckle allows the use of high-energy X-rays, for which the contrast of a conventional near-field speckle pattern created by a piece of sandpaper is usually low [136].On the other hand, recently, near-field speckle-based imaging was demonstrated also using conventional phase speckle with high-energy X-rays from a filtered synchrotron bending magnet beam with a mean energy of 65 keV and 25% bandwidth of the detected spectrum [156].A speckle pattern of high visibility was achieved in this setup by stacking several sheets of sandpaper.
For a practical implementation of the speckle-based technique with polychromatic X-rays, one should be aware that, as for other imaging methods, artefacts may arise from beam hardening in the specimen, in particular for high-density samples.This has been investigated in detail in a simulation study [133], and the effect has recently been observed experimentally in the dark-field signal of XST measurements conducted at a micro-focus laboratory X-ray source [165].

Speckle-Based X-ray Phase-Contrast and Dark-Field Tomography
For many applications, the 2D data alone are not sufficient, and it is essential to obtain quantitative 3D information of the inner density distribution in a specimen.Often, also the 3D scattering distribution is of interest and can give complementary information.As illustrated in the previous sections, speckle-based imaging can provide quantitative phase-contrast signals as well as transmission and dark-field images from a single dataset.The extension from 2D projection imaging to 3D tomography is straightforward.Projections with the sample in the beam are taken at typically a few hundred or thousand different viewing angles of the specimen between 0 • and 180 • (or 360 • ).Depending on the operational mode (see Section 3), images are acquired at one or several diffuser positions.References without the sample do not need to be taken for each projection, and in principle, it is sufficient to have one reference image at each diffuser position.However, commonly, a few sets of references are recorded to reduce the effects of beam instabilities.For each of the projections, the multimodal image signals are then reconstructed from the acquired raw data.Subsequently, a tomographic reconstruction algorithm, e.g., filtered back-projection [166], is applied to obtain the phase, transmission and dark-field tomograms.
Phase-tomography using the speckle-based technique has been demonstrated both at highly brilliant synchrotron sources as well as in the laboratory.In a first report, the phase and transmission tomograms of a human artery obtained with the single-shot XST mode (see Section 3.1) were shown [89].The superior sensitivity to density differences of the phase signal over the transmission signal, here between the artery lumen and walls, was observed in a qualitative way; see Figure 10I in Section 7.2.
At around the same time, a quantitative analysis of speckle tomography data was presented from XST measurements at a liquid metal-jet laboratory source [88].Here, it was shown that the complementary quantitative absorption and refraction information from transmission and phase tomograms, respectively, can be combined for identifying and characterising different materials with similar refraction and absorption properties in a sample; see Figure 10V in Section 7.2.
Furthermore, quantitative phase and dark-field tomographies of a phantom sample were successfully demonstrated using the 1D XSS method (see Section 3.2.2) [129].However, it should be noted that an object with features oriented mainly along the axis orthogonal to the scanning direction was chosen, and only the refraction signal in the scanning direction was considered in the tomography reconstruction.The sensitivity along the axis opposite the scanning direction is typically lower for the 1D XSS method.
Also, the XSVT approach and the mixed XST-XSVT (see Section 3.3) have been implemented in tomographic mode, and it was shown that complementary absorption, phase and dark-field tomograms of berry samples could successfully be reconstructed [135].An intelligent interlaced acquisition scheme, similar to the one proposed for grating interferometry in [167], was used here to reduce the number of required diffuser steps for the tomography scan even further by including the information from several subsequent projections.This way, as few as five diffuser positions per projection could be used for the interlaced XSVT tomography when combining the information from additional two projections before and after the projection of interest [135].With an otherwise identical acquisition scheme, this was reduced to only one diffuser position per projection for the mixed XST-XSVT approach, which in the analysis includes the information from neighbouring pixels in a small window, here 3 × 3 pixels, centred around the pixel under consideration [135].
A similar interlaced system was applied to the acquisition scheme of sparsely sampled XSS (see Section 3.2.4)[156].Considering the information from two preceding and two following projections in the analysis of one projection allowed stepping of the diffuser effectively on a 5 × 5 grid, while only taking five diffuser steps per projection.For projection p + 5k with k = 0, 1, . . ., (N − 5)/5; p = 1, 2, . . ., 5, five images were acquired only at the diffuser positions in row p of the 5 × 5 grid, where N is the total number of projections of the tomography scan.The reference pattern was scanned on a denser grid following the conventional 2D XSS scheme, and the corresponding missing sample frames were obtained by interpolation.High-quality absorption and phase volumes were retrieved with this approach, while the exposure time could be significantly reduced thanks to the sparse sampling and interlaced acquisition scheme.
The translation of UMPA (see Section 3.3) from 2D projection to 3D tomographic mode is currently under way and giving promising results that allow reducing the number of steps down to five or possibly less per projection without the need for interpolation or other computationally expensive preparation of the raw data.

Applications of the X-ray Speckle-Based Technique
As X-ray near-field speckle imaging is a versatile, robust and easily implemented technique, it can be expected to find applications in a wide range of fields.Being a relatively young method, a lot of the tremendous potential of speckle-based X-ray imaging has yet to be explored.The main applications of the technique that have been demonstrated so far are illustrated in the following.

Metrology and Wavefront Sensing
A focus of applications has been the use of X-ray near-field speckle for metrology, optics characterisation and beam phase sensing.The simple and robust experimental arrangement and high angular sensitivity make the speckle-based technique an ideal candidate for metrology.The idea of applying speckle imaging to wavefront measurements and optics characterisation was presented early on in the first publications on the technique [63,65].In the following years, increasing use of near-field speckle was reported for the characterisation of refractive lenses [93,134,[168][169][170][171] and X-ray mirrors [90,93,154,155,169,[172][173][174][175], as well as analysing the local beam wavefront [63,65,169] and measuring the transverse coherence length of the X-ray beam [92,93,176].
For metrology, speckle-based phase-sensing is commonly operated in one of the two modes [65,93]: the differential mode or the self-correlation mode; see Section 3.
Moderately refracting optical elements such as single compound refractive lens (CRL) elements can be analysed using the common differential mode, which is based on acquiring one or more reference interference patterns and one or more sample patterns with the optics in the beam and subsequent reconstruction of the differential phase using one of the available analysis methods (see Section 3).The wavefront phase Φ downstream of the optical element can then be obtained from the differential phase (refraction angle) signal via integration.
The characterisation of a 2D CRL element was first demonstrated using XST [168,169] and 2D XSS [65] in differential mode; see Figure 8I.Furthermore, a 1D parabolic lens made from beryllium was analysed with 1D XSS, as shown in Figure 8II, and the aberrations from the expected wavefront downstream of the lens were retrieved [170].Just recently, parabolic 1D and 2D CRL elements made from SU-8 polymer material [177] were inspected using the UMPA approach implemented in two configurations, with either a piece of random sandpaper or a periodic phase grating as a phase modulator [134,171]; see Figure 8III.The analysis allowed the sensitive identification and quantification of deviations from the expected refraction behaviour caused by beam damage and shape errors of the lenses, as shown in Figure 8IV.
On the other hand, the self-correlation mode (Section 3.2.3)can be employed to directly measure the absolute effective local wavefront curvature, i.e., the second derivative of the wavefront after passing through the lens [65].
For strongly focussing (or defocussing) optics such as X-ray mirrors, it is essential to use the self-correlation mode (see Section 3.2.3),as in this case the X-ray beam is significantly (de-)magnified by the optical element, and the conventional correlation procedure between sample and reference scans will not succeed in accurately measuring the wavefront distortions.The self-correlation analysis has been applied for the characterisation of mechanically bent and piezo bimorph X-ray mirrors.A single 1D scan of the diffuser allows retrieving the 1D mirror slope [90], and it has been shown that also the 2D slope can be accessed from 1D scanning [154].As mentioned in Section 3.2.3,measurements can be performed with the diffuser upstream or downstream of the optical element under consideration [155].The two configurations are illustrated in Figure 9I.
The first configuration gives information about the wavefront distortions caused by the optical element downstream of the diffuser only.This approach is suitable for the characterisation of mirror surfaces in order to detect slope errors.The reflective surface of the mirror and its errors can be analysed directly, as shown in Figure 9II,III.The separation in the plane of the incident wavefront of two rays that are adjacent in the detector plane is obtained from the signal delay given by the correlation procedure.Subsequent integration allows calculating the position of the rays in the diffuser plane, and an iteration process delivers the mirror slope [90].It was demonstrated that this way slope errors can be accurately determined, allowing precise optimisation of the mirror [90,93,154,155].
The downstream configuration (see Figure 9I) senses the total beam wavefront modulated by all optics in the beam upstream of the diffuser, rather than the properties of an optical element itself.Typically, the local radius of curvature of the wavefront is reconstructed, which is directly related to the second derivative of the wavefront phase Φ (see Equation ( 14)) [65,90,155,173].This approach has been applied successfully to the fast, precise optimisation of bimorph mirrors with the aim to obtain a desired beam size and shape [93,155,[173][174][175]; see Figure 9IV.Sensitivities down to 2 nrad have been reported for these applications [155,173].An in-situ portable metrology device based on this concept has been developed at Diamond Light Source [174].Its use for the characterisation of elliptical mirrors, the optimisation of bimorph mirrors and mirror alignment has been demonstrated [175].In addition to the investigation of optical elements such as X-ray refractive lenses and mirrors, it can also be of interest to characterise the absolute beam phase without additional beam-shaping optics.This was shown with the XST method in so-called absolute mode [63,169].In this configuration, images are recorded at two different detector positions along the beam path, and the cross-correlation is performed between these two images without the use of a reference speckle pattern.The recovered local displacement of the speckle pattern relates to the refraction angle, i.e., the first derivative of the wavefront, which can then be integrated to obtain the beam phase.This method, however, requires the beam to remain stable over the course of the two image acquisitions.For cases where the X-ray beam is fluctuating in time, it is more appropriate to record the two images simultaneously and a different variation of this type of measurement was demonstrated for this purpose [91].The setup consists of a diffuser and one camera with a semi-transparent mirror and scintillator that records an image, but at the same time transmits part of the X-rays, which is recorded by a second camera further downstream.Cross-correlation according to the XST approach between the two simultaneously recorded images delivers the first derivative of the beam phase.Subset distortions can also be taken into account to gather additional information on the second derivative of the beam phase.This approach is particularly suitable for pulsed wavefronts found, e.g., at X-ray free-electron lasers, where the beam profile changes from shot to shot.
Apart from the beam phase, also information about the transverse coherence of the X-ray beam can be obtained using X-ray near-field speckle.This had first been shown in the early days of X-ray near-field speckle by using a colloidal suspension as a diffuser [176] and later with speckle from a filter membrane [92,93].Only a single exposure of the diffuser is necessary for the analysis, and the transverse coherence length can be retrieved by looking at the Fourier power spectrum of the flat-field corrected speckle interference pattern.As demonstrated in [123], the power spectrum can be decomposed into the 2D scattered intensity distribution and a transfer function.The latter contains contributions from the Talbot effect, the detector response and the partial coherence of the beam.The detector response can be measured, and the Talbot contribution is a known function.When a Gaussian intensity distribution is assumed, the partial coherence term is a function of the transverse coherence lengths in the two orthogonal directions.The known contributions from the detector response and Talbot effect as well as the model of the partial coherence term can be included in a fit function of the angular power spectrum.By fitting of the measured angular power spectrum to the function, using, e.g., a least-squares minimisation procedure, the transverse coherence lengths of the X-ray beam can be determined [92].

Imaging for Biomedical and Materials Science Applications
Another important and promising area of applications of the speckle-based technique is X-ray phase-contrast and dark-field imaging in particular for biological, biomedical and pre-clinical research as well as materials science.
For biomedical and biological soft-tissue specimens, the phase-contrast signal is of particular interest, as it shows a much higher sensitivity to small density differences than the absorption image for this type of sample.Speckle-based phase-contrast tomography of biomedical and biological specimens has been explored with XST, and the phase tomogram of a human artery was successfully obtained, showing superior contrast compared to the transmission signal [89]; see Figure 10I.Furthermore, 1D XSS was employed to measure a whole fish, and the multimodal images shown in Figure 10III illustrate the complementary character of the different signals, which allows revealing different parts of the sample [87].The multi-contrast signals of a chicken wing were measured with 1D XSS at a micro-focus laboratory source [87], which is a promising step towards the large-scale and accessible implementation of speckle-based imaging for biomedical applications.The results on the fish and chicken wing [87] as well as the high-contrast scans of different kinds of berries using variations of the XSVT technique [135,156,157] (see Figure 10II) also indicate the potential in the area of food inspection for quality control and foreign body detection.Furthermore, the multimodal UMPA method has proven to be suitable for the investigation of biological samples; see Figure 10IV.It allows flexible tuning of the reconstruction result essential for optimising the trade-off between dose on the specimen and image quality, which is of great importance for biomedical specimens.The complementary character of the various contrast modalities provided by speckle-based imaging can also be exploited for materials science applications.It was demonstrated that XST tomography implemented at laboratory sources can be employed for the identification of different materials in a sample.Several types of plastic were successfully distinguished using the combined information from phase and absorption tomograms [88], as shown in Figure 10V.In another publication, the chip of a computer memory card was imaged using 1D XSS at a laboratory source, and the complementary phase and dark-field signals enabled identifying different components of the chip [136]; see Figure 10VI.These examples suggest the promising potential of the speckle-based technique for the inspection and quality control of electronics as well as identification of different materials in a sample, which can be performed with a simple setup at widely available laboratory sources.

Other Applications
A different application of X-ray near-field speckle is the use for capturing dynamic processes such as blood flow [126,[178][179][180][181] and the movement of mouse lungs [182,183].Here, one makes use of speckle created directly by the specimen under study, and no diffuser is needed.The speckle from blood or from the alveoli of the lung can be used as a marker to track the dynamic process.A windowed cross-correlation analogous to the XST imaging approach is performed between the speckle images recorded at different points in time.From the displacement of the speckle pattern, the speed of the particles can be calculated.
The recent advances in acquisition schemes and reconstruction approaches allow short scan times, flexible tuning of the signal sensitivity and spatial resolution and a straightforward implementation at laboratory sources.Following these developments, it can be expected that the range of applications of the speckle-based technique will increase further in the next few years, and the method will be employed widely at synchrotron and laboratory sources.In particular in the field of biomedical and pre-clinical imaging, speckle-based phase-contrast as well as dark-field imaging have great potential due to their robustness, cost-and dose-effectiveness, amongst others.

Conclusions and Outlook
Despite being developed just a few years ago, X-ray near-field speckle-based imaging has already seen rapid development and is receiving rising interest in the X-ray imaging community.The method has been demonstrated in various acquisition and reconstruction modes, catering to different demands on the spatial resolution, angular sensitivity and scan time.The latest advances in the operational modes of the technique offer the opportunity to flexibly tune these properties by adjusting reconstruction and scan parameters.
Developed at synchrotrons, X-ray speckle-based imaging was soon translated to laboratory sources with reduced temporal and spatial coherence without major efforts, making the method available for a wide range of users.
The current applications of the speckle-based technique have been focussed on metrology, optics characterisation and beam phase sensing, for which extremely high sensitivities were achieved.The results obtained with X-ray phase-contrast and dark-field tomography for biomedical applications and materials science indicate the high potential of speckle imaging in these fields.Further applications of speckle-based tomography for multimodal quantitative visualisation of the inner structure of samples are anticipated.
Future work on improving the existing speckle imaging implementations might include the development of alternative diffuser materials that can be adapted to specific experimental setups as well as further optimisation and acceleration of reconstruction algorithms.
The robustness and ease of implementation of X-ray speckle-based imaging has attracted increased interest and extensive research on the technique in the last few years.Following the recent developments, the widespread use of X-ray speckle-based imaging and metrology can be expected for applications in an expanding range of fields.

Figure 1 .
Figure 1.(a) Schematic of an X-ray speckle imaging experiment.X-rays impinge on a diffuser, creating a random speckle pattern in the detector plane.When an absorbing, phase-shifting and scattering sample is placed in the beam, the reference pattern is modulated in intensity, position and visibility.(b) Line plot through a few pixels of a reference (blue) and corresponding sample (red) speckle pattern visualising the drop in intensity (dashed horizontal lines) due to absorption A = (1 − T), the displacement u due to refraction of the X-rays by the angle α and the reduction in amplitude (after transmission correction) due to small-angle scattering D.

Figure 2 .
Figure 2. (a) Speckle pattern created by sheets of sandpaper with a sample (silicon sphere of 480 µm diameter glued onto a wooden toothpick) in the beam.Region of interest in (b) the sample and (c) the reference interference pattern.A displacement of the speckles in (b) with respect to (c) can be observed in the sphere (2, 3), but not in the air background region (1).The dashed orange boxes in (b) indicate the corresponding position of the marked speckles in the reference image.

Figure 3 .
Figure 3. (a) Setup for single-shot XST imaging.(b) One sample image and (c) one reference image (without the sample) are acquired.(d,e) A subset window larger than the speckle size is selected around each pixel in the image for reconstruction.

X
-r ay s d e te c to r im a g e s a m p le d if fu s e

Figure 4 .
Figure 4. (a) Setup for 2D XSS imaging.The diffuser is stepped in two directions in small equidistant steps on a regular grid.(b) A sample image and (c) a reference image are acquired at each of the several hundred diffuser positions.(d,e) For each pixel, a 2D array with the signal at each diffuser position is obtained, enabling a high-resolution pixel-wise reconstruction.

Figure 5 .
Figure 5. (a) Setup for 1D XSS imaging.The diffuser is stepped in only one direction in small equidistant steps.(b) A sample image and (c) a reference image are acquired at each of the several tens of diffuser positions.(d,e)For each pixel, a 2D array is built from the signal at each diffuser position in the pixel of interest and a few surrounding pixels in the direction that is not scanned.

Figure 6 .
Figure 6.(a) Setup for speckle imaging with a random scan pattern of non-equidistant, large steps (XSVT and UMPA).The diffuser is stepped in two directions in a few large random steps.(b) A sample image and (c) a reference image are acquired at each of the diffuser positions.For XSVT, the analysis is performed for each pixel by comparing the (d) sample and (e) reference vectors built from the intensity in a single pixel at each diffuser step.For the UMPA and XST-XSVT approaches, a small subset window is chosen around the pixel under consideration in each of the (f) sample and (g) reference images at the different diffuser positions, allowing one to reduce the number of steps and improving the reconstruction result.For the XSS-XSVT reconstruction, a (h) sample vector is built as for the XSVT case, while for (i) the reference vector, the diffuser is scanned in small equidistant steps around each of the initial diffuser positions.

Figure 7 .
Figure 7. First demonstration of X-ray speckle-based imaging at a laboratory source.(a) Transmission, (b) differential phase in the horizontal and (c) the vertical direction and (d) the dark-field signal of a plastic flower on a wooden support could be successfully retrieved.(e) Wavefront phase obtained from integration of (b,c).Reprinted figure with permission from [85].Copyright (2014) by the American Physical Society.

(
I) Wavefront slope for a 2D beryllium CRL element measured with 2D XSS.(II) Vertical refraction angle, i.e., wavefront slope (top) and reconstructed phase (bottom) for a 1D beryllium refractive lens measured with 1D XSS.Scale bar corresponds to 0.2 mm.(III) Horizontal refraction angle for a 2D polymer CRL element measured with UMPA using a random (left) and a periodic (centre) phase modulator to create a reference pattern and comparison with grating interferometry (right).(IV) Deviation from the expected horizontal (left) and vertical (centre) refraction angle and absolute deviation (right) in the aperture of the 2D polymer CRL in (III), measured with UMPA using a speckle pattern as a wavefront marker.
(I) Two different configurations for the optimisation of an X-ray mirror by 1D speckle-scanning with a self-correlation analysis.The diffuser can be placed upstream (top) or downstream (bottom) of the mirror for mirror-slope measurement or beam wavefront characterisation, respectively.(II) 2D slope errors and intensity profiles along the propagation direction before (left) and after (right) optimisation of an X-ray bimorph mirror, measured with the upstream configuration in (I) (top).(III) 1D slope errors of a vertically (left) and a horizontally (right) focussing X-ray mirror measured with the diffuser upstream of the mirrors and comparison with NOM (Nanometer Optical Measuring System) results.(IV) Wavefront radius of curvature at the detector measured with the downstream configuration in (I) (bottom) and corresponding intensity profiles along the propagation direction (distance z in mm from the mirror) (a) before optimisation, (b) after optimisation (focussed) and (c,d) after optimisation (defocused) of a bimorph mirror used for beam shaping.

(
I) Volume rendering of the transmission (left) and phase (right) volumes of a human carotid artery obtained with XST tomography.(II) Volume rendering of the dark-field (left) and phase (right) volumes of a juniper berry obtained with interlaced XSVT tomography.(III) Reconstructed absorption, dark-field, differential phase in the vertical and horizontal directions and integrated phase signal (left to right) of a fish obtained with 1D XSS projection imaging (vertical scanning).Scale bar corresponds to 1 mm.(IV) Horizontal, vertical refraction angle, integrated phase, transmission and dark-field (left to right) projections of a small flower bud obtained with UMPA.(V) Material characterisation using XST tomography at a liquid metal-jet laboratory source.Different kinds of plastic in a phantom sample can be distinguished by combining attenuation and refraction information.The diameter of the spheres is 1.5 cm.(VI) Reconstructed transmission (top) and dark-field (bottom) images of a microchip imaged at a laboratory X-ray micro-focus source using 1D XSS with an absorption speckle pattern.Scale bar corresponds to 2 mm.