Wavefront distortions of an optical beam are measured. The transverse optical modes of the optical beam are partitioned into a plurality of subsets of transverse optical modes, one of the subsets of transverse optical modes is selected as the current subset, and the optical beam is modulated based on the current subset by maintaining the transverse optical modes of the optical beam that are outside the current subset stable, and modulating the transverse optical modes of the optical beam within the current subset. A non-linear optical signal is generated from the modulated optical beam by directing the modulated optical beam through a non-linear optical system that includes a random scattering medium, the power of the generated non-linear optical signal is measured, and, based on the measured power, values of the spatial phase for the optical beam at transverse optical modes are extracted within the current subset.
Wavefront compensation for deep tissue optical microscopy