# Real-Time Multidepth Multiphoton Microscopy Using Pixel-to-Pixel Focus-Switching
## 2 Experimental Setup  
The experimental setup is shown in Figure 1. A mode-locked Ti:Sapphire laser (Tsunami, Spectra-Physics, Mountain View, CA, USA) was used as the excitation source for the real-time multidepth multimodal multiphoton microscopy. It generates pulses with 80 MHz repetition rate and 100 fs duration, and the center wavelength is tunable between 700 and 1000 nm. A Faraday isolator was applied to minimize back-reflection. The power and the polarization of the laser source could be tuned by rotating the half-wave plates (WPH05M-850, Thorlabs, Newton, NJ, USA) placed before (HWP1) and after (HWP2) the Faraday isolator, respectively. A polarizing beam splitter (PBS1, PBS102, Thorlabs) split the fundamental beam into two arms (ARM1, ARM2). ARM1 was p-polarized (shown in red), and ARM2 was s-polarized (shown in blue). Objectives O1 and O2 (40 x 0.75 NA, dry, UPLFLN, Olympus, Hong Kong, China) were paired to adjust the divergence of ARM2, by fine-tuning their relative position along the optical axis with a stage. Lenses L1 and L2 (AD406-B, AD410-B, LBTEK, \(f_{\rm L1}=50\) mm, \(f_{\rm L2}=150\) mm) expanded the beam of ARM2 to fit the back-aperture of O1. PBS2 (PBS102, Thorlabs) combined ARM1 and ARM2. Spatial synchronizations of two arms were achieved by using similar methods to those described in [18]. We placed a quarter-wave plate (QWP, WPQ5M-850, Thorlabs) and an EOM (EO-AM-NR-C1, Thorlabs) after PBS2. A function generator (SDG1032X, Siglent) was used to modulate the EOM. When the function generator applied a 4/\(\uplambda\) voltage, the EOM and QWP worked as a half-wave plate, rotating the polarization of incoming beams by 90 degrees. When applying \(-4/\uplambda\) voltage, the polarization of incoming beams stays unchanged. PBS3 (PBS102, Thorlabs) was placed after the EOM to remove p-polarized components. Switching the voltages applied to EOM between \(\pm 4/\uplambda\) rapidly (frequency is 250 kHz) will obtain two s-polarized spatially overlapped and temporally interlaced beams. The rise time of the function generator was \(<\)4 ns, and thus crosstalk between ARM1 and ARM2 was avoidable. All components mentioned above constitute the EOM-based fast-switching light paths. Figure 1: Experimental setup of a real-time multidepth multiphoton imaging system. The excitation beams are shown in red and blue, and generated signals at different wavelength ranges are shown in green and yellow. The electrical paths are indicated in dashed black lines. HWP1, HWP2, half-wave plates; FI, Faraday isolator; PBS1, PBS2, PBS3, polarizing beam splitters; M, mirror; L1, L2, L3, L4, L5, L6, lenses; O1, O2, O3, objectives; QWP, quarter-wave plate; EOM, electro-optic modulator; B, blocker; SL, scan lens; TL, tube lens; DM1, DM2, long pass dichroic mirrors; F1, F2, bandpass filters; PMT1, PMT2, photomultiplier tubes. This figure is not to scale. The beams were scanned by a pair of galvanometer-driven dual-axis scanning mirrors (GVS002, Thorlabs, Newton, NJ, USA) at the focal plane (i.e., scan plane) of a scan lens (SL, AC254-045-B, Thorlabs, \(f_{\text{SL}}\) = 45 mm). Lenses L3 and L4 (AD410-B, AD406-B, LBTEK, \(f_{\text{L3}}\) = 150 mm, \(f_{\text{L4}}\) = 50 mm), along with lenses L5 and L6 (AD406-B, AD408-B, LBTEK, \(f_{\text{L5}}\) = 50 mm, \(f_{\text{L6}}\) = 100 mm), constitute two 4\(f\) optical systems, imaging the pupil of objective O2 to the middle plane of the scanning mirrors. After being focused by the scan lens, the beams were sent into a modified inverted microscope (IX71, Olympus, Tokyo, Japan), with some of its optical elements replaced to match the NIR wavelength of the excitation source. In the microscope, the beams were collected and collimated by a tube lens (TL, Olympus, Tokyo, Japan, \(f_{\text{TL}}\) = 180 mm), which constituted another 4\(f\) optical system with the scan lens, imaging the middle plane of the scanning mirrors to the pupil of a 20 \(\times\) 1.00 NA water immersion objective (O3, XLUMPLFLN, Olympus, Tokyo, Japan).