1. A method of imaging an object, comprising: performing a reconstruction algorithm on phase encoded image data to obtain an image in which the effects of phase perturbation are removed, wherein performing comprises: estimating a degree of defocus in the obtained image; adjusting the reconstruction algorithm to take account of the estimated degree of defocus; and performing the adjusted reconstruction algorithm to obtain a restored image.