Evaluation of resonant scanning as a high-speed imaging technique for two-photon imaging of cortical vasculature

: We demonstrate a simple, low-cost two-photon microscope design with both galvo-galvo and resonant-galvo scanning capabilities. We quantify and compare the signal-to-noise ratios and imaging speeds of the galvo-galvo and resonant-galvo scanning modes when used for murine neurovascular imaging. The two scanning modes perform as expected under shot-noise limited detection and are found to achieve comparable signal-to-noise ratios. Resonant-galvo scanning is capable of reaching desired signal-to-noise ratios using less acquisition time when higher excitation power can be used. Given equal excitation power and total pixel dwell time between the two methods, galvo-galvo scanning outperforms resonant-galvo scanning in image quality when detection deviates from being shot-noise limited.


Introduction
Two-photon fluorescence microscopy (2PM) is widely used in neuroscience since it enables non-invasive in vivo imaging with submicron lateral resolution and at depths exceeding 1 mm in brain tissue [1,2]. With traditional 2PM, imaging is completed by scanning a focused, ultrafast laser beam across a sample and measuring the resulting fluorescent signal. Like other point-scanning techniques, however, the temporal resolution of traditional 2PM is limited and collection of three-dimensional volumetric images can be time consuming.
Existing video-rate point scanning techniques include the use of resonant galvanometers, acousto-optic beam deflectors (AODs), digital mirror programming arrays (DMDs), and polygon scanning mirrors [3][4][5][6]. The use of these methods requires a compromise in microscope performance in addition to an increase the cost and complexity of the system compared to scanning with slower galvanometer mirrors. Implementing AODs for 2PM requires adding and tuning extraneous components to compensate for both spatial and temporal distortions that are caused by AODs' limited diffraction efficiency and dispersive properties. Additional steps must also be taken to minimize spherical aberrations [3,4]. With DMDs, a major challenge lies in optimizing for light throughput, which is restricted by the mirror fill factor as well as diffraction and limited reflectivity from the mirrors. Tradeoffs in axial resolution, photobleaching, and dynamic range must also be juggled, and extra steps are required for characterization through testing numerous scanning and illumination patterns. [5,6]. The use of polygon scanning mirrors requires a more complex instrument design and requires the complicated, optical correction of pyramidal errors, variations in reflectivity and angle that change with the axis of rotation [4]. Several alternatives to point scanning, such as SCAPE [7,8], reverberation 2PM [9], Bessel 2PM [10], FACED [11], rescanning using a scan multiplier unit [12], and two-photon light sheet microscopy [13], have been developed to increase temporal resolution of volumetric imaging. Compared to video-rate point scanning techniques, however, these methods come with even higher material cost and complexity.
Because of these limitations, resonant scanning remains the most common method for highspeed point scanning microscopy and advances in data acquisition hardware have accelerated its adoption. Field programmable gate array (FPGA) modules and open-source software for controlling this hardware, primarily ScanImage, have simplified high speed acquisition and correction for the sinusoidal scan speed of the resonant galvanometer [14]. High speed acquisition, however, significantly decreases pixel dwell times and necessitates higher excitation powers or frame averaging to achieve image quality that is comparable to slower, non-resonant scanning.
In this paper, we present a design for a two-photon microscope that includes a resonant galvanometer and a non-resonant galvanometer pair and experimentally compare the image signal to noise for in vivo vascular imaging under both types of scanning. The design for this custom-built resonant-galvo-galvo (RGG) two-photon microscope enables seamless switching between the two scanning methods and is straightforward to implement. We compare acquisition speeds between the two scanning methods for collecting images with the same signal-to-noise ratios at up to 750 µm depths in a mouse cerebral cortex. We also examine each method's performance when imaging with identical excitation power and total sample exposure time. We demonstrate the ability to collect large field of view (FOV) images with up to fourfold speedup using resonant scanning, with image quality suitable for the processing and vectorization of the vasculature.

Two-photon microscope design
The excitation source and upright microscope used for imaging were both custom-built. The source is an ytterbium fiber amplifier seeded by a low power commercial oscillator (Origami-10, OneFive GmbH, 100 mW, 80 MHz) that is amplified by a custom fiber amplifier resulting in an output beam of 1050 nm wavelength, 120 fs pulse width, 80 MHz repetition rate, and up to 6 W of average power [15,16]. The microscope, shown in Fig. 1, consists of an 8-kHz resonant galvanometer scanning mirror (CRS 8 kHz, Cambridge Technology) conjugated to an xy-galvanometer scanning mirror pair (GVS012, Thorlabs) using two identical scan lenses (f = 50 mm, SL50-2P2, Thorlabs). The resonant scanner sits in a custom-designed, aluminum housing (Supplement 1, Code 1) [17]. To avoid image distortion during resonant scanning ( Fig. 2(c,e)), the resonant scanner is aligned using a tip, tilt, and rotation stage (TTR001, Thorlabs) to center the resonant scan along the axis of rotation of the first mirror in the galvo mirror pair and produce a square scan ( Fig. 2(d,f)). A third scan lens (f = 50 mm, SL50-2P2, Thorlabs) coupled with a Plössl tube lens (f = 200 mm, 2 x AC508-400-C, Thorlabs) expand the beam to fill the back aperture of the microscope objective (20x, 1.0 NA, XLUMPLFLN 20XW, Olympus). Heavy water was used for the immersion medium. Power is adjusted with an electro-optic modulator (EOM) before entering the microscope and did not exceed 170 mW at the sample to avoid tissue damage [18]. Fluorescence is epi-collected and passed through a 609/181 bandpass filter (FF01-609/181-25, Semrock) before reaching the photomultiplier tube (PMT, H10770PB-40, Hamamatsu Photonics). The PMT output is amplified with a variable gain transimpedance amplifier (DHPCA-100, FEMTO) before being passed through National Instruments hardware: digitizer, FPGA, and DAQ. Galvanometers, EOM, and image acquisition were controlled with ScanImage software (Vidrio Technologies) [14].
The two-photon microscope design includes a laser speckle contrast imaging (LSCI) system that shares the objective used for two-photo imaging. With this setup, widefield LSCI images of blood flow and cortical surface vasculature can be acquired prior to two-photon imaging and used to determine ideal two-photon imaging locations [19][20][21][22]. Using the LSCI image to find regions further reduces the amount of time and laser exposure needed during the two-photon imaging session. To collect the LSCI image, the cranial window is illuminated using a laser diode (λ = 820 nm). The reflected light is passed through the objective and tube lens and is redirected with a dichroic mirror (FF875-Di01-25 × 36, Semrock) through a biconvex lens (f = 100 nm) before reaching the CCD camera (acA2040-90umNIR, Basler AG).

Animal preparation
Cranial window implants were prepared in C57 mice with dura intact, as previously described [22]. During imaging, mice were anesthetized with isoflurane and body temperature was maintained at 37.5°C. Fluorescent labeling of blood plasma was completed with dextran conjugated Texas Red (70 kDa, D1830, Thermo Fisher) dissolved in saline (5% w/v), administered intravenously via retro-orbital injection (0.1 mL). All animal protocols were approved by The University of Texas at Austin Institutional Animal Care and Use Committee.

Image analysis
Images were rendered with Fiji ImageJ [23] and ParaView [24]. Quantitative image analysis was performed using MATLAB. Signal-to-noise ratios (SNRs) were determined for line profiles of 5-pixel width and 48-pixel length (approx. 7 µm x 65 µm) across representative vessels. SNR is quantified by (µ sig − µ bg ) / σ bg where µ sig is the mean signal intensity and µ bg , σ bg are the mean and standard deviation of the background intensity, respectively. In SNR analysis, the acquisition time represents the total time spent scanning minus the total frame flyback time.
Image vectorization was performed using Segmentation-Less Automated Vascular Vectorization (SLAVV) software [25]. The program extracts vector sets representing the vascular network and calculates a variety of network statistics. The vectorized image can be displayed and examined using MATLAB or Blender add-on VessMorphoVis [26].

Alignment of resonant galvanometer
To avoid image distortion at the sample plane, the resonant galvanometer was aligned using a tip, tilt, and rotation stage. The appropriate tilt angle was determined from the CAD drawing of the galvanometer pair, which showed that the first galvanometer mirror in the path sits at a 15°angle from the horizontal plane ( Fig. 2(a, b)). Analysis was performed in Zemax to confirm that a 15°r oll angle would create a square image (Fig. 2(d)) and that orthogonal placement of the resonant galvanometer would create a distorted image (Fig. 2(c)). Images of a fluorescent US Air Force target taken before (Fig. 2(e)) and after ( Fig. 2(f)) the tilt correction were consistent with Zemax analysis.

In vivo two-photon microscopy imaging
Two-photon microscopy images of cortical vasculature were collected using two different scanning methods for image quality comparison. Resonant-galvo (RG) scanning was performed with the resonant galvanometer scanning in the horizontal direction and the x galvo mirror of the xygalvanometer pair scanning in the vertical direction. Galvo-galvo (GG) scanning was performed with the x and y galvanometer mirrors in the xy-galvanometer pair scanning in the horizontal and vertical directions, respectively, and the resonant galvo parked at its zero position. Excitation powers for each method were selected at each depth to be the power required to maximize the illumination of the vasculature without saturation, while minimizing the creation of out-of-plane fluorescence when viewing the image at 1 frame average for GG scanning and 20 frame average for RG scanning. To avoid tissue damage, power at the tissue surface was kept below 100 mW for GG scanning and below 170 mW for RG scanning [18]. Figure 3 demonstrates an image stack collected using RG scanning. An imaging depth of 750 µm was accomplished with 700 µm by 700 µm images collected at 3 µm depth increments, with optimized frame averaging determined by Fig. 4 to yield a SNR of at least 35 (15 frames from 0 to 250 µm, 40 frames from 250 to 500 µm, 100 frames from 500 to 700 µm, and 360 frames from 700 to 750 µm). With a frame rate of 27 Hz, this stack was acquired in 14 minutes. To compare RG and GG scanning under typical in vivo imaging conditions, we calculated the SNR values for different levels of frame averaging for each scanning method as a measure of image quality per acquisition time. The average powers were greater for RG than for GG scanning in these measurements and are listed in Fig. 4. Each SNR plot shown in Fig. 4 is the average of SNR values across three representative vessels chosen at each depth (250, 500, and 750 µm), for which line profiles were analyzed at each level of frame averaging. Figure 5(a) demonstrates line profiles shown in yellow across of one of the three vessels chosen at each depth, with frame averaging chosen to give an SNR of approximately 35. Figure 5(b) plots the line profile results at 750 µm depth for various levels of frame averaging that are equivalent in scan time across the two scanning methods. Samples of resulting images from different levels of frame averaging for GG and RG scanning are shown in Fig. 5(c), for scan times of 3, 13.5, and 22.5 s at 750 µm depth. For our imaging purposes, we determined that an SNR of 35 allows us to minimize acquisition time while preserving the abilities to effectively perform vectorization with our software (SLAVV) and visually discern all vessels for qualitative analysis.

Comparison with identical power levels and total dwell time
To provide a comparison between the resonant-galvo scanning and galvo-galvo scanning methods, a set of images were collected in which power at the sample and total sample exposure time were identical between the two methods at each depth of 250, 500, and 750 µm. The total sample exposure time is the sum of pixel dwell times across all pixels used to form the image. Table 1 compares the average SNR across ten vessels at each depth for sample exposure times of 1.89 and 5.66 seconds. Power levels at the sample were 5.8, 22, and 86 mW for 250, 500, and 750 µm depths, respectively. Paired t-test results showed that GG scanning produced higher SNR values at 500 µm depth with a sample exposure time of 1.89 seconds and at 750 µm with exposure times of 1.89 and 5.66 seconds (p < 0.05) compared to RG scanning. It should be noted that the mouse used for the measurements in Table 1 is not the same as that used for Figs. 4 and 5.

Vectorization of two-photon vascular images
We used SLAVV software to examine whether the image signal to noise in RG image sets was sufficient for detailed analysis of vascular morphology. Figure 6(c) shows an example of a vectorized mosaic image (1050 µm x 1050 µm x 660 µm), which was formed by stitching together four 700 × 700 × 660 µm stacks using ImageJ [23]. Maximum intensity projections of this mosaic in the axial and sagittal directions are shown in Figs. 6(a) and 6(b), respectively. The total acquisition time for this mosaic, collected using RG scanning, was 23 minutes (frame average of 20 was sufficient throughout for this particular mouse)-approximately a fourfold speedup  compared to the expected GG acquisition time of 81 minutes for a stack of the same dimensions and image quality (assuming frame average of 2 throughout).

Signal-to-noise ratio analysis
For a photomultiplier tube, the signal-to-noise ratio can be expressed as [27,28]: where the noise component is composed of photon shot noise (i s ), dark current noise (i d ), and transimpedance amplifier noise (i a ). I s represents the photocurrent created by light detection, I d is the dark current, I a is the input referred peak-to-peak noise current, q is the electron charge, F is the excess noise factor, B is the detection bandwidth, and G is the detector gain. I s is proportional to the number of photons detected, which for two-photon imaging is proportional to the square of the average excitation power at the sample [29,30], assuming constant pulse duration and repetition rate. When the detection is shot-noise-limited, the SNR is thus linearly proportional to average excitation power [29,30]: where (P ex ) is the average excitation power at the sample in a time interval (τ). The reduction in acquisition times using resonant-galvo scanning can be attributed to shotnoise-limited detection up to a certain depth, which allows for SNR to be maintained by using higher excitation powers with shorter pixel dwell times compared to galvo-galvo scanning (87.8 ns vs 7200 ns). To avoid tissue damage, these higher excitation powers cannot be used with GG scanning's pixel dwell times, which are orders of magnitude higher than those of RG [18]. We observe a general linear relationship between SNR and excitation power at the sample in Fig. 4 at depths of 250 µm and 500 µm, where a threefold increase in excitation power between GG and RG scanning at 250 µm resulted in a threefold increase in SNR and a twofold increase in power at 500 µm resulted in a twofold increase in SNR for identical imaging times (t = 3s). This data supports a shot-noise limited detection model as described in Eq. (2). At the depth of 750 µm, however, a 1.6x increase in power yields only a 1.5x increase in SNR. Given the weaker fluorescent signals at this greater imaging depth, it is likely that detection began to deviate from being shot-noise limited and for the SNR to be affected by other noise components: dark noise and amplifier noise as indicated in Eq. (1). A general linear relationship between SNR and the square root of acquisition time interval as described in Eq. (2) can also be seen in Fig. 4 at depths of 250 µm and 500 µm-e.g., a fourfold increase in acquisition time, such as the acquisition of 2 frames vs. 8 frames for GG scanning or 20 frames vs. 80 frames for RG scanning, results in an approximate twofold increase in SNR as expected for shot-noise limited detection.
Results in Table 1 show that when using identical excitation power and total sample exposure times between the two scanning methods, GG scanning yields higher SNR values than RG scanning at deeper depths of 500 µm, with the shorter total sample exposure time of 1.89 seconds, and 750 µm, with both tested total sample exposure times of 1.89 and 5.66 seconds. Under presumed shot-noise-limited detection with sufficient signal strength at the 250 µm depth and with longer dwell time at the 500 µm depth, both methods yield similar SNR values, as expected from Eq. (2). GG scanning outperforms RG scanning when detection is not shot-noise limited and is affected by the other noise components indicated in Eq. (1)-dark noise and amplifier noise. The dark noise and amplifier noise are more significant in RG scanning, which requires a higher frequency bandwidth setting (14 MHz) and has greater input referred peak-to-peak noise (150 nA) compared to GG scanning (1 MHz, 2.4 nA). Thus, for situations in which excitation power for RG scanning cannot exceed what is used for GG scanning, such as for more sensitive samples, GG scanning can be expected to yield higher SNRs when detection is not shot-noise limited.

Difference in temporal resolution
Resonant-galvo scanning is an advantageous method for reducing acquisition times by up to sixfold per single image, compared to galvo-galvo scanning, while preserving image quality, provided that greater excitation power can be used without inducing tissue damage. With an RG frame rate of 28 Hz, each additional frame that we choose to average increases our acquisition time by only 36 milliseconds per axial slice, compared 2.1 seconds for each additional GG frame per slice. For each additional frame averaged in RG scanning, there is a small increase in SNR. With these small SNR increments, we can reach the exact minimum SNR needed for image analysis and thus minimize the acquisition time. GG scanning, in contrast, has a low temporal resolution that often forces us choose between under-or over-shooting the SNR because each additional frame averaged gives a larger SNR increase than with RG scanning. For instance, if the minimum required SNR for analysis is above what is achievable with two frames but under what can be achieved with three frames, we must spend the additional 2.1 seconds per axial slice to collect three frames to ensure that the SNR is at least above the minimum SNR required for analysis. In a typical acquisition of 251 axial slices for a total depth of 750 µm, the potential time spent overshooting SNR to prevent undershooting it could be several minutes for a GG stack, while no more than a few seconds for an RG stack. The high temporal resolution of RG scanning is especially advantageous in samples with low noise, where the number of frames needed to achieve the appropriate SNR requires only a small fraction of the time required by GG scanning to acquire just one frame. Thus, it should be noted that the exact time-savings of using RG scanning is dependent on sample quality, which can vary between animals, regions of interest, and even time of imaging.

Time savings with large FOV Imaging
The benefits of RG scanning are augmented when acquiring large field of view mosaic images, in which case the amount of time saved compounds. The single image stack acquired in Fig. 3 using RG scanning was completed in 14 minutes. By interpolating the results from Fig. 4, the amount of time that it would have taken GG scanning to collect the same image stack with the same minimum SNR is calculated to be 34 minutes. A significant 20 minutes were saved by using RG scanning for this single image. A large FOV image, however, is composed of multiple single images, and thus the time saved per single image is multiplied. For instance, the large FOV mosaic image in Fig. 6 was collected in 23 minutes using RG scanning, in contrast to an expected 81 minutes required for a similar GG-acquired image. We saved an hour of experiment time and saved the mouse from an extra hour of anesthesia, of which long-term use has been shown to cause vascular dilation and could skew the collected data [31]. The shorter imaging time is further cost effective by reducing the amount of Texas Red dye needed for vascular imaging, since longer imaging sessions would require additional dye as it is cleared from the animal.

Microscope design advantages
A resonant-galvo-galvo system is valuable for allowing the seamless switch between GG, RG, and RGG scanning, each of which is ideal for different applications [32]. The lower excitation powers that can be used with GG scanning may offer lower phototoxicity, while the temporal resolution of RG scanning allows the capture of active processes such as red blood cell motion or neuronal calcium signaling [33,10,11,34]. A goal of our RGG design was to make the design adaptable to any custom system using available commercial parts. Our resonant scanner alignment method can be implemented with any resonant galvanometer and xy-galvanometer pair. Furthering accessibility is the relatively low cost of parts needed for the design. We calculate that the costs of the parts for our implementation of a resonant-galvo-galvo scanning system ($10,500) is approximately one-third the cost of purchasing a patented commercial scanner.

Conclusion
We demonstrate a simple-to-implement two-photon microscope design that allows effortless switching between galvo-galvo and resonant-galvo scanning. We compared the performance between GG and RG scanning and found that the SNR for both scan modes behave as expected for a system with shot-noise limited detection when sufficient fluorescent signal is present. We show that RG scanning can reduce the acquisition time from that of GG scanning for a desired SNR when the excitation power can be increased without causing tissue damage. The limitations of this acquisition speedup will vary with a variety of factors, such as imaging depth, and are expected to be sample-dependent. When excitation power must be maintained at levels used for GG scanning, GG scanning performs similarly to RG scanning at depths where detection is shot-noise limited but outperforms RG scanning in achieving desired SNR in less acquisition time at deeper imaging depths where detection deviates from being shot-noise limited.