Real-time halo correction in phase contrast imaging