Gravar-mail: A nonlinear lag correction algorithm for a-Si flat-panel x-ray detectors