Automated spherical aberration correction in scanning confocal microscopy