A general theoretical formalism for X-ray phase contrast imaging.