Adaptive aberration correction in a confocal microscope