Introduction

X-ray imaging has been widely adopted in medicine and security, providing non-invasive visualisation of internal structure at high spatial and temporal resolution. The conventional mechanism for x-ray contrast is attenuation, where dense and/or thick objects reduce the intensity of the illuminating x-ray wavefield. More recently, the capabilities of x-ray imaging have been extended in research laboratories and synchrotrons, capturing weakly-attenuating features like soft biological tissue1 through measurements of the wavefield phase, and revealing sub-pixel structures like dentinal tubules2 via a ‘dark-field’ signal that originates from unresolved scattering. Because an x-ray detector is typically only sensitive to wavefield intensity, specialised optical set-ups are required to convert variations in wavefield phase and dark-field into measurable variations in intensity. A mathematical model of the behaviour can then be used to retrieve the phase and dark-field information, typically from several exposures taken with different optical settings. There are a number of set-ups that have demonstrated the ability to do this, beginning with crystal interferometry3 in the 1960s. The advent of highly coherent synchrotron x-ray sources several decades later led to propagation-based phase contrast x-ray imaging, where the coherent wavefield self-interferes during propagation to reveal phase information in addition to attenuation effects4,5. More recently a number of techniques have been developed that utilise high-frequency gratings to measure attenuation, phase and dark-field information. These techniques include grating interferometry6,7,8,9,10, edge-illumination11 and single-grating imaging12,13. A generalisation of single-grating imaging is speckle-tracking14,15, where the grating is substituted with a object, typically a sheet of sandpaper, that creates a reference pattern that need not be periodic, and is typically random.

This manuscript focuses on the grating and speckle-based phase contrast x-ray imaging set-ups. These set-ups can extract an attenuation image, a differential phase contrast image (or, in some cases, two complementary directions of differential phase contrast), and a dark-field image (or directional dark-field images in some cases, when applied to a sample with aligned elongated sub-pixel features). These image modalities can be understood by considering a pencil beam, or beamlet, passing through the sample. This beamlet will decrease in total intensity if the sample is attenuating. Variations in the thickness or refractive index of the sample can alter the phase of the x-ray wave, and result in a change in the direction of beamlet propagation, as seen in Fig. 1a. Therefore, the phase signal can be extracted by looking at some kind of transverse shift in the intensity profile at a distance downstream (e.g. z = Δ, where z is the optic axis). If the beamlet is symmetrically increased in width, as a result of sub-resolution sample structures (Fig. 1b)16, this is described as a scatter, visibility or dark-field signal, measured by looking at a reduction in the visibility of the illumination17. Visibility can be defined using Michelson’s definition \(V=({I}_{max}-{I}_{min})/({I}_{max}+{I}_{min})\), where Imax is the local maximum intensity and Imin is the local minimum intensity18, so that high visibility indicates that Imax is much larger than Imin. A strong dark-field signal will be seen as a significant decrease in illumination visibility. The dark-field signal measured by a grating-based system originates largely from small angle x-ray scattering (SAXS) or incoherent scattering that is below the resolution of the imaging system, but can also result from edges19 or focusing20, beam hardening21,22 and other effects. In most imaging applications, the sample will introduce both a transverse shift and broadening of the beamlet at a distance z = Δ, as seen in Fig. 1c. The complementary transverse directions (e.g. x, y) of phase contrast and directional dark-field would be measured by looking at transverse shifts and broadening in the direction shown in the diagram and the direction perpendicular to the page.

Figure 1
figure 1

A photon or x-ray beamlet may encounter: (a) a phase gradient in the sample, transversely shifting the position of the detected light at a downstream detector, (b) small angle scattering from the sample, spreading out the beamlet, reducing the visibility, and broadening the probability distribution that describes where the photon will land at a downstream detector, or (c) both effects.

The intensity profiles shown on the right of each panel in Fig. 1 are reminiscent of a probability density function that experiences changes in mean (Fig. 1a) and standard deviation (Fig. 1b). The sum of x-ray photons within each pixel, measured as intensity, can be modelled as a probability density function since the integrated intensity from sample exit plane to downstream plane is constant for a beam propagating in vacuum. This paper therefore studies the Fokker–Planck equation, an equation typically used to describe the time-evolution of a probability density function, and applies it to describe the propagation-evolution of a beamlet in x-ray phase/dark-field imaging23. In a companion paper24, we show how the Fokker–Planck equation is an extension to the transport of intensity equation25 used in coherent x-ray optics and also provide a derivation from first principles. Here, we begin with a short probability-based introduction to the Fokker–Planck equation, then show that it can be applied to better understand how the x-ray dark-field and differential phase signals can interact, looking at additional effects seen near edges and as a result of focusing. These sections look specifically at imaging using patterned illumination that is directly resolved (e.g. single-grid imaging with an attenuating12,26 or phase-shifting grating27,28, or speckle-tracking14,15,29). Given that attenuation is a simple scaling of the intensity signal, hence a multiplicative factor at the front of the Fokker–Planck equation, we leave out this effect for simplicity. The final section demonstrates that the results and approach described in the earlier sections can be extended to the cases where the illumination is analysed via a second grating or mask (e.g. grating interferometry or edge-illumination imaging).

The X-ray Fokker–Planck equation

The Fokker–Planck equation, shown below, describes the evolution of a probability density function p with time t. Changes can include a time-dependent drift in both mean (D1, a transport-type energy flow) and/or standard deviation (D2, a diffusive-type energy flow)30,

$$\frac{\partial }{\partial t}p(x,t)=-\,\frac{\partial }{\partial x}({D}_{1}(x,t)p(x,t))+\frac{{\partial }^{2}}{\partial {x}^{2}}({D}_{2}(x,t)p(x,t)),$$
(1)

as shown in Fig. 2a after a given time interval t = Δ.

Figure 2
figure 2

(a) The Kramers–Moyal equation and its truncated equivalent, the Fokker–Planck equation, describe the diffusion and shift in a probability function. (b) This same equation can be applied to study the x-ray dark-field and phase shift measured using periodic x-ray illumination.

Since the path taken by an ensemble of photons will follow a probability density function and be seen as such when those locations are registered as intensity on the detector, we can use the Fokker–Planck equation to model changes in the measured x-ray intensity. The Fokker–Planck equation can also be seen as the transport of intensity equation (TIE) with the addition of a diffusive term24. In the grating-based phase contrast x-ray imaging methods mentioned above, a grating will typically split the beam into an array of ‘beamlets’, each of which will pass through the sample and propagate through free space to a detector. We can begin by looking at the one-dimensional intensity distribution measured downstream of a sample that is illuminated by an array of beamlets, with a transverse shift of each beamlet seen at z = Δ when the beamlet passes through a phase-shifting sample (Fig. 1a), and a reduction in visibility of each beamlet seen at z = Δ when the beamlet scatters at small angles from sub-pixel features in the sample (Fig. 1b).

To move from the time-evolution of a probability function (Fig. 2a, Eq. (1)) to the case of spatial drift and diffusion of an array of x-ray beamlets in the presence of a sample (Fig. 2b, Eq. (2), where I(x) is a sinusoid), we should replace:

  • Time t with propagation distance z

  • Probability density function p with x-ray intensity I

    (In the case shown in Fig. 2, the centred probability density function p is replaced by an array of x-ray intensity beamlets I, described by a sinusoid)

  • Drift velocity D1 with the change in angle of x-ray wavefield propagation, determined by the sample-induced phase shift \(\frac{1}{k}\frac{\partial \varphi }{\partial x}\)

  • Diffusion coefficient D2 with a value D(z) that characterises the length scale of unresolved x-ray scattering at distance z.

This gives the ‘X-ray Fokker–Planck equation’24,

$$\frac{{\rm{\partial }}}{{\rm{\partial }}z}I(x)=-\frac{1}{k}\frac{{\rm{\partial }}}{{\rm{\partial }}x}(I\frac{{\rm{\partial }}\varphi (x)}{{\rm{\partial }}x})+\frac{{{\rm{\partial }}}^{2}}{{\rm{\partial }}{x}^{2}}(D(x,z)I(x)).$$
(2)

Note that the conventional Fokker–Planck model will describe a diffusion that increases the spread of light in a non-linear manner with propagation. This is not consistent with the linear increase in spread with propagation distance seen when a scattered wave-field propagates through free space. For this reason, \(D(x,z)\) is set as a function of z, so that the diffusion width can increase linearly with propagation distance z (see Paganin & Morgan for further justification24).

In order to fully describe directional, three-dimensional or more complex behaviour, we would need an equation that includes more spatial dimensions and terms. This is a good time to note that the Fokker–Planck equation is the truncated form of the more general Kramers–Moyal equation23,30. This more general equation includes third-order and higher-order terms, and describes changes in n spatial dimensions, with \({\bf{x}}=({x}_{1},{x}_{2},{x}_{3}...)\) as Cartesian coordinates, as below (utilising the Einstein summation convention),

$$\frac{{\rm{\partial }}}{{\rm{\partial }}t}p({\bf{x}},t)=-\frac{{\rm{\partial }}}{{\rm{\partial }}{x}_{i}}[{D}_{i}({\bf{x}},t)p({\bf{x}},t)]+\frac{1}{2!}\frac{{{\rm{\partial }}}^{2}}{{\rm{\partial }}{x}_{i}{\rm{\partial }}{x}_{j}}[{D}_{ij}({\bf{x}},t)p({\bf{x}},t)]-\cdots $$
(3)

For the case of two dimensions and truncation immediately before the ‘—…’ shown above, we have the anisotropic-diffusion Fokker-Planck equation, which well-describes a two-dimensional x-ray beamlet landing on a two-dimensional detector,

$$\frac{{\rm{\partial }}}{{\rm{\partial }}z}I({\bf{x}},z)=-\frac{{\rm{\partial }}}{{\rm{\partial }}x}(\frac{1}{k}\frac{{\rm{\partial }}\varphi }{{\rm{\partial }}x}I({\bf{x}},z))-\frac{{\rm{\partial }}}{{\rm{\partial }}y}(\frac{1}{k}\frac{{\rm{\partial }}\varphi }{{\rm{\partial }}y}I({\bf{x}},z))+\frac{{{\rm{\partial }}}^{2}}{{\rm{\partial }}{x}^{2}}({D}_{x}I({\bf{x}},z))+\frac{{{\rm{\partial }}}^{2}}{{\rm{\partial }}{y}^{2}}({D}_{y}I({\bf{x}},z))+\frac{{{\rm{\partial }}}^{2}}{{\rm{\partial }}x{\rm{\partial }}y}({D}_{xy}I({\bf{x}},z))$$
(4)

(absorbing any multiplying fractions into Dx, Dy and Dxy). This kind of diffusion in multiple directions is ideal for modelling a directional and/or irregularly shaped x-ray dark-field signal31, and is an avenue for future work. The parameters Dx, Dy and Dxy describe a diffusion profile that has the shape of an ellipse, and hence requires three parameters to describe it fully. These three parameters may be mapped one-to-one to the semi-major axis, the semi-minor axis, and the angular orientation of the elliptical diffusion profile. Note also, that if the infinitely-many terms in the Kramers–Moyal equation are truncated to no higher than second-order spatial derivatives, the result is the Fokker–Planck equation. As shown by Pawula, one should either truncate to second-order or not at all, since ‘if one assumes that terms above a given order are zero in the Kramers–Moyal expansion, this assumption implies that all terms above second order are zero’32.

Application of the Fokker–Planck model to describe phase and dark-field effects

To model x-ray grating-based phase and dark-field imaging, the key method considered in the present paper, we can set the intensity that illuminates the sample to a sinusoid. This can describe the intensity that would be seen downstream of a grating or grid, and can be specified for period p, amplitude a and mean intensity b,

$$I=a\,\sin (\frac{x}{p})+b.$$
(5)

Note that we have omitted the factor of 2π inside the sinusoid that would be required to describe a period of exactly p. This choice was made to keep the equations as simple as possible without neglecting any effects. The general expression given in Eq. (5) means the illumination without any sample in the beam would have a mean intensity of b and visibility of a/b (e.g. the grey curve in Fig. 3a). Given that a Fourier series could be used to form any other illumination (e.g. periodic ‘square’ illumination sampled an order of magnitude more finely than the grid period26 or a speckle pattern generated by a piece of sandpaper14,15,29), the choice of a sinusoidal illumination is generally useful. In the illustrations given in Figs 36, we have sketched a sinusoidal illumination that is likely seen at a detector downstream of an absorption or phase grid, effectively a normalised intensity (reaching from 0 to 1) that has been smoothed to a more realistic visibility of 0.5 so that the sinusoid is described by \(a\approx \frac{1}{4}\) and \(b\approx \frac{1}{2}\). A visibility that is less than 1 is typically seen due to limited coherence, some penumbral blur and/or sampling of relatively fine grids (e.g. 7 pixels per grid period) that are chosen to maximise the resolution of the retrieved images12.

Figure 3
figure 3

(a) A diffusion of the illumination is the basis for a dark-field signal, shown here for the simple case where the diffusion D is constant. The reduction in the visibility of the periodic illumination is described by Eq. (8). (b) When the diffusion D is not constant, any sudden spatial change in the scattering properties (i.e. \({\partial }^{2}D/\partial {x}^{2}\) is significant) results in an effect that would be interpreted as variations in dark-field, phase and attenuation, as described in Eq. (12).

Figure 4
figure 4

(a) We can examine the effects seen where the diffusion or dark-field/scattering property D changes spatially. The test sample here is weakly scattering on the left and strongly scattering on the right, as modelled by Eq. (13), meaning that \({\partial }^{2}D/\partial {x}^{2}\) is non-zero during the transition between the two regions. The resulting intensity can be described by Eq. (14) or, if the area on which the scattered light falls (\(\sqrt{(}D\Delta )\)) is wider than the illumination period p, by Eq. (16). The area indicated as ‘Additional scattered light’ in the sample collects light that is scattered from the right, so collects more scattered light than the rest of the area behind the weakly scattering volume. This means that, relative to the rest of the weakly scattering area on the left, the mean intensity is increased here, and, depending on the period of the illumination relative to the spread of the area, the local visibility of the periodic illumination is increased, since \({\partial }^{2}D/\partial {x}^{2}\) is positive. The area indicated as ‘Less scattered light’ experiences less scattered light than the rest of the strongly scattering area on the right, since the scatterers in the adjacent weakly scattering area do not scatter as broadly. This means that, relative to the rest of the area behind the strongly scattering part of the sample, the mean intensity is decreased here, and the visibility of the periodic illumination is decreased, since \({\partial }^{2}D/\partial {x}^{2}\) is negative. Panel (b) shows the effect of changing the illumination period, while the diffusion/dark-field property D is fixed, which helps to reveal the shape of the scattering edge signature. Note also that the reduction in visibility is much more significant when the period of oscillation approaches and becomes smaller than the length scale associated with the diffusion/scattering.

Figure 5
figure 5

(a) A shift of the illumination is the basis for a phase shift signal, shown here for the simple case where the second derivative of the phase gradient is not significant. The shift in the transverse position of the periodic illumination is described by Eq. (22). (b) When the second derivative of the phase gradient is significant, and the phase can be locally described as \(\varphi =A{x}^{2}+Bx+C\), we can see a transverse shift, squeezing and a local increase/decrease of the periodic illumination, described by Eqs (21)/(23).

Figure 6
figure 6

Phase variations incurred by the sample result in changes to the sinusoidal illumination in a number of ways, shown here (left to right) for a linear projected phase (Fig. 5a), which shifts the illumination transversely, a quadratic projected phase (Fig. 5b), which focuses the illumination, locally increasing the mean intensity and a phase edge, which introduces an additional bright/dark variation to the illumination.

To examine measurements at a given detector position, we can take the x-ray Fokker–Planck equation (Eq. (2)) with the finite-difference approximation for propagation to z = Δ (functional dependencies, where obvious, have been dropped for simplicity and clarity),

$$I(x,z=\Delta )\approx I(x,z=0)+\Delta (-\frac{1}{k}\frac{{\rm{\partial }}}{{\rm{\partial }}x}(I\frac{{\rm{\partial }}\varphi }{{\rm{\partial }}x})+\frac{{{\rm{\partial }}}^{2}}{{\rm{\partial }}{x}^{2}}(DI)).$$
(6)

In the following sections we will consider how these two steps (Eqs (5) and (6)) can be applied to the dark-field/diffusion term and the phase/drift term to show how the Fokker–Planck equation is relevant to grating-based x-ray imaging and to understand how spatial variations in the phase and dark-field may introduce signal variations that could be ‘falsely’ interpreted as attenuation, phase or dark-field signals. The Supplementary material includes python code for interactive visualisation of the less-intuitive mathematical expressions below, which can be used to more intuitively understand the effects described herein.

Dark-field/Scattering effects

We look first at an object with scattering properties, but no phase-shifting properties (\(\partial \varphi /\partial x=0\)), which will leave only the second term on the right side of the x-ray Fokker–Planck equation (Eq. (2)). We can insert the sinusoidal illumination I(x, z) (Eq. (5)) and take the finite-difference approximation for Eq. (6) to leave,

$$I(x,z=\Delta )\approx (a\,\sin (\frac{x}{p})+b)+\Delta \frac{{{\rm{\partial }}}^{2}}{{\rm{\partial }}{x}^{2}}(D(a\,\sin (\frac{x}{p})+b)).$$
(7)

Uniform scattering

If we consider an area where the diffusion properties do not vary quickly with x (so that D can be moved outside of \(\frac{{\partial }^{2}}{\partial {x}^{2}}\)), we can easily differentiate the sinusoid twice with respect to x, and are left with

$$I(x,z=\Delta )=(1-\frac{D\Delta }{{p}^{2}})a\,\sin (\frac{x}{p})+b.$$
(8)

Equation (8) describes a decrease in the amplitude of the sinusoid, and hence the visibility of the sinusoid, as seen in Fig. 3a, which is indeed the signal which is collected in dark-field imaging. A more significant effect will be seen for a larger diffusion coefficient D, larger propagation distance Δ or a smaller grid period p, as expected.

Evaluating a direct solution like this can encounter problems if the amplitude of the sinusoidal illumination becomes negative. The problem arises because a linear approximation has been made with propagation distance Δ (Eq. (6)), and the linearisation eventually reaches zero and then becomes negative. Equation (8) will therefore be valid only when \(D\Delta < {p}^{2}\). The case when the intensity sinusoid will reach an amplitude of zero is at \(D\Delta /{p}^{2}=1\), when the dark-field blurring is over a length scale at the detector L that is equal to the period of the sinusoid p. This naturally provides a definition for the ‘blur width’ L, \(L=\sqrt{D\Delta }\), matching the definition found in the companion paper24. Note that if we incorporate \(D(z)={D}_{0}\Delta \), then \(L=\sqrt{{D}_{0}}\Delta \).

To avoid the limited applicability in any numerical simulations, an alternative solution to the diffusion equation is via a linear integral transform (which can loosely be considered as convolution with a position-dependent point spread function, where the point spread function in our case is a Gaussian where the standard deviation grows with \(\sqrt{D\Delta }\))

$$I(z=\Delta )={\int }_{-{\rm{\infty }}}^{{\rm{\infty }}}I({x}^{{\rm{^{\prime} }}},z=0)\frac{{e}^{-\frac{{(x-{x}^{{\rm{^{\prime} }}})}^{2}}{2D({x}^{{\rm{^{\prime} }}})\Delta }}}{\sqrt{2\pi D({x}^{{\rm{^{\prime} }}})\Delta }}d{x}^{{\rm{^{\prime} }}}.$$
(9)

For sinusoidal illumination, this gives,

$$I(z=\Delta )=a{e}^{-\frac{D\Delta }{2{p}^{2}}}\,\sin (\frac{x}{p})+b.$$
(10)

Note the standard deviation of \(\sqrt{D\Delta }\) used in Eq. (9) could be scaled with a factor of \(\sqrt{2}\) to better match the blurring width used in the finite-difference approximation so that Eqs (8) and (10) match at low propagation distance z = Δ, but the approach here is sufficient for the order of magnitude effects in modelling the diffusive behaviour.

Scattering edge effects

If the diffusion property D does change quickly with x, such that D cannot be moved outside \(\frac{{\partial }^{2}}{\partial {x}^{2}}\) in Eq. (7), then we start to see more interesting behaviour. This case is most likely to correspond to an edge of a strongly-scattering region. We can expand the brackets from Eq. (7) to get

$$I(x,z=\Delta )=a\,\sin (\frac{x}{p})+b+\Delta [\frac{{{\rm{\partial }}}^{2}D}{{\rm{\partial }}{x}^{2}}(a\,\sin (\frac{x}{p})+b)-\frac{D}{{p}^{2}}a\,\sin (\frac{x}{p})+\frac{2}{p}\frac{{\rm{\partial }}D}{{\rm{\partial }}x}a\,\cos (\frac{x}{p})].$$
(11)

We can better understand the effects by using a trigonometric identity to express Eq. (11) as a single sinusoid (i.e. \(A\,\sin (x)+B\,\cos (x)=\sqrt{{A}^{2}+{B}^{2}}\,\sin (x+\arctan (B/A))\), noting that here we also take a small angle approximation for arctan):

$$I(x,z=\Delta )=a\sqrt{{(1+\Delta {\textstyle \tfrac{{{\rm{\partial }}}^{2}D}{{\rm{\partial }}{x}^{2}}}-{\textstyle \tfrac{D\Delta }{{p}^{2}}})}^{2}+{({\textstyle \tfrac{2\Delta }{p}}{\textstyle \tfrac{{\rm{\partial }}D}{{\rm{\partial }}x}})}^{2}}\,\sin ({\textstyle \tfrac{x}{p}}+\frac{2\Delta p{\textstyle \tfrac{{\rm{\partial }}D}{{\rm{\partial }}x}}}{{p}^{2}+\Delta {p}^{2}{\textstyle \tfrac{{{\rm{\partial }}}^{2}D}{{\rm{\partial }}{x}^{2}}}-D\Delta })+b(1+\Delta {\textstyle \tfrac{{{\rm{\partial }}}^{2}D}{{\rm{\partial }}{x}^{2}}}).$$
(12)

This is the diffusion effect we saw in Eq. (8), with some additional effects near an edge, where \(\frac{{\partial }^{2}D}{\partial {x}^{2}}\) is significant, as shown in Fig. 3b. In any edge regions, we see that the amplitude of oscillations in the periodic illumination can now be increased or decreased and that the local mean intensity (b) can be increased or decreased, since it is multiplied by \((1+\Delta \frac{{\partial }^{2}D}{\partial {x}^{2}})\). Because the local first and second spatial derivatives can change quickly (e.g. on the edge of a scattering object), this is a local effect that can result in an illumination that is no longer well-described by a simple sinusoid.

This can be explored further by looking at two neighbouring regions with differing scattering properties, setting

$$D(x)=(({D}_{right}-{D}_{left})/2){\rm{Erf}}[x]+(({D}_{right}+{D}_{left})/2)$$
(13)

so that \(D={D}_{right}\) far to the right of the origin, and \(D={D}_{left}\) to the left of the origin, with some smooth transition between, described by the Erf function (i.e. the special function known as the ‘error function’).

This gives:

$$\begin{array}{ccc}I(x,z=\Delta ) & = & a\sqrt{{(1-{\textstyle \tfrac{\Delta ({\textstyle \tfrac{1}{2}}{\rm{E}}{\rm{r}}{\rm{f}}(x)({D}_{right}-{D}_{left})+{\textstyle \tfrac{{D}_{left}+{D}_{right}}{2}})}{{p}^{2}}}-{\textstyle \tfrac{\Delta (2{e}^{-{x}^{2}}x({D}_{right}-{D}_{left}))}{\sqrt{\pi }}})}^{2}+{({\textstyle \tfrac{\Delta ({e}^{-{x}^{2}}({D}_{right}-{D}_{left}))}{\sqrt{\pi }p}})}^{2}}\\ & & \times \sin (\frac{x}{p}-{\textstyle \tfrac{\Delta p({e}^{-{x}^{2}}({D}_{right}-{D}_{left}))}{\sqrt{\pi }(-\varDelta ({\textstyle \tfrac{1}{2}}{\rm{E}}{\rm{r}}{\rm{f}}(x)({D}_{right}-{D}_{left})+{\textstyle \tfrac{{D}_{left}+{D}_{right}}{2}})-{\textstyle \tfrac{\Delta p(2{e}^{-{x}^{2}}x({D}_{right}-{D}_{left}))}{\sqrt{\pi }}}+{p}^{2})}})\\ & & +b(1-{\textstyle \tfrac{\Delta (2{e}^{-{x}^{2}}x({D}_{right}-{D}_{left}))}{\sqrt{\pi }}}).\end{array}$$
(14)

As mentioned earliar, the applicability of a solution found using a Taylor Series (Eq. (6)) is limited to the case where the area of diffusion is smaller than the period of the illumination pattern. Using the alternative approach given in Eq. (9), we can evaluate first the diffusion on the left of the origin, and then the diffusion effect on the right, with the intensity given by Eq. (5) (\(I({x}^{{\rm{^{\prime} }}})=a\sin (\frac{{x}^{{\rm{^{\prime} }}}}{p})+b\)):

$$I(z=\Delta )={\int }_{-{\rm{\infty }}}^{0}(a\sin (\frac{{x}^{{\rm{^{\prime} }}}}{p})+b)\frac{{e}^{-\frac{{(x-{x}^{{\rm{^{\prime} }}})}^{2}}{2{D}_{left}\Delta }}}{\sqrt{2\pi {D}_{left}\Delta }}d{x}^{{\rm{^{\prime} }}}+{\int }_{0}^{{\rm{\infty }}}(a\sin (\frac{{x}^{{\rm{^{\prime} }}}}{p})+b)\frac{{e}^{-\frac{{(x-{x}^{{\rm{^{\prime} }}})}^{2}}{2{D}_{right}\Delta }}}{\sqrt{2\pi {D}_{right}\Delta }}d{x}^{{\rm{^{\prime} }}}.$$
(15)

This evaluates to:

$$\begin{array}{ccc}I(z=\Delta ) & = & {\textstyle \tfrac{ia}{4}}{{\rm{e}}}^{-\frac{2ipx+({D}_{left}+{D}_{right})\Delta }{2{p}^{2}}}[-{{\rm{e}}}^{\frac{{D}_{left}\Delta }{2{p}^{2}}}(-1-{\rm{E}}{\rm{r}}{\rm{f}}(\frac{px-i{D}_{right}\Delta }{p\sqrt{2{D}_{right}\Delta }})+{{\rm{e}}}^{\frac{2ix}{p}}(1+{\rm{E}}{\rm{r}}{\rm{f}}(\frac{px+i{D}_{right}\Delta }{p\sqrt{2{D}_{right}\Delta }})))\\ & & +{{\rm{e}}}^{\frac{{D}_{right}\varDelta }{2{p}^{2}}}(1-{\rm{E}}{\rm{r}}{\rm{f}}(\frac{px-i{D}_{left}\Delta }{p\sqrt{2{D}_{left}\Delta }})-{{\rm{e}}}^{\frac{2ix}{p}}(1-{\rm{E}}{\rm{r}}{\rm{f}}(\frac{px+i{D}_{left}\Delta }{p\sqrt{2{D}_{left}\Delta }})))]\\ & & +2b{{\rm{e}}}^{\frac{2ipx+({D}_{left}+{D}_{right})\Delta }{2{p}^{2}}}(2-{\rm{E}}{\rm{r}}{\rm{f}}(\frac{x}{\sqrt{2{D}_{left}\Delta }})+{\rm{E}}{\rm{r}}{\rm{f}}(\frac{x}{\sqrt{2{D}_{right}\Delta }})).\end{array}$$
(16)

Equation (16) can correctly describe effects seen at an edge without the problems associated with the potential for a ‘negative’ sinusoidal solution given in Eq. (14). This means that the diffusion effect can be modelled when it extends over several periods of the illumination. Several cases are shown in Fig. 4b, varying the illumination period \(p\) only, and these cases help to develop an understanding for the ‘diffusion edge effect’. The python code in the Supplementary Material implements Eq. (16), providing a GUI to explore this effect. These results indicate that the strongest effect is the variations in the mean value (the last term in Eq. (14)), resulting in a signal, shaped like the second derivative of the diffusion coefficient, that sits ‘on top’ of the sinusoidal illumination. This origin of this intensity variation can be described by considering the areas where ‘additional scattered light’ and ‘less scattered light’ are observed, as shown in Fig. 4 and described in the caption.

Note, however, that with this solution (Eq. (16)) the dark-field signal (Dleft, Dright) cannot be set to zero as this will cause problems associated with dividing by zero, but can be set to a very small number when required.

Modelling scattering using a dark-field coefficient

It is of interest to have a way to characterise the diffusion characteristic that is consistent with the Fokker–Planck model. To reach this, we can look at the original differential equation (Eq. (2)) without phase effects, φ = 0. This gives the diffusion equation:

$$\frac{\partial }{\partial z}I=\frac{{\partial }^{2}}{\partial {x}^{2}}(DI).$$
(17)

If we have any periodic illumination (Eq. (5)), and we consider an area over which the diffusion/scattering is not changing significantly with x (so that D can be moved outside of \(\frac{{\partial }^{2}}{\partial {x}^{2}}\)), then Eq. (17) must satisfy:

$$\frac{\partial }{\partial z}I=-\,\frac{D}{{p}^{2}}I.$$
(18)

This differential equation can be solved as

$$I(x,z)=I(x,z=0){e}^{-\frac{Dz}{{p}^{2}}},$$
(19)

which agrees with the ‘linear dark-field co-efficient’ of \(D/{p}^{2}\) seen in Lynch et al.33, and used in dark-field computed tomography34.

Phase effects

Looking at a sample with phase properties, φ ≠ 0, independently of dark-field effects (setting D = 0), from Eq. (2), we can approximate the intensity observed at distance z = Δ by the finite-difference approximation (Eq. (6)), insert sinusoidal illumination (Eq. (5)) and evaluate the derivative with respect to x to give

$$I(x,z=\Delta )=a\sin (\frac{x}{p})+b-\frac{\Delta }{k}[(a\sin (\frac{x}{p})+b)\frac{{{\rm{\partial }}}^{2}\varphi }{{\rm{\partial }}{x}^{2}}+\frac{1}{p}a\cos (\frac{x}{p})\frac{{\rm{\partial }}\varphi }{{\rm{\partial }}x}].$$
(20)

Using the trigonometric identity for the addition of two sinusoidal signals of the same argument (provided immediately before Eq. (12)), and leaving out terms of higher order Δ (since we linearised with Δ in Eq. (6)), Eq. (20) simplifies to:

$$I(x,z=\Delta )=(1-\frac{\Delta }{k}\frac{{{\rm{\partial }}}^{2}\varphi }{{\rm{\partial }}{x}^{2}})[a\sin (\frac{x}{p}-{\tan }^{-1}(\frac{\frac{{\rm{\partial }}\varphi }{{\rm{\partial }}x}}{p(\frac{k}{\Delta }-\frac{{{\rm{\partial }}}^{2}\varphi }{{\rm{\partial }}{x}^{2}})}))+b].$$
(21)

Prism effect, seen for uniform phase gradient \(\frac{\partial \varphi }{\partial x}\)

If we are in the slowly-changing bulk of the sample, where \(\frac{\partial \varphi }{\partial x}\) is significant, but \(\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}\) is small and can be neglected, Eq. (21) simplifies to:

$$I(x,z=\Delta )=a\,\sin (\frac{x}{p}-{\tan }^{-1}(\frac{\Delta }{pk}\frac{{\rm{\partial }}\varphi }{{\rm{\partial }}x}))+b.$$
(22)

This means that if the phase shift is linear (so \(\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}\) is zero), then we see only the prism effect, where the grid pattern shifts transversely. The shift in the relative position is what we would expect (see Morgan et al.13), namely \(\frac{\Delta }{k}\frac{\partial \varphi }{\partial x}\)), and there is no change in the mean or visibility of the signal. This is the ‘well-behaved’ case, where phase effects are not introducing any signals that look like attenuation or dark-field.

Focusing effect, seen for \(\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}\ne 0\)

If the phase gradient is not uniform, and varies with position x, then we will have more interesting effects. We can consider each of the terms in Eq. (21) to understand the physical meaning. With soft x-rays and a propagation distance in the near field, \(\frac{\Delta }{k}\) will be very small (e.g. \({10}^{-11}\)). If the second phase derivative is large, i.e. approaching the order of \(\frac{k}{\Delta }\), then the multiplicative term at the front of the sinusoid in Eq. (21) can be slightly bigger or smaller than 1, describing either some amplification or deamplification of the entire illumination. Whether amplification or deamplification is seen will depend on the sign of the second derivative of the phase, which describes either defocusing or focusing of the illumination. We also see that if the second phase derivative approaches the order of \(\frac{k}{\Delta }\), then the denominator inside the tan−1 in Eq. (21) will become slightly bigger or smaller than \(\frac{k}{\Delta }\), describing either a squeezing or a spreading out of the intensity peaks, matching with the defocusing/focusing behaviour.

To untangle the effect of phase gradients on the period of the illumination, from the effects of phase gradients on the shift of the illumination (i.e. the x-dependent terms within the sinusoid), we can model the case of some ‘phase curvature’ using a Taylor polynomial of order two, \(\varphi =A{x}^{2}+Bx+C\), so that \(\frac{\partial \varphi }{\partial x}=2Ax+B\) and \(\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}=2A\). The values for A, B and C could be chosen to describe the phase gradient and curvature of any local area of the sample. With this phase, Eq. (21) becomes:

$$I(x,z=\Delta )=(1-{\textstyle \tfrac{2A\Delta }{k}})[a\,\sin (\frac{1}{p}(x-{\tan }^{-1}({\textstyle \tfrac{2Ax+B}{p({\textstyle \tfrac{k}{\Delta }}-2A)}})))+b]\approx (1-{\textstyle \tfrac{2A\Delta }{k}})[a\,\sin ({\textstyle \tfrac{x}{p}}(1-{\textstyle \tfrac{2A\Delta /k}{1-2A\Delta /k}})+{\textstyle \tfrac{B\Delta }{pk(1-2A\Delta /k)}})+b],$$
(23)

with the simplification taken for small shifts in phase of the sinusoid, so that tan(x) ≈ x.

We see that a linear change in phase (modelled by A = 0, B ≠ 0) will shift the relative position of the peaks of the periodic illumination by \(\frac{B\Delta }{k}\), acting as a prism without changing the period of the illumination, as seen in Eq. (22), and on the left third of Fig. 6.

If the phase shift incurred by the sample is not just linear, but there is such curvature that a quadratic term is required to adequately describe the local phase, then we will see additional effects. This case corresponds to when A is significant, approaching \(\frac{k}{2\Delta }\), so that the term \(1-\frac{2A\Delta }{k}\) moves away from 1. Since this term appears in three places, a large A will (1) change the mean illumination, (2) alter the period and (3) introduce an additional shift in the position of the periodic illumination. If the phase curvature is positive (seen for A > 0 in our quadratic model) then the beamlets will spread out, seen by a decreased mean illumination and a period that is multiplied by a number slightly greater than 1 and so locally increased. The shift in the position of the illumination will also be slightly reduced towards the centre of the focus. If the phase curvature is negative (A < 0), the illumination will be focused, increasing the mean intensity and decreasing the period of the periodic illumination, as shown in Fig. 6. These observations are consistent with preservation of photons. While this kind of focusing will not introduce any visibility changes when the grid pattern is directly resolved, it can change the visibility measured in grating interferometry (e.g. Fig. 1 in35).

Phase edge, seen for \(\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}\ne 0\)

A phase edge is also an interesting feature to study, particularly given the bright/dark contrast seen in propagation-based phase contrast imaging when a wave passes across an edge and self-interferes. If we model a phase edge in the same way as Eq. (13) models a scattering edge (replacing D with φ) and use this model in our expression for phase effects, Eq. (21), we get

$$I(x,z=\Delta )=(\frac{\Delta (2{e}^{-{x}^{2}}x({\varphi }_{right}-{\varphi }_{left}))}{\sqrt{\pi }k}+1)(a\,\sin (\frac{x}{p}-{\tan }^{-1}(\frac{{e}^{-{x}^{2}}({\varphi }_{right}-{\varphi }_{left})}{p\sqrt{\pi }(\frac{k}{\Delta }+\frac{2{e}^{-{x}^{2}}x({\varphi }_{right}-{\varphi }_{left})}{\sqrt{\pi }})}))+b).$$
(24)

When plotted, as expected, a bright/dark contrast fringe overlies the illumination, in a similar manner to the dark-field edge. The python code in the Supplementary Material implements Eq. (24), providing a GUI to explore this effect. This can result in local changes to the visibility, as seen in Fig. 6.

Combined effects

While the phase effects and dark-field effects are most easily understood in the previous two sections, where each is isolated, we can also write an equation to describe the combined effects. Since the shifting and diffusive terms in the finite-difference approximation for the Fokker–Planck equation (Eq. (6)) add together, we can describe the resulting intensity as the sum of Eqs (12) and (21), subtracting the illuminating intensity (Eq. (5)) since it is in both equations and hence repeated. This gives:

$$\begin{array}{ccc}I(x,z=\Delta ) & = & a\sqrt{{(1+\Delta {\textstyle \tfrac{{{\rm{\partial }}}^{2}D}{{\rm{\partial }}{x}^{2}}}-{\textstyle \tfrac{D\Delta }{{p}^{2}}})}^{2}+{({\textstyle \tfrac{\Delta }{p}}{\textstyle \tfrac{{\rm{\partial }}D}{{\rm{\partial }}x}})}^{2}}\,\sin ({\textstyle \tfrac{x}{p}}-\frac{\Delta p{\textstyle \tfrac{{\rm{\partial }}D}{{\rm{\partial }}x}}}{{p}^{2}+\Delta p{\textstyle \tfrac{{{\rm{\partial }}}^{2}D}{{\rm{\partial }}{x}^{2}}}-D\Delta })+b(1+\Delta {\textstyle \tfrac{{{\rm{\partial }}}^{2}D}{{\rm{\partial }}{x}^{2}}})\\ & & +(1-{\textstyle \tfrac{\Delta }{k}}{\textstyle \tfrac{{{\rm{\partial }}}^{2}\varphi }{{\rm{\partial }}{x}^{2}}})[a\,\sin ({\textstyle \tfrac{x}{p}}-{\tan }^{-1}(\frac{{\textstyle \tfrac{{\rm{\partial }}\varphi }{{\rm{\partial }}x}}}{p({\textstyle \tfrac{k}{\Delta }}-{\textstyle \tfrac{{{\rm{\partial }}}^{2}\varphi }{{\rm{\partial }}{x}^{2}}})}))+b]\\ & & -(a\,\sin ({\textstyle \tfrac{x}{p}})+b).\end{array}$$
(25)

Extension of the Fokker–Planck model to Grating Interferometry and Edge Illumination

The results presented in the preceding sections can be extended to include the effect of an analyser grating or detector mask, as would be used in a grating interferometer or edge illumination set-up respectively. The use of a second grating/mask has the advantage that larger pixels can be used, which is typically more efficient and allows the imaging of larger samples than imaging where the illumination pattern is directly resolved. To incorporate the second grating/mask, we can simulate a periodic absorption immediately before the detector to ‘analyse’ the illumination we have studied so far.

Here we show the implementation of this, using a general signal that describes any of the cases we have explored (Eqs (2224) etc.), where the sinusoidal illumination arriving at the periodic absorber has been modified by a factor of M in mean value, a factor of V in visibility, and has been shifted by s, so can be described as

$$I(x,z=\Delta )=MV\,\sin (\frac{2\pi (x-s)}{p})+M.$$
(26)

Note that we neglect a local change in period here, due to the increased complexity, but the same approach can be applied to study this effect. Also note that we have explicitly included a factor of 2π inside the sinusoid in Eq. 26 that is not included earlier, so that it is possible to integrate the unresolved intensity oscillations over the period of that intensity oscillation, which will now correspond exactly to p. We can model the absorption by the analyser grating or detector mask by multiplying the illumination (Eq. (26)) by a sinusoid that spatially oscillates between 0 (total absorption) and 1 (total transmission) (i.e. \(\frac{1}{2}\,\sin (\frac{2\pi (n-x)}{p})+\frac{1}{2}\)).

Grating interferometry

In grating interferometry, the intensity is recorded during a ‘stepping scan’, where an absorption grating steps transversely across the illumination. This can be implemented by convolving the ‘absorption’ sinusoid with the modified illumination sinusoid (Eq. (26)) over the period of the illumination, p, providing the infinitely sampled measured stepping curve as a function of absorption grating position n (which should be sampled from n = 0 to n = p),

$${\rm{S}}{\rm{t}}{\rm{e}}{\rm{p}}{\rm{p}}{\rm{i}}{\rm{n}}{\rm{g}}\,{\rm{c}}{\rm{u}}{\rm{r}}{\rm{v}}{\rm{e}}\,(n)={\int }_{0}^{p}(\frac{1}{2}\,\sin (\frac{2\pi (n-x)}{p})+\frac{1}{2})(MV\,\sin (\frac{2\pi (x-s)}{p})+M)dx$$
(27)
$$=\,\frac{p}{4}MV\,\cos (\frac{2\pi (n-s)}{p})+\frac{p}{2}M.$$
(28)

This stepping curve has a mean value of Mp/2, a visibility of V/2 and is shifted by s. This means that the results shown above for a directly-resolved grid can also be applied in the case of an interferometer with just a simple multiplicative scaling of p/2 for the mean (attenuation), 1/2 for the visibility (dark-field) and no adjustment for the shift.

Note that if the period of oscillations is locally varying (seen when \(\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}\ne 0\)), we would need to scale the period p by a factor of f in the general expression for a modified sinusoid, Eq. (26). Carrying this into Eq. (27) produces a non-trivial solution that depends on the nature of \(\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}\), in a similar way to the results seen in earlier sections, where we had to consider specific cases of \(\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}\). Including spatial variations in illumination period would be important when considering how a strong phase object measured using interferometry may produce a ‘pseudo’ dark-field (e.g. Fig. 1 in35).

Edge illumination

Edge illumination imaging has several variants, for example, depending on whether there is strong scattering expected from the sample11,17. With the aim only to illustrate the applicability of the Fokker–Planck approach, here we will consider just the simple case where scattering is weak. In this case, the absorption grating / detector mask, which has a period matching the illumination period, should be aligned so that the peak of the sinusoidal illumination first coincides with the left edge of the each absorption line (exposure 1, Ileft), then coincides with the right edge of the absorption line (exposure 2, Iright),

$$\begin{array}{ccc}{I}_{left} & = & {\int }_{0}^{p}(\frac{1}{2}\,\cos (\frac{2\pi x}{p})+\frac{1}{2})(MV\,\sin (\frac{2\pi (x-s)}{p})+M)dx\\ & = & -\frac{1}{4}MpV\,\sin (\frac{2\pi s}{p})+\frac{Mp}{2}\end{array}$$
(29)
$$\begin{array}{ccc}{I}_{right} & = & {\int }_{0}^{p}(-\frac{1}{2}\,\cos (\frac{2\pi x}{p})+\frac{1}{2})(MV\,\sin (\frac{2\pi (x-s)}{p})+M)dx\\ & = & \frac{1}{4}MpV\,\sin (\frac{2\pi s}{p})+\frac{Mp}{2}.\end{array}$$
(30)

The shift (s) and attenuation (M) signals could then be extracted by adding and subtracting Eqs (29) and (30), giving consistent results as in the scenario described above for grating interferometry.

Following these demonstrations of applicability, we leave further applications of the Fokker–Planck equation to grating interferometry and edge illumination to future work. Possibilities include integrating over a non-integer number of grating lines and investigating the effects of a locally-modified period.

Discussion

This work serves as a starting point for future applications of the Fokker–Planck and Kramers–Moyal equations in x-ray imaging techniques that capture phase and dark-field effects. We begin the discussion by mentioning a number of possibilities for future work. A clear next step in any grating-based or speckle-based approach is to utilise this model as a starting point for phase/dark-field retrieval, or simply as a basis for lensing and edge-based ‘corrections’ to retrieved attenuation, phase and dark-field signals (perhaps as a second or iterative step after the initial extraction of the three signals by conventional retrieval methods). As noted earlier, the Fokker–Planck model could be applied to provide an analytical model for specific cases seen in grating interferometry where phase edge19 and lensing effects (simulated and measured in Wolf et al.20) result in an illumination period that is locally-varying, leading to a spatially-varying ‘mis-match’ between that illumination and the second/analyser grating35.

Corrections for dark-field-edge, phase-edge and lensing effects are particularly of interest when the size of the features within the sample are comparable to the period of the illumination, and the effects are typically more dominant. The Fokker–Planck model described in this paper could better shed light on the transition between two regimes, the regime where sample features are large enough to create a spatially-resolved phase signal (e.g. see differential phase images of individual air sacs in the lung in Morgan et al.36 or high-resolution lung CT in Fig. 5 of Koenig et al.35) and the regime where sample features are not spatially resolved and are instead seen as a dark-field signal (e.g. see dark-field images of the lungs37 or Fig. 2 of 35). The Fokker–Planck model naturally lends itself to a parameter-based definition for these regimes, differentiating between edge effects and bulk effects, as determined by the spatial resolution of the imaging set-up and the illumination period. This direction of future work also lends itself to an investigation into the optimum illumination pattern period to be sensitive to a given dark-field signal for a given wavelength with a given imaging set-up. This links to the correlation length, λΔ/p seen in grating interferometry38, which matches the expression seen when the ‘smear width’ L is set to the illumination period p, zeroing the visibility of the resulting illumination at the detector (also see Fig. 3c of the companion paper on the X-ray Fokker–Planck equation24).

There are also natural extensions to the Fokker–Planck model. The first extension would be to describe more detailed39 and size-related33,40 scattering functions. A dark-field signal from a non-uniform collection of overlaid and unresolved sample features could be modelled by the addition of extra diffusive terms (\({\partial }^{2}({D}_{m}I)/\partial {x}^{2}\), each with a different Dm) to the Fokker–Planck equation (Eq. (2)). Since the diffusion equation is energy-conserving, the addition of these terms would require no other adjustments. A dark-field signal from a collection of extended unresolved sample features (e.g. carbon fibres41,42 or bone microstructure31,43) could be modelled by a two-dimensional Fokker–Planck equation (a truncation of the Kramers–Moyal equation), which provides three parameters to describe the two-dimensional scattering ellipse utilised in directional dark-field imaging44 (which is sometimes modelled as scattering that oscillates in magnitude sinusoidally with angle31,45).

The Fokker–Planck model shown here could be extended to incorporate real-world effects seen at synchrotron and laboratory x-ray sources, including limited spatial resolution, extended sources, polychromatic illumination and magnification. The spatial resolution limit due to the detector characteristics, including pixel size, could be modelled by convolving the general expressions derived above (e.g. Eq. (25)) with a Gaussian of specified width. The spatial resolution associated with an x-ray imaging system will also be limited by the size of the x-ray source, with an extended source ‘blurring’ the observed image. In the Fokker–Planck model, an extended source could be modelled by summing the images created by an array of many point sources, produced by shifting the intensity measured at z = Δ slightly in order to model the grid projection seen from each point on the source. An alternative would be to replace D(x, y) with D(x, y) + d (or equivalently, add another diffusion term), where d models the extra blur that results from source-size blurring (see p. 14 of Paganin & Morgan24). The effect of an extended source is also of particular relevance in the measured x-ray dark-field signal35. In the direction of less blurring, a more finely-resolved structured illumination behind a rectangular (or some other-shaped46) grid could be modelled using a Fourier sum of the sinusoidal illumination model utilised in this paper.

Any x-ray source that is not a synchrotron will typically produce illumination that is sufficiently polychromatic and divergent that the associated effects must be included in modelling. A divergent source could be modelled according to the Fresnel scaling theorem47, by setting the propagation distance z to z/M, where M is the magnification, while adjusting the native pixel size accordingly. This is also key in x-ray dark-field imaging by interferometry48 [Section 4 of 35]. An image captured with polychromatic illumination could be modelled as the weighted sum of the images seen at each wavelength within the illuminating spectrum49. This can be implemented by integrating the Fokker–Planck equation (Eq. (6)) over wavelength, after multiplying Eq. (6) with a wavelength-dependent weighting factor that describes the x-ray spectrum and which could also incorporate detector sensitivity.

A sum of many slightly-different images into a single exposure can be used to describe a reduction in fringe or patterned illumination visibility for a number of cases. In addition to the cases of an extended source and a polychromatic source, reduced visibility is seen when using a diffuser. A diffuser is typically a sheet of highly-scattering material, like sandpaper, which is placed in the x-ray beam upstream of the sample and rotated at high speed, such that many positions are summed over the time of a typical x-ray exposure. This will reduce the visibility of propagation-based x-ray phase contrast fringes, as each diffuser position slightly distorts the fringes, and the sum over all diffuser positions results in a fringe that is ‘blurred’50. A diffuser will not change the spatially coherent width/area, but will reduce the magnitude of the second order degree of coherence51. In x-ray SAXS, the wavefield is locally distorted by scattering from sub-pixel structures in the sample, locally reducing the spatially coherent width/area, and resulting in a reduction in the visibility of fine features like the illuminating grid pattern. In the case of a diffuser, there is a temporal sum of many slightly distorted images. In the case of x-ray SAXS, there is a temporal sum of many photons, where some are slightly scattered.

Another aspect of dark-field is worth discussing. Several papers have reported on an enhancement of dark-field in the vicinity of the boundary of the geometric shadow of a paraxially-illuminated compact object19,52,53. Rather than being dark-field due solely to unresolved micro-structure, as is the case for points that lie inside the geometric shadow, the dark-field signal emanating from the edge of the object is augmented by the Young–Maggi–Rubinowicz boundary diffraction wave54. This phenomenon, whereby illuminated objects have their projected edges acting as a secondary source of (scattered) boundary waves, was first noted in a qualitative study by Young in 180255. Subsequent contributions to the underpinning wave theory are due to Maggi56, Rubinowicz57 and Miyamoto & Wolf58,59. The same phenomenon may also be understood from the perspective of complex-ray theory. This ray-based perspective underpins Keller’s geometric theory of diffraction60, in which Fresnel diffraction patterns may be understood as the interference between (i) the complex-ray disturbance transmitted by an object according to geometrical optics, and (ii) the complex-ray disturbance scattered from the edges of the object. A third means of understanding the dark-field-enhancement along the boundary of the geometric shadow of an illuminated object, is from the asymptotic expansion (short-wavelength limit) of the two-dimensional diffraction integral associated with a paraxially-illuminated compact object under the projection approximation47, obtained by applying the method of stationary phase for double integrals. Here, the boundary wave corresponds to critical points of the second kind: see e.g. Sec. 3.3.3 of the text by Mandel & Wolf30. For applications of the boundary-wave concept to coherent X-ray optics, see e.g. Morgan et al.26,61.

Conclusion

This work has shown that the Fokker–Planck equation can be applied to phase contrast and dark-field x-ray imaging captured using a single-grid set-up, a grating interferometer, an edge-illumination set-up or a speckle-based set-up. The Fokker–Planck model was applied to provide an analytic expression for the additional signals seen as a result of edges within the sample and lensing by the sample. The authors hope that this work will provide a basis for further applications of the Fokker–Planck model in x-ray phase and dark-field imaging.