Optimal lens design and use in laser-scanning microscopy

: In laser-scanning microscopy often an off-the-shelf achromatic doublet is used as a scan lens which can reduce the available diffraction-limited field-of-view (FOV) by a factor of 3 and introduce chromatic aberrations that are scan angle dependent. Here we present several simple lens designs of superior quality that fully make use of high-NA low-magnification objectives, offering diffraction-limited imaging over a large FOV and wavelength range. We constructed a two-photon laser-scanning microscope with optimized custom lenses which had a near diffraction limit point-spread-function (PSF) with less than 3.6% variation over a 400 µm FOV and less than 0.5 µm lateral color between 750 and 1050 nm.


Introduction
Laser-scanning two-photon microscopy [1] has revolutionized the life sciences. It enabled the acquisition of fluorescent images from depths greater than 500 µm within light-scattering tissues [2][3][4] with an optical resolution comparable to confocal microscopy [5] due to the nonlinear process of two-photon absorption which confines the excitation volume [3]. The introduction of new laser sources with wavelengths beyond 1080 nm and high-NA lowmagnification objectives [6] pushed these limits further, achieving recently an imaging depth of 1.6 mm in the mouse cortex using an excitation wavelength of 1280 nm and a 20x 0.95 NA objective [7]. Furthermore, with low-magnification high-NA objectives dynamic cellular processes can be measured over a large area at high optical resolution.
With an ever wider wavelength range available for linear and nonlinear microscopy, spanning 400-1600 nm, and the availability of high-NA low-magnification objectives, the optical requirements on the design of intermediary scan optics are increasingly challenging. Off-the-shelf achromatic doublets are commonly used in custom-built and commercial laserscanning microscopes because they are inexpensive and widely available. However, at scan angles larger than a few degrees they perform poorly and introduce optical aberrations that exceed the diffraction limit, i.e. for a given wavelength, the aberrated wavefront has an RMS greater than 0.072 or equivalently a Strehl ratio less than 0.8 which worsens the resolution and excitation efficiency. Besides this, poor lenses introduce chromatic aberrations when used over a wide wavelength range of hundreds of nanometers, causing foci of different wavelengths to be apart several times the size of the diffraction limited focus in a manner that depends on the location of the object within the imaging field. Also, as we will show, such lenses can introduce geometric distortions that lead to an overestimate of the sample size by 3-10%. Generally, to correct such aberrations, a system of lenses would be required, but even if such lenses could be found commercially, the range of available focal lengths, usable wavelengths and quality measures is limited. This leaves end-users with the expensive and time-consuming process of buying and trying.
In this study we aim to eliminate this problem by offering a comprehensive analysis and optimization of scan and tube lenses and provide lens models that can be easily manufactured and adopted. We outline the shortcomings of commercially available achromatic doublets as scan and tube lenses and propose several lens designs of superior quality. These range from the simple-to-implement symmetric achromatic doublet arrangement, known as the Plössl eyepiece [8], to several original designs for which we used Zemax optical modeling software. Finally the newly developed lenses were tested over 750-1050 nm in a custom built twophoton laser scanning microscope using the recently developed 25x, 1.05 NA, Olympus XLPLN25xWMP objective.

Common achromatic doublets are poor scan lenses
In a laser-scanning microscope (Fig. 1), scanning is achieved by placing the rotation axis of a galvanometric mirror at the back-focal plane of a scan lens. The scan lens together with the tube lens project an enlarged image of the laser beam from the galvanometric mirror to the back-focal plane (BFP) such that the centers of the beam at both conjugate planes remain stationary while scanning the sample. A good compromise between highest NA and transmitted laser power is to provide the objective BFP with a Gaussian beam having a (1/e 2 intensity) diameter similar to the pupil size. This is usually achieved by expanding an initial beam of 3-6 mm a factor of 2.5-5x. The choice of beam size, expansion ratio and lens design will determine the level of optical aberrations introduced by the intermediary scan optics.
To study how the beam size in combination with different lens designs influences imaging performance, we considered beams of 3 mm and 6 mm Ø 1/e 2 in the context of an ideal Olympus 25x, 1.05 NA, XLPLN25xWMP objective, with a ≈15 mm Ø pupil, 7.2 mm focal length (FL) and ± 2.86° maximum scan angle at its BFP. Depending on the chosen beam size and keeping the scan lens focal lengths the same, maximum scan angles and tube lens focal lengths were chosen to cover the 720 µm Ø sample field of view (FOV) of the Olympus objective and to have a beam size at the objective BFP matching the pupil size. Starting with a 3 mm Ø 1/e 2 gaussian beam and 5x expansion ratio, a maximum scan angle of ± 14.3° is necessary before the scan lens to cover the entire 720 µm Ø FOV. At such scan angles and using a Thorlabs AC300-050-B achromatic doublet with 50 mm FL ( Fig. 2(a 1 ) and Appendix Table 1), the transmitted wavefront remains diffraction limited for less than 1/3 of the FOV at 1000 nm and is wavelength dependent (Fig. 2(a 2 )). Largely due to a curving of the image plane ( Fig. 2(a 3 )) by as much as 3.4 mm for the sagittal and 7.3 mm for the transversal components at 1000 nm, this also results in a curving of the sample image of 2.8 µm and 6 µm at the maximum scan angle when using a 250 mm FL tube lens. Fig. 1. Ideal layout of a 1D laser scanning microscope. Scanning is achieved by placing the scan mirror's rotation axis at the focal plane of the scan lens. The scan lens together with the tube lens form an afocal telescope system that projects an expanded image of the laser beam from the galvanometric mirror onto the objective pupil (or back-focal plane) that only pivots within the objective pupil without any lateral shift. As the focused spot moves across the sample, it generates fluorescence which is collected by the objective and in the case of twophoton laser scanning microscopy, directed on to one or more detectors by a dichroic mirror placed between the tube lens and objective.
While a curved image may be still acceptable for some biological applications, sample resolution and brightness decrease due to a 3.2 µm separation between the sagittal and transversal components of the focused beam, causing astigmatism that exceeds the 1.3 µm theoretical two-photon axial point spread function (PSF) full-width at half maximum (FWHM) at 1000 nm. At larger scan angles, lateral chromatic aberrations cause foci of different wavelengths to spread apart from each other ( Fig. 2(a 4 )) and diffraction-limited multicolor imaging using wavelengths between 680 and 1300 nm is possible only up to 40% of the total FOV, and even less so over 680-1600 nm. Longitudinal chromatic focal shift is only marginally present and is less than the 1116 µm diffraction-limited range of a similar single-photon excitation beam at 1000 nm reference.
Images are acquired by raster scanning a focused beam at constant speed over the sample and the focus position is assumed to be proportional to the scan mirror angle. At small angles, this assumption holds well for an ideal lens with focal length f and focus located at tan( ) f θ × for a scan angle θ. At larger scan angles, however, f-theta lenses [9] having a focus positioned at f θ are better suited. For the achromatic doublet, at the largest scan angle, the focal position ends up closer toward the lens center by as much as 11.2% ( Fig. 2(a 5 )), overestimating the extent of the sample. Even if an ideal 250 mm FL tube lens and objective are used, poor telecentric [10] performance as a consequence of a curved image surface ( Fig.  2(a 3 )) results in a beam displacement of up to 5.4 mm at the objective BFP ( Fig. 2(a 6 )) reducing image brightness and resolution.
Imaging is improved if instead a 6 mm Ø 1/e 2 Gaussian beam is used with the same scan lens ( Fig. 2(b)). In this case, the beam is expanded 2.5x using a 125 mm FL tube lens, halving the maximum scan field angle to ± 7.15° which is required to cover the same 720 µm FOV of the Olympus 25x objective. While diffraction limited imaging is still possible up to 1/3 of the available FOV ( Fig. 2(b 2 )) and lateral color shows no improvement ( Fig. 2(b 4 )), using a 125 mm FL tube lens, the beam shift at the objective BFP is negligible at the maximum scan angle ± 7.15° ( Fig. 2(b 6 )) and f-theta error is less than 3% ( Fig. 2(b 5 )). However, by doubling the effective NA, the 700 µm axial chromatic shift at the intermediary image over 680-1600 nm will now exceed the 278 µm diffraction limited range at 1000 nm ( Fig. 2(b 3 )), which will be inconvenient for accurate multicolor applications.

Improving scan lenses: custom lens designs
To find out whether the limitations of commercial achromatic doublets are general to this lens form or if they are due to a suboptimal choice of lens shape and glass materials we used computer-aided optical modeling (Zemax, Radiant Zemax LLC) to numerically optimize different merit functions that describe the optical performance of the lens. For this, we considered multiple lens assemblies consisting of 2-4 lenses which were either air-spaced or glued, each having a certain thickness, spacing, curvature and a certain glass material out of 238 possible glasses from Schott and Ohara catalogs (see section 4.4 in Methods).
For a 3 mm beam and ± 14.3° maximum scan angle, optimal lens shape and choice of glass materials extended the usable diffraction-limited range from 1/3 to at least 1/2 of the XLPLN25xWMP FOV within 680-1600 nm (Figs. 3(a 1 )-3(a 2 ) and Appendix Table 2). At maximum scan angle, field curvature was reduced to 1.68 mm for the transversal and 1.24 mm for the sagittal components, causing a 1.4 µm and 1.0 µm field curvature at the sample. Astigmatism and lateral color are diffraction-limited over almost the entire 680-1300 nm range (Figs. 3(a 3 )-3(a 4 )) and f-theta error and lateral shift in the objective pupil have been decreased to ≈2.8% and 1.5 mm respectively (Figs. 3(a 5 )-3(a 6 )). If instead lens shape and choice of glass materials are optimized for a 6 mm beam, all measures of optical performance are further improved, with diffraction-limited performance over more than 80% of the available FOV and 680-1600 nm ( Fig. 3(b) and Appendix Table 3). Thus, the majority of achromatic doublets used in commercial and home-built microscopes are not optimized for laser scanning applications. Choosing different glass materials and lens shapes improves optical performance, especially for larger 6 mm beams.
Going beyond achromatic doublets, scan lens optical performance can be improved by considering eyepieces [11], which consist of multiple lenses. From an object located at their focal plane, eyepieces form an image at infinity, which can then be viewed by the eye. A scan lens works in a similar way, except that at the location of the eye pupil a galvanometric mirror is placed. Indeed, eyepieces have been used as scan lenses in laser-scanning microscopes [12], but their level of optical correction is sufficient only for viewing by eye and not for high-end laser scanning applications.
One such design, known as the Plössl eyepiece [8] remains popular due to its simplicity: it can be readily assembled from two identical off-the-shelf achromatic doublets placed symmetrically around a small air gap. For two-photon laser-scanning microscopy with the XLPLN25xWMP objective, a ≈50 mm effective FL Plössl scan lens can be constructed from two 100 mm FL Thorlabs AC300-100-B achromatic doublets ( Fig. 4 and Appendix Table 4). This design is an improvement over a single Thorlabs AC300-050-B achromatic doublet for all metrics reported in (Fig. 4). For a 3 mm Ø 1/e 2 gaussian beam, it provides 2/3 diffraction limited FOV between 1000 and 1600 nm ( Fig. 4(a 2 )) as well as a flatter scan field with less astigmatism: 0.12 mm curving towards and 1.8 mm away from the lens ( Fig. 4(a 3 )) for the sagittal and transversal components at ± 14.3°. Lateral color over 680-1000 nm remains diffraction-limited ( Fig. 4(a 4 )) while axial color is diffraction-limited over the entire 680-1600 nm range. Also, f-theta error ( Fig. 4(a 5 )) and lateral shift in the objective BFP are negligible ( Fig. 4(a 6 )). Over the optimized achromatic doublet from ( Fig. 3(a)) its two main advantages are a negligible f-theta error and ease of assembly from already available achromatic doublets. Using instead a 6 mm Ø 1/e 2 beam ( Fig. 4(b)), ± 7.15° maximum scan angle and an ideal 125 mm FL tube lens, the Plössl design shows greatly improved astigmatism, f-theta error and telecentricity. As for the single Thorlabs AC300-050-B achromatic doublet ( Fig.  2(b)), axial color is worse over 680-1600 nm compared to using a 3 mm beam, while lateral color is still not entirely diffraction limited. Easy to assemble, when used within 680-1300 nm, the Plössl scan lens is markedly better than a single off-the-shelf achromatic doublet but performs worse over an optimized achromatic doublet for the same 6 mm beam size ( Fig.  3(b)).
Diffraction-limited imaging over 680-1600 nm and most of the XLPLN25xWMP FOV for both 3 mm and 6 mm Ø 1/e 2 beams was achieved through optimized Plössl lens geometry and glass materials (Figs. 5(a)-5(b) and Appendix Tables 5 and 6). For the 3 mm beam, f-theta error was less than 1.7% at 1000 nm and less than 0.4% for the 6 mm beam. With identical doublets, production costs are lower, but removing this constraint, f-theta error for the 3 mm beam could be further improved to less than 0.5% ( Fig. 6 and Appendix Table 7). Thus, over 680-1600 nm a Plössl-type or a 4-element scan lens will be considerably better over an achromatic doublet for a 3 mm beam (Figs. 4(a), 5(a) and 6 compared to Figs. 2(a) and 3(a)) while for a 6 mm beam, a simpler, optimized achromatic doublet will have a comparable quality to a Plössl-type scan lens ( Fig. 3(b) compared to Fig. 5(b)).
After studying multiple lens arrangements and keeping the number of lenses to a minimum we present a ready to manufacture 50 mm FL scan lens for a 4 mm Ø 1/e 2 gaussian beam that is useful for a wide range of laser scanning microscopy applications having exceptional optical performance over 420-1600 nm ( Fig. 7(a) and Appendix Table 8). With a 190 mm FL tube lens, this would provide the 720 µm FOV of the XLPLN25xWMP objective with an essentially achromatic, telecentric and diffraction-limited beam with less than 1.1% ftheta error (Figs. 7(b)-7(f)).
Similar to scan lenses, the quality of tube lenses is also important. A common achromatic doublet, such as a Thorlabs AC-508-250-B with 250 mm FL, when used for a 15 mm Ø beam, will reduce the available diffraction-limited FOV to 1/3 and introduce chromatic aberrations ( Fig. 8(a) and Appendix Table 9). By optimizing glass material and lens shape, we achieved diffraction-limited performance over 680-1600 nm ( Fig. 8(b) and Appendix Table 10).
Finally, for applications using ultrashort laser pulses such as two-photon laser scanning microscopy, chromatic dispersion of various glass materials within the microscope can reduce the excitation efficiency through pulse broadening. For the lenses presented here and in the case of common Ti:Sapphire lasers having pulse durations in the range of 140 fs we studied the group delay dispersion (GDD) at 0° scan field and its effect on the pulse duration (Appendix Table 12). Left uncompensated, the total GDD of our custom scan lens from Fig. 6 and tube lens from Fig. 8(b) of 2986 fs 2 at 800 nm broadens negligibly an initial 140 fs gaussian pulse to 152 fs. However, adding also the considerably larger GDD of the Olympus XLPLN25xWMP objective of 5696 fs 2 , the final pulse duration increases to 222 fs, which left uncompensated, would reduce the two-photon excited fluorescence [13] approximately 1.6 fold.

High-resolution color-corrected imaging over an extended field of view
To test whether optimized scan lens and tube lens designs actually improved optical performance, the custom lenses of Fig. 6 and Fig. 8(b) were manufactured and tested in a custom two-photon laser scanning microscope ( Fig. 9) with the Olympus XLPLN25xWMP objective and two 90° off-axis parabolic mirrors that formed a 1:1 image relay between the galvanometric mirrors [14][15][16]. The relay system eliminates beam drift in the objective BFP during scanning that is otherwise present in a closely-spaced mirror configuration and, if accurately aligned, does not affect beam quality ( Fig. 10 and Appendix Table 11). Assuming an ideal objective, calculated optical performance of the entire microscope shows a flat, near achromatic and diffraction-limited imaging over 680-1600 nm and 720 µm Ø sample FOV (Figs. 11(a)-11(c)), facilitating multicolor excitation and colocalization imaging.
Using 0.175 µm Ø deep-red fluorescent microspheres (PS-Speck, Invitrogen) we measured the microscope point spread function (PSF) in the direction of both galvanometric scanners across the 720 µm FOV (Fig. 11(d)). At 750 nm two-photon excitation, in the center of the FOV, the average transversal PSF full width at half maximum for a single microsphere was measured to be 0.365 ± 0.004 µm in the direction of the 1st scan mirror axis (SM1 from Fig. 9) which is 26% larger than the 0.29 µm theoretically expected for an aberration-free PSF. However, the finite size of the beads increases the measured PSF by 4.1%, making the measured PSF in the center only 22% larger than an aberration-free PSF. At a distance of 208 µm from the center, the PSF increased by less than 3.6% which overall provides a remarkably uniform imaging performance over more than 400 µm Ø FOV while at the maximum scan field, the PSF was found to be 37% larger than in the center. Most importantly, for multicolor excitation and colocalization, lateral color was found to be less than 0.5 µm within a 480 µm Ø FOV between 750 and 1050 nm (Fig. 11(e)) and less than 0.9 µm at the maximum FOV. Lateral color was most likely introduced by the microscope objective rather than the custom intermediary scan optics (Figs. 11(c) and 11(e)).   Table 9). (b, 1) Custom-designed achromat manufactured by Sill Optics Gmbh, Germany (lens model in Appendix Table 10) with 250 mm FL and used in the present two-photon laser-scanning microscope. (2) Transmitted wavefront error. For reference, sample focus position is also shown using an ideal Olympus XLPLN25xWMP objective. (3) Field curvature for the transversal (T) and sagittal (S) beam components, longitudinal color and astigmatism. (4) Lateral color taking the one-photon 1000 nm Airy disc as reference. Fig. 9. Layout of our two-photon laser scanning microscope used to test the custom scan lens from (Fig. 6) and tube lens from (Fig. 8(b)). Two 90° off-axis parabolic mirrors PM were used as a 1:1 relay between the scan mirrors SM1 and SM2 to avoid lateral displacement of the beam during scanning within the objective BFP occurring with closely-spaced galvanometric mirrors. The scan lens SL and tube lens TL project an enlarged image of the initial beam from SM2 to the objective back-focal plane oBFP which passes through dichroic mirrors DM1 and DM2. Fig. 10. Telecentric scan engine. (a) Two Newport 50329AU 90° off-axis parabolic mirrors with parent parabola focal length f of 25.4 mm form a 1:1 relay telescope between the two galvanometric mirrors. (b) Optical layout. (c) Scan engine assembly with scan mirrors SM1 and SM2 mounted in a cooling block and on precision translation stages, 90° off-axis parabolic mirrors PM and scan lens SL. (d) Diffraction-limited wavefront of an 850 nm 3 mm Ø beam passing through the scan engine assembly was measured after SM2 in the case when both mirrors were at 0° from the optical axis, and (e) at optical scan angles of SM1 between ± 14.3°. From the raw wavefront the following components were subtracted successively: tilt (blue), focus (green), 0° and 45° astigmatism (red), 0° and 90° coma (orange). Wavefront values are given as peak-to-valley (PV) in waves. Fig. 11. High-resolution color-corrected imaging with constant PSF to within less than 3.6% width variation over more than 400 µm Ø FOV. (a) Calculated wavefront error in the objective pupil for the complete laser scanning microscope from (Fig. 9) using custom scan and tube lenses ( Fig. 6 and Fig. 8(b)) over 680-1600 nm and 720 µm FOV when using the Olympus XLPLN25xWMP objective. (b) Calculated field curvature for sagittal (S) and transversal (T) beam components, longitudinal color and astigmatism at the sample location for the complete laser-scanning microscope assuming an ideal objective. (c) Calculated lateral color at sample location assuming an ideal objective. (d) Measured transversal and longitudinal two-photon excitation PSFs along the two orthogonal directions of the scan mirrors over the whole FOV (continuous lines) of the complete two-photon laser scanning microscope using the Olympus XLPLN25xWMP objective and comparison to theoretical value (dashed lines) of an aberration-free PSF. (e) Lateral and longitudinal chromatic PSF aberration of individual microspheres measured at 750 nm, 900 nm and 1050 nm.

Discussion
The present work provides for the first time an in-depth optical analysis of scan and tube lenses and their use in laser-scanning microscopes in the context of high-NA lowmagnification type objectives. Just as important as choosing a good objective, scan lens choice has a large impact on overall imaging performance. We show how commonly used achromatic doublets perform poorly in this role, providing diffraction-limited imaging over only 1/3 of the available 720 µm FOV of an Olympus 25x 1.05 NA objective. Considerable chromatic aberrations and curving of the image surface further worsen their performance. Should common achromatic doublets still be used, a larger, 6 mm beam is preferable over a 3 mm beam, showing better telecentricity and smaller f-theta error at the smaller scan angles needed to scan the same sample area. By optimizing glass materials and lens shape, the performance of achromatic doublets was further improved for both beam sizes, and in the case of a 6 mm beam, the optimized doublet would be a suitable choice for laser scanning applications in the 680-1600 nm range.
Another approach to obtaining better scan lenses is to use readily available achromatic doublets and construct a Plössl-type eyepiece by placing the lenses symmetrically with respect to a small air gap. This provides diffraction limited imaging over 2/3 of the 720 µm available FOV, with greatly improved telecentric performance and negligible f-theta error for either a 3 mm or 6 mm initial laser beam. By optimizing glass materials and lens shape, for both beam sizes, the performance of a Plössl-type scan lens was near diffraction-limited in the 680-1600 nm range and over the entire 720 µm FOV of the Olympus 25x objective. Since the performance of an optimized achromatic doublet is comparable to an optimized Plössl-type scan lens for a 6 mm beam, in this case, the former is preferred due to its simpler design.
Most two-photon laser scanning microscopes are optimized for the Ti:Sapphire laser wavelength range of 680-1080 nm and currently there are no commercial systems that are optimized for a wide wavelength range covering 420-1600 nm. Further exploring various scan lens designs, diffraction-limited performance was extended over 420-1600 nm (Fig. 7). This would be especially advantageous where different imaging modalities such as confocal and two-photon laser scanning could be combined to use the same scan engine while differing only in their fluorescence detection method.
The custom lenses were tested within a custom-built two-photon laser-scanning microscope for which the PSF at center FOV was 22% larger than an aberration-free PSF and sufficiently close to what can be achieved in practice. With our custom scan and tube lens designs, the PSF remains nearly constant over a FOV of more than 400 µm Ø with less than 0.5 µm lateral color in the 750-1050 nm range. This will help reduce errors on measurements of for instance small neuronal structures such as dendrites and spines that have dimensions comparable to the microscope PSF.
At larger scan angles, reaching the maximum FOV, the PSF was found to increase further by 37% compared to center. Our extensive lens design and analysis of production tolerances (Appendix Fig. 12) suggests that this further increase in PSF and lateral color is due to the microscope objective which, without having access to detailed data, was thus far assumed to be ideal. Although the usable wavelength range of the objective is 680-1100 nm, its optical performance is not the same within this range and it worsens towards longer wavelengths. On the other hand, at longer wavelengths, the optical performance of our lenses actually improves, which comes in anticipation of better objectives for long-wavelength deep-tissue two-photon imaging applications. This emphasizes the importance of choosing the right objective for the intended application. In our measurements, the performance of the high-NA low-magnification Olympus 25x objective was the limiting factor. Based on our calculations (Figs. 11(a)-11(c)), we expect that with better corrected objectives, near diffraction limited performance will be possible over 720 µm Ø FOV with the custom lenses described here.
Finally, the lens designs presented in this work are fully documented and can be readily modified to suit a large number of laser-scanning applications that make use of high-NA lowmagnification objectives where both large FOV and high-resolution are necessary.

Two-photon laser-scanning microscope construction
The telecentric scan engine was assembled from two Newport 50329AU gold-coated 90° offaxis parabolic mirrors with parent parabola focal lengths of 25.4 mm (Fig. 10(a)). Recently also silver-coated parabolic mirrors (Thorlabs) have become available which would be more suitable for confocal laser-scanning applications using visible excitation wavelengths. Scanning was accomplished using two Cambridge Technology 8315K galvanometric scanning mirrors equipped with 3 mm beam aperture silver coated X-mirrors having a fused silica substrate with a λ/4 flatness. To achieve ideal placement of the galvanometric mirrors with respect to the parabolic mirrors ( Fig. 10(b)), the galvanometric mirrors were mounted on custom-made translation stages and within copper blocks that can be liquid cooled during extended scan times (Fig. 10(c)). Diffraction-limited optical performance was obtained (Figs. 10(d)-10(e)) by precise alignment of the incoming beam as well as the optical axes of the parabolic mirrors. This is crucial since any tip/tilt misalignment will cause astigmatism. The precise alignment was achieved by a single-step machining of an aluminum block using a Deckel Maho Gildemeister DMU-65 5-axis machine onto which the parabolic mirrors were mounted using precision pins.

Laser-scanning engine alignment
The direction of the excitation beam with respect to the parabolic mirrors must be fixed accurately, which was first accomplished by using two iris pinholes 23 cm apart mounted on the scan engine aluminum frame, and later, with better results, extending this distance to 50 cm using a Thorlabs cage system mounted on the second iris pinhole thread.
The first galvanometric mirror and its translation stage were initially set to their nominal position and 0° center field orientation while the second galvanometric mirror was displaced to allow the passage of the beam to the second pinhole placed behind. Because the galvanometric mirrors have a thickness of 1 mm, better alignment was achieved by considering the reflected beam's rotation axis being located on the mirror surface instead of its center. The excitation beam generated by a Chameleon Ultra II (Coherent) first passed a custom double-pass N-SF11 prism (no. 47278, Edmund Optics) pulse compressor to compensate for the pulse broadening within the microscope, after which the beam was collimated again using two Thorlabs AC254-050-B achromats. At a distance of 6.01 m from the laser exit window where the 1st galvanometric mirror was located, an approximately flat wavefront having 0.04 λ peak-to-valley (PV) (with tilt subtracted) was obtained with a 3 mm 1/e 2 Ø at 750 nm.
The beam reaching the microscope scan engine was centered on two alignment iris pinholes to within ± 0.5 mm using two kinematic-mounted mirrors prior to the scan engine assembly after which the second galvanometric mirror and its translation stage were placed at their nominal origin. With the scan lens taken out and both mirrors set to center field, the wavefront of the beam after being reflected by the second scan mirror was initially measured to be 0.31 λ PV (tilt and defocus subtracted) using a HASO 3-32 wavefront sensor (Imagine Optic). Later this was decreased to 0.174 λ PV by a small adjustment in the direction of the incoming beam. With 0 V applied to both galvanometric scanners, their orientation in the cooling blocks was adjusted such that the laser beam was centered on the tube lens aperture, which together with the scan engine were mounted accurately on the microscope base plate. Also, the orientation of the primary excitation dichroic was adjusted at this stage to center the beam on the objective pupil.
Next, the scan lens was introduced into the scan engine frame at its nominal position and as a sign of previous correct alignment, the position of the beam on the tube lens did not shift. With 0 V applied to the first galvanometric mirror and a slow sinusoidal waveform of 3.6 V amplitude applied to the second galvanometric mirror, the scan lens position was finely adjusted until the laser beam remained stationary at the location of the objective pupil. The same procedure was repeated with 0 V applied to the second mirror and the sinusoidal waveform to the first and adjustments were made to the first translation stage until the beam remained stationary within the objective pupil for this scan direction as well, thus achieving telecentric scanning. Correct alignment was confirmed by measuring an almost constant transmitted laser power after the objective at different optical scan angles spanning the range of ± 14.3° before the scan lens that corresponds to a 720 µm FOV using the Olympus 25x, 1.05 NA, XLPLN25xWMP objective.

Point spread function measurement
The PSF of our home-built two-photon laser scanning microscope using the XLPLN25xWMP Olympus objective as well as custom scan and tube lenses ( Fig. 6 and Fig. 8(b)) was measured in the following way. A suspension of deep-red fluorescent microspheres 0.175 µm Ø (PS-Speck, Invitrogen) was diluted 1:10 with 1-propanol and left to dry evenly on a #1 coverslip (Menzel-Gläser) which was placed over a microscope slide using glycerol as mounting medium. The spherical-aberration correction collar of the water immersion XLPLN25xWMP Olympus objective was set to match the coverslip thickness. Individual microspheres were imaged with a pixel size of 0.1x0.1x0.2 µm xyz using custom LabWindows (National Instruments) laser-scanning software. Initial analysis of the PSF image stacks was done using Fiji [17] and PSF widths were estimated by fitting a 2D gaussian function using Matlab (The MathWorks Inc.) to the in-focus PSF images. While at high-NAs the linearly-polarized excitation light produced a slightly elliptical PSF in the transversal plane, for the purpose of our analysis for both theoretical and measured values the average PSF widths were taken. Theoretical two-photon PSFs were generated using FocusFields [18], PSF Lab [19] and Fiji.

Optical design and lens production
Optical design and calculations were performed using Zemax-EE (64-bit) ver. July 11, 2011 (Radiant ZEMAX LLC, Redmond, WA, USA). For convenience, optical models discussed here and detailed in Appendix Tables 1-10 can be downloaded directly from [20] or alternatively they can be made available upon request. For the analysis of the optical performance of all lenses except (Fig. 7), the distance between the image surface and the lens was optimized using a Damped Least Squares (DLS) algorithm that minimized the RMS spot radius referenced to the centroid, at 0° field and 1000 nm (TRAC operand). The distance between the stop surface at which a galvanometric mirror would be located and the first surface of each lens was optimized for telecentricity also using the DLS algorithm (RANG operand), with operands at each field having the same weight.
Beam apertures, scan lens and tube lens focal lengths and maximum scan field angles were chosen to match the 15.12 mm BFP pupil diameter of the Olympus XLPLN25xWMP objective, NA 1.05, 7.2 mm FL and 2.86° maximum scan field angle, however the present procedures can be readily extended to other objectives with a smaller pupil and scan angle, for which the optical performance of the presented lenses would be better. Optical performance was defined here to be diffraction limited if the RMS wavefront error referenced to the centroid was less than 0.072 waves (equivalently if Strehl ratio >0.8).
Custom lens design was performed using the Hammer method with DLS optimization of lens geometry and glass material which was selected from Schott and Ohara optical glass catalogs. For all custom designed lenses that have been recently designed except from Figs. 6 and 8(b) we used glasses readily available from the manufacturers having a preferred status (Ohara ver. 03-12-10 and Schott ver. 25-04-13 glass catalogs). On the other hand, for lenses from Figs. 6 and 8(b) used in the construction of our two-photon laser scanning microscope, lead-based glasses KZFS12 and KZFN5 were used which may be more difficult to obtain for future designs. In this case, they can be replaced by reoptimizing the provided Zemax models with available glasses.
Although computer-aided optimization is an indispensable tool in designing optical systems of multiple lenses, it required frequent user-interaction in balancing the multiple constraints on the merit function and rejecting unfeasible solutions that for example required too thick or too thin lenses that are impossible to manufacture. Also, the number of lenses and whether some lenses are glued together or separated by air gaps determined the success of the design. Before reaching the present designs, the aim was to minimize the number of elements used as well as the air gaps in-between. Generally, during the lens design process, at first, lens diameters were left to vary freely and when an optimal solution was found, the lens diameters were gradually increased to allow mechanical mounting and, where necessary, the model was optimized again. The overall design goal was to minimize the center thickness (MXCG operand) of lenses which had an initial upper limit between 8.5 and 15 mm that was gradually reduced while checking its effect on the merit function. Also, the minimum lens center thickness was between 2.5 and 3 mm (MNCG operand) and the minimum lens edge thickness was between 1 and 3 mm depending on the lens shape and size (MNEG operand). The effective focal length for each wavelength of custom scan lenses was set with the EFFL operand while telecentricity was set with the RANG operand with even weight at each field. Optimization of focusing performance was done using either the RMS spot radius referenced to centroid (TRAC operand) or using the RMS wavefront error (OPDX operand) without considerable difference between either method. Where necessary, f-theta calibration was included in the merit function (DISC operand).
To manufacture the custom scan lens (Fig. 6) and custom tube lens ( Fig. 8(b)), after initially reaching an optimal solution, the lens radii were fit to the closest available test plates from the manufacturer (SILL Optics Gmbh, Germany). Although we produced only one prototype of each lens, production costs were comparable to other commercial lenses and they decrease considerably if multiple lenses are produced at once. During the manufacturing process, production tolerances were analyzed and taken into account by performing a Monte Carlo analysis (Appendix Fig. 12).

Lens models
For convenience, the optical models below implemented in Zemax can be downloaded directly from [20] or alternatively they can be made available upon request.        Table 7). (b) 420-1600 nm lens model from ( Fig. 7 and Appendix Table 8). (c) 680-1600 nm custom-manufactured tube lens from ( Fig. 8(b) and Appendix Table 10).

Author contributions
H.D.M. and A.N. designed the research; A.N. performed optical design and experiments, constructed laser delivery system and microscope. A.N. and H.D.M. wrote the paper.