Traditional approaches to imaging require that an increase in depth of field is associated with a reduction in numerical aperture, and hence with a reduction in resolution and optical throughput. In their seminal work, Dowski and Cathey reported how the asymmetric point-spread function generated by a cubic-phase aberration encodes the detected image such that digital recovery can yield images with an extended depth of field without sacrificing resolution [Appl. Opt. 34, 1859(1995]. Unfortunately recovered images are generally visibly degraded by artifacts arising from subtle variations in point-spread functions with defocus. We report a technique that involves determination of the spatially variant translation of image components that accompanies defocus to enable determination of spatially variant defocus. This in turn enables recovery of artifact-free, extended depth-of-field images together with a two-dimensional defocus and range map of the imaged scene. We demonstrate the technique for high-quality macroscopic and microscopic imaging of scenes presenting an extended defocus of up to two waves, and for generation of defocus maps with an uncertainty of 0.036 waves.