Optical ptychography with extended depth of field