Implement X-ray refraction effect in Geant4 for phase contrast imaging

X-ray phase contrast imaging (PCI) is a hot research field in the last decade. Many novel methods such as diffraction enhanced imaging, grating-based imaging et al come to the fore. The Monte Carlo simulation can simplify the phase contrast system modeling and is useful for system optimization and new method validation. In this paper, a Monte Carlo tool based Geant4 that implements the x-ray refraction effect is proposed. It adds the capability of phase contrast imaging to Geant4. The tool is validated by a simple sphere simulation. The result of the validation is in perfectly accordance with the theoretical value. The tool is also applied to model the grating-based imaging method to present the potential applications in x-ray phase contrast research.