1. A method for layer reconstruction from dual-energy image pairs, the method comprising: receiving a pair of dual-energy images, one having a relatively high-energy dose and the other having a relatively low energy dose; computing a preliminary image of a second layer that has non-rigid motion relative to a first layer; detecting the relative motion of the second layer relative to the first layer; generating a mask in accordance with the detected motion; and inpainting the motion area.