# Real-Time Multidepth Multiphoton Microscopy Using Pixel-to-Pixel Focus-Switching
## 2 Experimental Setup
The three 4\(f\) optical systems ensured that the beams of both ARM1 and ARM2 fit the back-aperture of O3 with the same sizes, and the pupil of O2, scanner, and pupil of O3 were mutually conjugate. The beams were then collected and focused into the samples by O3. The focal planes in the samples had different depths for ARM1 and ARM2, because of their different divergences. As shown in the inset of Figure 1, when ARM2 is convergent (blue) and divergent (green), its focal plane will be shallower and deeper than that of ARM1, respectively. Samples were placed on a three-dimensional motorized stage. The signal from samples was collected by the objective O3 in the epi-direction, separated from the beams by a long-pass dichroic mirror (DM1, FF705-Di01, Semrock, Lake Forest, IL, USA) and detected by two channels (CH1, CH2) equipped with photomultiplier tubes (PMT1, PMT2, R6357, Hamamatsu, Hamamatsu-shi, Japan). Another long-pass dichroic mirror (DM2, FF470-Di01, Semrock, Lake Forest, IL, USA) and two bandpass filters (F1, F2, FF02-435/40, FF01-565/133, Semrock, Lake Forest, IL, USA) were applied to separate signals at different emission regions and minimize crosstalk between different channels. The achieved wavelength ranges were 415-455 nm and 495-635 nm for CH1 and CH2, respectively. Labview-based home-made microscope software simultaneously controlled the scanner and restored mesh-like images acquired from different detection channels and beams with different divergences. Electrical devices used in the setup are commercially available, and wiring can be easily operated by researchers with limited knowledge of electrical engineering. We demonstrate the detailed operating principle of the imaging system in detail in Figure 2. As shown in Figure 2a, the pixel clock of 2 \(\upmu\)s period from the microscope works as an external trigger for the function generator. The function generator works in N-cycle burst mode. As shown in Figure 2b, the period of generated pulse train is 4 \(\upmu\)s with a duty cycle of 50%. Since the EOM is modulated by the pulse train, fine-tuning the temporal position of the pulse train will ensure that only one arm in the fast-switching light paths is turned on in a pixel dwell time (2 \(\upmu\)s). Thus, different columns of a multiphoton image correspond to focal planes of different depths, which is called pixel-to-pixel focus-switching. Figure 2c shows real-time multidepth two-photon fluorescence image of proflavine in aqueous solution. The wavelength of the mode-locked Ti:Sapphire laser was tuned to 870 nm. The detection channel CH2 was turned on to collect autofluorescence in the range of 495-635 nm. ARM1 was focused to the surface of the proflavine solution, and ARM2 was focused to the depth of 5 \(\upmu\)m beneath the surface. The depth offset of ARM2 was preset with the help of the \(Z\) value of the sample stage. The average powers of both ARM1 and ARM2 at the focal planes were \(\sim\)5 mW, but the average power of ARM2 was slightly higher, to compensate for signal intensity loss caused by extra dispersion from dispersive elements (i.e., L1, L2, L3, L4, O1, O2). Adjacent two pixels in the same line have different intensities, showing that they were acquired at different focal planes. Figure 2d,e are autofluorescence images extracted from Figure 2c, corresponding to the depths of 0 and 5 \(\upmu\)m, respectively. They show that the imaging system is effective in performing real-time multidepth multiphoton microscopy. Note that only one detector is needed for each imaging modality, simplifying implementation complexity. Full width at half-maximum (FWHM) axial resolutions of both ARM1 and ARM2 were approximately 1.5 \(\upmu\)m. Measurements were taken by using fluorescent beads, when only ARM1 or ARM2 was turned on. The results show that axial resolution can be maintained when changing the divergence of beam collected by objective O3 in a small range.