The number of applications and technical implementations of X-ray phase-contrast imaging (XPCi) has continuously increased over the last two decades. As imaging detectors are insensitive to the phase of X-ray waves, various techniques were developed to transform sample-induced phase modulations into intensity modulations on the detector. For all these XPCi techniques the image formation process can be described with rigorous wave models stemming from the Maxwell’s equations, each containing suitable approximations (e.g., paraxial wave field, projection approximation) . On the other hand, when the spatial coherence of the experimental setup is limited, i.e., when the X-ray source distribution and/or the detector’s point spread function are broad, the image formation process can be effectively approximated with ray tracing/geometrical optics models . In particular, the local distortion of the X-ray wavefront due to the phase-shift induced by a sample can be described through the refraction effect governed by the Snell’s law. This approximation allows to integrate phase effects into sophisticated Monte Carlo toolkits, such as Geant4, where the interactions between radiation (including X-rays) and matter are inherently treated as a ray tracing problem . In this context, a novel Geant4 simulation tool that adds ad-hoc X-ray refraction physics processes has been implemented within a (virtual) edge illumination (EI) setup . EI is a XPCi technique widely implemented within compact laboratory-based setups where two absorbing masks featuring periodic apertures, referred to as sample and detector masks, are positioned upstream from the sample and detector, respectively. The sample mask serves to structure the incoming radiation into a series of independent beamlets. Each beamlet interacts with the sample being attenuated, refracted, and scattered, and it is subsequently analyzed by the detector mask which features the same periodicity apart from the geometry-dependent magnification factor. By acquiring two or more images at different relative positions of the two masks, attenuation, refraction and (optionally) scattering effects can be separated, yielding independent maps of different properties of the sample.
Specifically, in this study, an EI setup featuring an overall dimension of 1 m (source to sample distance 70 cm, sample to detector distance 30 cm), a polychromatic spectrum from a 40 kV tungsten anode X-ray tube, a circular focal spot of 20 µm, and a photon-counting detector with 62 µm pitch are simulated (Figure 1). These parameters mimic the ones of a new EI facility under construction at INFN laboratories in Trieste (Italy), which will make use of a spectral photon-counting detector (Pixirad1-PixieIII) to investigate novel EI imaging geometries and spectral phase-contrast applications (project PEPI – Photon-counting Edge-illumination Phase-contrast Imaging). The simulation allows the user to choose the relative displacement between the two masks (stepping) and the position of the sample with respect to the masks (dithering), closely replicating the experimental data acquisition process.
The results of the simulation (Figure 2) demonstrate that the developed tool accurately reproduces attenuation and refraction effects in an EI setup. Remarkably, the possibility of simulating phase-effects within Geant4 paves the way for the use of this tool in the optimization of XPCi setups, including many realistic details which are often difficult to account for in analytical simulations, and being appealing for other non-interferometric XPCi techniques (e.g., analyzer-based imaging). In this context, the developed simulator will be used to design the final PEPI’s experimental setup, exploring many parameters such as geometry, mask thickness, pitch and aperture, source spectrum and size, and detector response.
Figure 1 Graphical interface visualization of the simulated setup.
Figure 2 Refraction image of a PMMA wire with a diameter of 1 mm (left) and its respective profile, measured within the dashed blue rectangle, compared with the theoretical prediction (right).]
 D Paganin, Coherent X-Ray Optics, Oxford University Press, (2006).
 L Brombal et al., Phys. Rev. Applied 11, 034004 (2019).
 M Langer et al., Opt. Express 28, 14522-14535 (2020).
 A Olivo and R Speller, Phys. Med. Biol. 52, 6555 (2007).
The authors acknowledge funding from the National Institute for Nuclear Physics, National Scientific Commission 5 for Technological and Inter-disciplinary Research (project PEPI).