High-throughput two-photon volumetric brain imaging in freely moving mice Authors: Long Qian, Yaling Liu, Yalan Chen, Jianglai Wu Published: 2025 ABSTRACT Imaging neural activities across large volumes at subcellular resolution without impeding animal behaviors remains difficult. Here, we develop a high-throughput miniature Bessel-beam two-photon microscope (miniBB2p) capable of imaging calcium dynamics from neurons and dendrites over a volume of 420 × 420 × 80 μm³ during free behavior. We share a full description of miniBB2p and demonstrate its ability to perform large-scale recordings of the calcium activities of more than 1000 neurons at a time in anterior cingulate cortex and secondary motor cortex of freely moving mice in various behavioral paradigms. Our results position miniBB2p to advance the design of miniature multiphoton microscopes, facilitating precise monitoring of neural activities across large populations within a three-dimensional volume in freely moving animals. Introduction Head-mounted miniature multiphoton microscopy offers a promising avenue for investigating neural activity during free and naturalistic behavior in mice and rats, thanks to its inherent optical sectioning and deep tissue penetration capabilities1. Recent advancements in optical fibers, miniature detectors, laser scanners, focus-tunable lenses, and objectives have significantly improved the performance of miniature multiphoton microscopes2–10, leading to a substantial increase in the number of neurons that can be imaged in freely moving animals in practical neurobiological investigations10–13. However, several limitations are presented in existing miniature multiphoton microscopes. First, rapid volumetric imaging is challenging due to the sequential acquisition of each voxel, especially when using high numerical aperture (NA) objectives that offer superior lateral and axial resolution. While advanced platforms with fast focus-tunable lenses can scan the focus axially in milliseconds5,10, a restricted number of thin optical sections within a volume can be imaged at a time, albeit at the expense of imaging speed and resolution. Second, the shallow depth of field of the microscope makes imaging susceptible to brain tissue movement, particularly axial movement. This issue is a common concern in imaging head-fixed animals14 and would be exacerbated when imaging freely moving animals, as brain movement is less constrained8. Finally, while customized optics such as miniature objectives have been utilized to achieve higher resolution and larger field of view (FOV), achieving diffraction-limited resolution across the FOV remains difficult6,8,10. This challenge arises from the need to fit all optics into a compact space of a few cubic centimeters, which poses extra hurdles for lens design and assembly. A Bessel beam can address these limitations. In recent years, tabletop two-photon microscopes (2PM) utilizing Bessel beams have shown several distinct features over the widely used Gaussian beams15–20. Gaussian-beam 2PM records a stack of 2D optical sections across the depth to achieve 3D imaging; it favors resolving the fine structures in the axial dimension at a compromised imaging speed. In contrast, Bessel-beam 2PM captures projected views of volume structures by scanning an axially elongated focus in 2D. This process transfers the 2D scan rate into a volumetric imaging rate, increases the information throughput, and reduces the data size. It is an effective tool for volumetric calcium imaging in vivo, as the position of neurons and their fine structures remain stable during imaging17. In addition, if needed, the axial coordinates of structures in the 2D projections can be retrieved with a full 3D reference image from a Gaussian-beam 2PM. The extended depth of field also makes imaging resistant to axial movements of brain tissue17, which is preferred in monitoring neural circuits in freely moving animals. Moreover, in comparison to Gaussian-beam 2PM, Bessel-beam 2PM achieves better lateral resolution at the same excitation NA17,18 and is mainly sensitive to astigmatism among all primary optical aberrations, indicating the potential of designing simple lenses for miniature microscopes20,21. In this work, taking advantage of these unique features of Bessel beams in two-photon imaging, we develop a head-mounted miniature Bessel-beam two-photon microscope (miniBB2p) and demonstrate high-throughput volumetric calcium imaging in secondary motor cortex (M2) and in anterior cingulate cortex (ACC) in freely moving mice. Results Bessel beam simplifies the optical design in miniBB2p Among all primary optical aberrations, including spherical aberration, coma, astigmatism, field curvature, and distortion, the Bessel beam is mainly sensitive to astigmatism20,21. Leveraging this characteristic, we utilized a systematic approach in miniBB2p to eliminate astigmatism while minimizing other primary aberrations. Briefly, we adopted a symmetric design for the scan and tube lenses, each comprising two identical plano-convex lenses (Fig. 1a). This symmetry minimizes coma, distortion, and lateral color aberration. Uncorrected astigmatism was fully compensated by the objective formed by two plano-convex lenses (Fig. 1b). In parallel, other aberrations in the objective were well-contained under the low excitation NA of 0.3, leading to near-diffraction-limited performance over a FOV of Ø 600 μm (Fig. 1c). Throughout the entire FOV, we found negligible blurring of the Bessel focus from the residual spherical aberration and coma, in contrast to the blurring observed with a Gaussian focus (Supplementary Fig. 1). We noted that the residual field curvature and distortion simply shift the focal position without blurring the focus (Fig. 1d and Supplementary Fig. 1). The systematic design approach focused on astigmatism correction in miniBB2p significantly reduced the number of lenses in the microscope compared to conventional designs that seek to correct all major aberrations for individual lenses. This reduction not only lowered manufacturing costs but also simplified assembly and alignment, while still maintaining high image quality (Supplementary Table 1).Fig. 1Optical design in miniBB2p.a Unfolded excitation beam path from the MEMS mirror (stop) to the focal plane. Blue and green rays represent the beam focusing at the center and edge of the FOV; the focal plane is curved with a radius of 2 mm, resulting in a maximum focal shift of ~10 μm across the entire FOV. b Seidel aberration coefficients across lenses. c Root-mean-square wavefront error throughout a FOV of Ø 600 μm. d Distortion of the microscope; maximum distortion is ~−2.1%. The stop size is 1 mm and NA is 0.3 in the simulation (See optical design files in Data availability). Optical design in miniBB2p. a Unfolded excitation beam path from the MEMS mirror (stop) to the focal plane. Blue and green rays represent the beam focusing at the center and edge of the FOV; the focal plane is curved with a radius of 2 mm, resulting in a maximum focal shift of ~10 μm across the entire FOV. b Seidel aberration coefficients across lenses. c Root-mean-square wavefront error throughout a FOV of Ø 600 μm. d Distortion of the microscope; maximum distortion is ~−2.1%. The stop size is 1 mm and NA is 0.3 in the simulation (See optical design files in Data availability). System design and performance testing of miniBB2p The headpiece of miniBB2p weighed a total of 2.6 grams and was about 2.4 × 0.9 × 2.0 cm3 in size, making it well suited for brain imaging in freely moving mice (Fig. 2a-d, Supplementary Fig. 2 and Methods). We used a 1-meter large-mode-area photonic crystal fiber (LMA-12, NKT Photonics) to transmit the 920-nm femtosecond laser pulses for two-photon excitation. This endlessly single-mode photonic crystal fiber supports single-mode delivery over a broad spectral range from 700 to 1700 nm22. The pulse in the fiber was broadened by material dispersion and nonlinear effects (e.g., self-phase modulation)23. Benefitting from the large mode area (~ Ø 10 µm), nonlinear effects in the fiber were substantially reduced. The pulse width after dispersion precompensation at the fiber output end was less than 200 fs at laser powers below 40 mW and less than 300 fs at laser powers below 100 mW (Supplementary Fig. 2b and Methods). To generate the Bessel beam, we engineered a custom micro-axicon with an apex angle of 120° at the fiber tip (Fig. 2b, Supplementary Fig. 2c and Methods). A microelectromechanical systems (MEMS) mirror was used as the scanner, enabling a maximum square FOV of 420 × 420 μm2 and a frame size of 512 × 512 pixels at 9 frames per second.Fig. 2System design and test of miniBB2p.a Photograph of a mouse wearing the microscope headpiece. b Brightfield micrograph of the custom micro-axicon at the LMA-12 fiber tip (top) and ring pattern imaged at ~5-mm distance from the fiber tip (bottom). c, Schematic of miniBB2p showing key elements and excitation beam path (red lines). d Imaging a volume requires a single 2D scan of a Bessel focus but a stack of 2D scans of a Gaussian focus. e Lateral and axial point spread functions measured with 500-nm fluorescent beads. f Image of a ~ 80-μm thick volume of Thy1-GFP-M brain slice by miniBB2p (left) and an image stack at 3-μm step collected by a tabletop Gaussian beam 2PM from the same volume, with structures colored by depth (right). g zoom-in imaging of the boxed areas in f; white arrowheads denote dendritic spines that were more clearly visualized by Bessel focus. h, Imaging the spontaneous activity of neurons in anterior cingulate cortex (ACC) expressing GCaMP7f in a free-moving mouse with miniBB2p. i Spatial distribution of 1015 neurons extracted by Suite2P in h, randomly colored for visualization. j Example calcium signals from neurons circled in h. k–l Imaging the same volume in awake head-fixed mouse by the tabletop 2PM: Gaussian imaging stack at 3-μm step with structures colored by depth (k); neural activity imaging in the top, middle, and bottom layers of the volume, the imaging depth and number of neurons identified by Suite2P are listed at right (l). Data in b and e-h are from single representative experiments (n = 3 fibers in b; n = 10 beads in e; n = 5 slices in f, g; n = 5 animals in h). System design and test of miniBB2p. a Photograph of a mouse wearing the microscope headpiece. b Brightfield micrograph of the custom micro-axicon at the LMA-12 fiber tip (top) and ring pattern imaged at ~5-mm distance from the fiber tip (bottom). c, Schematic of miniBB2p showing key elements and excitation beam path (red lines). d Imaging a volume requires a single 2D scan of a Bessel focus but a stack of 2D scans of a Gaussian focus. e Lateral and axial point spread functions measured with 500-nm fluorescent beads. f Image of a ~ 80-μm thick volume of Thy1-GFP-M brain slice by miniBB2p (left) and an image stack at 3-μm step collected by a tabletop Gaussian beam 2PM from the same volume, with structures colored by depth (right). g zoom-in imaging of the boxed areas in f; white arrowheads denote dendritic spines that were more clearly visualized by Bessel focus. h, Imaging the spontaneous activity of neurons in anterior cingulate cortex (ACC) expressing GCaMP7f in a free-moving mouse with miniBB2p. i Spatial distribution of 1015 neurons extracted by Suite2P in h, randomly colored for visualization. j Example calcium signals from neurons circled in h. k–l Imaging the same volume in awake head-fixed mouse by the tabletop 2PM: Gaussian imaging stack at 3-μm step with structures colored by depth (k); neural activity imaging in the top, middle, and bottom layers of the volume, the imaging depth and number of neurons identified by Suite2P are listed at right (l). Data in b and e-h are from single representative experiments (n = 3 fibers in b; n = 10 beads in e; n = 5 slices in f, g; n = 5 animals in h). The miniBB2p featured a working distance of 1 mm in water, an excitation NA of 0.26, and a collection NA of 0.95. Lateral and axial resolution measured with 500-nm fluorescent beads were 0.97–0.99 μm and 80–90 μm across the FOV (Fig. 2e and Supplementary Fig. 3). The lateral resolution obtained is equivalent to the diffraction-limited resolution using a Gaussian beam at a higher NA of 0.35. Notably, fluorescence collection efficiency is 2–4 times greater than that in the state-of-the-art platforms with a comparable FOV and lateral resolution8–10 (Supplementary Figs. 4a–d and Supplementary Table 1). In addition, fluorescence was directly detected after the objective and filters using an onboard silicon photomultiplier, which offered higher detection efficiency and less tethered burden than fluorescence collection using thick fibers as a relay unit6. Imaging comparison between miniBB2p and tabletop Gaussian-beam 2PM We first imaged Thy1-GFP-M mouse brain slices to demonstrate the throughput and resolution of miniBB2p (Fig. 2f-g). Using a commercial tabletop Gaussian-beam 2PM (0.3 NA, axial resolution 22.9 μm), a stack of at least 4 images is required to cover all structures within an 80-μm thick volume. In comparison, miniBB2p captured the same information in one image, with a fourfold increase in depth of field. Moreover, the higher resolution in Bessel focus allowed easier visualization of dendritic spines (Fig. 2g). These observations were also found in a head-fixed mouse brain (Supplementary Fig. 5). We then employed miniBB2p to image spontaneous neural activities in freely moving mice. We resolved calcium dynamics of 1015 neurons at a time in ACC (Fig. 2h-j and Supplementary Video 1). This result was validated through structural imaging at same region and neural activity imaging in the top, middle, and bottom layers within the same volume using the tabletop 2PM on head-fixed mice (Fig. 2k, l). The latter approach identified 534 neurons across the three layers, approximately half the number of neurons resolved with miniBB2p. Beyond that, miniBB2p was able to image calcium transients in dendritic trees and spines along multiple dendritic branches in an axially extended volume (Supplementary Figs. 6, 7 and Supplementary Videos 2–4). These measurements underscored the benefits of high-resolution volumetric imaging enabled by miniBB2p. MiniBB2p enables longitudinal recordings with minimal constraints on animal behavior To assess the impact of carrying miniBB2p during imaging on animal behavior and mobility, we compared the movements between the naive mice carrying nothing and the mice carrying the dummy microscope with the same weight, fiber and cables as miniBB2p (Fig. 3 and Methods). While the mice freely exploring the behavioral arena, no significant difference were found in the total distance traveled (Fig. 3e, g), mean and median running speed (Fig. 3b, c, f), and the number of entries into the central coverage (Fig. 3d) between the naive mice and mice with dummy. In addition, we did not observe any notable variations of the running distance in the central and corner area of the arena following installation of the dummy microscope (Fig. 3g). These observations suggested that carrying miniBB2p along with the fiber and cables did not significantly impede the animal behavior. In addition, we evaluated the feasibility of conducting longitudinal studies using miniBB2p by imaging the same FOV and examining the number of identical cells recorded over multiple days. Our results revealed that the same neuronal populations could be monitored for weeks, with minimal photobleaching and photodamage (Supplementary Figs. 8–10), highlighting miniBB2p’s suitability for chronic imaging applications.Fig. 3Minimal impact of miniBB2p on animal movement.a Representative trajectories of mice running in a 97.6 cm × 45 cm behavioral arena in a 30-min trail; with dummy, mice carrying the 2.6 g dummy microscope, fiber, and cables; control, mice carrying nothing; running speed is color coded; red dashed box indicates the central area. b–c Average speed (b) and median speed (c) in each condition (30 min each); p = 0.4156 and 0.7429, two-tailed paired t test. d Number of entries into the central area. p = 0.8543, two-tailed paired t test. e Mean accumulated distance over the 30-min test, shaded areas show s.e.m. f Cumulative speed distribution over the 30-min test among all trails. g Total distance traveled (left), distance traveled in the central and corner area (right) in each condition (30 min each); p = 0.4141, 0.6408 and 0.3394, two-tailed paired t test. NS, no significant; data in b–d and g are presented as mean ± s.e.m. Data represent measurements collected from 12 individual animals. Minimal impact of miniBB2p on animal movement. a Representative trajectories of mice running in a 97.6 cm × 45 cm behavioral arena in a 30-min trail; with dummy, mice carrying the 2.6 g dummy microscope, fiber, and cables; control, mice carrying nothing; running speed is color coded; red dashed box indicates the central area. b–c Average speed (b) and median speed (c) in each condition (30 min each); p = 0.4156 and 0.7429, two-tailed paired t test. d Number of entries into the central area. p = 0.8543, two-tailed paired t test. e Mean accumulated distance over the 30-min test, shaded areas show s.e.m. f Cumulative speed distribution over the 30-min test among all trails. g Total distance traveled (left), distance traveled in the central and corner area (right) in each condition (30 min each); p = 0.4141, 0.6408 and 0.3394, two-tailed paired t test. NS, no significant; data in b–d and g are presented as mean ± s.e.m. Data represent measurements collected from 12 individual animals. Using miniBB2p for high-throughput imaging of the neural activities across different behavioral paradigms We used miniBB2p to record high-throughput proof-of-principle data from neuronal populations in M2 and ACC of freely moving mice in a variety of behavioral paradigms. First, we investigated the response of pyramidal neurons in M2 to locomotion over a 30-minute recording period in freely moving mice. (Fig. 4a-c and Supplementary Video 5). Running increased the mean ΔF/F in most neurons (Fig. 4d), with a running modulation index (MI) showing increased activity during running (Fig. 4e; n = 878 neurons, running MI 0.156 ± 0.006, mean ± s.e.m.). In addition, we inspected the average fluorescence changes aligned with running onsets and found that 38.2% of the neurons recorded significantly increased their activities upon running onset (Fig. 4f and Methods), resembling the study from recordings in primary somatosensory cortex (S1)24.Fig. 4Imaging the response of pyramidal neurons in M2 to locomotion.a Image of an example neuronal population in M2. b Representative calcium traces along with moving speed from neurons circled in a; running and resting states are color-coded with blue and gray. c, Movement trajectory and speed of the mouse over a 30-min recording period. d Scatter plot of the mean ΔF/F values in resting and running states for the 878 neurons recorded; dashed line indicates a unity line. e Distribution of running modulation index for the neurons; triangle indicates median. f Population average of ΔF/F traces for neurons with and without increasing calcium activity in response to the running onset (16 events), shaded areas indicate s.e.m. Data represent one of three experiments in one animal. Imaging the response of pyramidal neurons in M2 to locomotion. a Image of an example neuronal population in M2. b Representative calcium traces along with moving speed from neurons circled in a; running and resting states are color-coded with blue and gray. c, Movement trajectory and speed of the mouse over a 30-min recording period. d Scatter plot of the mean ΔF/F values in resting and running states for the 878 neurons recorded; dashed line indicates a unity line. e Distribution of running modulation index for the neurons; triangle indicates median. f Population average of ΔF/F traces for neurons with and without increasing calcium activity in response to the running onset (16 events), shaded areas indicate s.e.m. Data represent one of three experiments in one animal. Next, we examined the neural activity in ACC under different pain stimulation paradigms in freely moving mice. We imaged the calcium activity of 673 ± 104 (n = 5 mice, mean ± s.e.m.) pyramidal neurons both before and after administrating a peripheral stimulus, either a noxious 27 G pin prick or control, non-noxious 0.4 g von-Frey filament, to the paw contralateral to the recording site of the brain (Fig. 5a, b, Supplementary Video 6 and Methods). After signal processing and identification of active neurons (Fig. 5c), we observed that ACC neurons exhibited only low-level calcium activity in response to non-noxious stimuli. In contrast, these neurons showed an increase in calcium activity when subjected to noxious stimuli (Fig. 5d). We then analyzed the average peak ΔF/F in response to both non-noxious and noxious stimuli, which revealed a significantly higher response to noxious stimuli in comparison to non-noxious stimuli (Fig. 5e). Furthermore, more neurons reacted to the noxious stimuli than to the non-noxious stimuli (Fig. 5f). Specifically, 13.10% of the neurons recorded responded to the noxious stimuli, whereas 8.53% responded to the non-noxious stimuli (Fig. 5g, h). These observations are consistent with previous studies showing increased firing rates in ACC neurons during noxious stimuli25,26.Fig. 5Imaging neuronal populations in ACC under different pain stimulation paradigms.a Schematic diagram for monitoring the response of ACC neurons to noxious (PP, pin prick) or non-noxious (vF, 0.4 g vF filament) stimuli in freely moving mice. b Image of an example neuronal population in ACC. c Z-scored mean ΔF/F of five trials for 504 neurons recorded from the example mice. Neurons were aligned from high to low calcium responses after PP stimuli. d Representative trace of z-scored mean calcium response of a single neuron during vF and PP. e PP induced a higher calcium response than vF (p < 0.0001, two-tailed Fisher’s exact test). Data are presented as median (center line), interquartile range (25th–75th percentile; box), and 1st–99th percentile (whiskers), n = 3366 neurons. f–h More neurons responded to PP than to vF stimuli (f); percentages of neurons activated by vF (g) and PP (h) stimuli (n = 3366 neurons in five mice). Data in b-d are from a single representative experiment (n = 5 animals, one experiment per animal); data in e-h are statistics derived from all five experiments. Imaging neuronal populations in ACC under different pain stimulation paradigms. a Schematic diagram for monitoring the response of ACC neurons to noxious (PP, pin prick) or non-noxious (vF, 0.4 g vF filament) stimuli in freely moving mice. b Image of an example neuronal population in ACC. c Z-scored mean ΔF/F of five trials for 504 neurons recorded from the example mice. Neurons were aligned from high to low calcium responses after PP stimuli. d Representative trace of z-scored mean calcium response of a single neuron during vF and PP. e PP induced a higher calcium response than vF (p < 0.0001, two-tailed Fisher’s exact test). Data are presented as median (center line), interquartile range (25th–75th percentile; box), and 1st–99th percentile (whiskers), n = 3366 neurons. f–h More neurons responded to PP than to vF stimuli (f); percentages of neurons activated by vF (g) and PP (h) stimuli (n = 3366 neurons in five mice). Data in b-d are from a single representative experiment (n = 5 animals, one experiment per animal); data in e-h are statistics derived from all five experiments. Last, we imaged calcium activity of interneurons in ACC upon receiving pin prick stimuli, both before and after chemogenetic inhibition of neural activity in S1 (Supplementary Figs. 11a, b and Methods). S1 and ACC are well-known brain regions for processing the sensory and affective components of pain. The S1 → ACC pyramidal neuron projection allows sensory pain information to be transmitted to a higher-order cortical center that regulates the affective experience26. However, it is not well understood whether ACC interneurons also receive nociceptive information from S1. Using miniBB2p, we found that interneurons in ACC became more sensitive to pin prick after the inactivation of S1(Supplementary Figs. 11b, c), suggesting they receive nociceptive information from S126. This relationship highlights the role of these neurons in processing the sensory and affective aspects of pain. Discussion The Bessel beam has been effectively demonstrated as a promising approach in tabletop 2PM to achieve high-throughput volumetric imaging of neural activity in head-fixed mice across a wide range of neurobiological studies15–20. In this work, we found that the unique characteristics of Bessel beams in two-photon imaging—such as extended depth of field, higher lateral resolution, and insensitivity to optical aberrations compared to commonly used Gaussian beams—can facilitate the design of miniature multiphoton microscopes. These advancements not only simplify the design of miniature microscopes but also expand their capability to monitor neural dynamics from a 3D volume at synaptic resolution in freely moving animals, addressing a significant challenge encountered by existing technologies. The extended depth of field in our miniBB2p system, as in tabletop Bessel-beam 2PM, is essential for high-throughput volumetric imaging but inherently raises the possibility of misinterpreting axially overlapped neurons, particularly in samples with dense labeling. To mitigate this limitation, advanced computational demixing methods, such as constrained nonnegative matrix factorization (CNMF), can be applied to leverage the temporal sparsity of neural activity and separate signals from superimposed neurons19,27. The accuracy of this spatiotemporal signal separation can be further improved by integrating prior structural information acquired from a tabletop Gaussian-beam 2PM, which provides a high-resolution anatomical reference for precise segmentation. Finally, while axially overlapped neurons could lead to noise cross-talk, the high sensitivity of advanced genetically encoded calcium indicators renders this effect minimal for resolving individual neurons in calcium imaging19. Similar to existing MEMS-based miniature Gaussian-beam 2PMs, miniBB2p achieves an imaging throughput (effective pixel rate) of 2.4 megapixels per second, mainly constrained by the bandwidth of the MEMS scanners. However, miniBB2p delivers a 4–8× improvement in information throughput, enabled by its extended depth of field. Further increases in imaging throughput and FOV would require MEMS scanners with a larger mirror size and wider optical scan angle without compromising the scanning speed. Note that, as the imaging throughput and FOV increases, higher fluorescence excitation and detection efficiency become essential to compensate for the signal loss resulting from reduced pixel dwell times. The miniBB2p is characterized by its lightweight design, reduced tethering stress, simple optics, and maximized fluorescence collection efficiency. These strengths facilitate long-term stable imaging without impeding the animal behavior, using a safe laser power (40–100 mW) comparable to that used in tabletop Bessel-beam 2PMs (Supplementary Table 2)17. The high-throughput volumetric imaging capability of miniBB2p enabled us to investigate the neural activities in M2 in response to animal movement, as well as the neuronal responses in ACC under various pain stimulation paradigms, at a large population scale. Higher throughput could be realized by integrating a rapid axial scanning unit into miniBB2p for volumetric imaging across multiple depths5,10. While the large-mode-area fiber used in this work can effectively deliver femtosecond laser pulses over a broad spectral range, a promising feature for imaging indicators with different excitation wavelengths, we noted that the pulse is substantially broadened at high power due to nonlinear effects within the fiber (Supplementary Fig. 2b). This shortcoming would compromise performance of the microscope when utilizing a power exceeding 100 mW. Future developments using hollow-core photonic bandgap fiber (HC-920, NKT Photonics) can address this issue and further enhance the sensitivity of miniBB2p in imaging GFP-based indicators2. Using readily available off-the-shelf lenses, we developed miniBB2p to be cost-effective without impairing its capability (Supplementary Table 3). In addition, the simple optical design allowed us to assemble the lenses in the lab to approach the diffraction limit without the need for complex and expensive assembly processes typically required in a lens manufacturing facility. We anticipate that the design’s simplicity and cost-effectiveness will diminish the barriers to a broader application of head-mounted multiphoton microscopy for studying neural dynamics in freely moving animals. Moreover, the optical design methodologies established in this study may pave the way for future advancements in miniature multiphoton microscopes with a larger FOV and higher resolution. Methods Microscope setup and system control A fiber-based femtosecond laser (FemtoFiber ultra 920, Toptica) with a built-in dispersion precompensation unit (−40000 to +1000 fs2) was used to produce femtosecond laser pulses at a center wavelength of 920 nm (920 ± 10 nm, 100 fs, 80 MHz, 1.2 W). Using an objective (LMPLFLN20×, Olympus), the laser was coupled into the LMA-12 fiber. Dispersion from the 1-meter fiber was fully compensated with the precompensation parameter set to −26000 fs2. In miniBB2p, fiber tip with the custom axicon was aligned with a collimating lens (45-956, Edmund Optics) to generate the ring-shaped beam. The MEMS scanner (A3I12.2-1200AL, Mirrorcle) provided a 1.2-mm diameter mirror with the first resonant frequency of both axes at ~2.6 kHz and it was used at a 30° incidence angle. After the scan lens and tube lens, which were formed by four identical plano-convex lenses (48-704, Edmund Optics) in a symmetrical configuration, a dichroic mirror (DMR-805SP, LBTEK; 1 mm thick; cut into pieces of 7 × 7 mm2 by Sunlight) was used to separate the laser beam and fluorescence. The objective, consisting of two plano-convex lenses (47-850 and 65-300, Edmund Optics), was used to generate the Bessel focus in the specimen. Fluorescence was collected through the objective, dichroic mirror, and filters, and was detected with an onboard miniature, low-cost silicon photomultiplier (3 × 3 mm2, S13360-3075PE, Hamamatsu). A reflective filter (FIL-800, 450–650 nm transmission, 6 × 6 mm2, 0.2 mm thick, Sunlight) and a colored glass filter (FGB37-A, Thorlabs; 2 mm thick; cut into pieces of 6 × 6 mm2 by Sunlight) were placed before the detector to reject the strong infrared laser. The microscope housing was made of carbon-fiber-enhanced plastic (PEEK-CF30) to reduce the weight of the headpiece. The control signals for x-y scanning were generated from a MEMS controller (USB-SL MZ, Mirrorcle), which was also used to drive the acousto-optic modulator in the laser for power control and to trigger the data acquisition. The scanner was operated in resonance mode along the x-axis at 2304 Hz, scanning 4608 lines every second in bi-directional mode. This operation resulted in an image of 512 × 512 pixels at 9 frames per second. The x-axis scanning range was about √2 times the y-axis scanning range to achieve a nearly square FOV10. The silicon photomultiplier was wired by a thin coaxial cable (Ø 260 μm) to the driver circuit (C12332-01, Hamamatsu). The fluorescence signal was amplified by the same circuit and sampled with a digitizer (20 MS/s, M2p.5921-x4, Spectrum Instrumentation). The entire system was controlled by custom software based on the MATLAB (R2022a) platform. Micro-axicon design We customized a micro-axicon at the tip of the LMA-12 fiber (Comcore, China). Specifically, the tip of the photonic crystal fiber was collapsed and polished to form an axicon lens (apex angle = 120°). The laser from the photonic crystal region in the fiber was spread out at the collapsed region (~1 mm length) and transformed into a diverged ring beam by the axicon (Supplementary Fig. 2c). After the collimating lens, a focused ring beam was generated at the back focal plane of the scan lens, where the MEMS mirror was located. The maximum diameter of the ring beam that the mirror can accommodate is 1 mm, corresponding to a maximum excitation NA of 0.3. In this work, the diameter of the ring beam was measured to be 0.85 mm and it resulted in an excitation NA of 0.26. Resolution and FOV calibration We ascertained the resolution of miniBB2p by imaging 500-nm fluorescent beads (F8813, Thermo Fisher Scientific), with a pixel size of 0.1 μm to measure lateral resolution and an axial step size of 6 μm to measure axial resolution. The resolutions were evaluated as the full width at half maximum of the point spread functions (Supplementary Fig. 3). We calibrated the FOV of miniBB2p by imaging a 50-μm grid standard (RTR1Ee-P, LBTEK). Field distortion due to optical aberrations (Fig. 1d) and MEMS scan was corrected with the software DistortionCleaner (Supplementary Figs. 4e, f)10. All data in this study was displayed after distortion correction. Tabletop Gaussian-beam 2PM A tabletop Gaussian-beam 2PM (AX R MP, Nikon) with a water immersion objective (CFI Plan Fluor 10× W, NA 0.3, Nikon) was used to evaluate the performance of the miniBB2p. Lateral and axial resolution of the tabletop 2PM measured from 500-nm fluorescent beads were 1.34 ± 0.02 μm and 22.90 ± 0.47 μm (mean ± s.d., n = 5). Animals C57BL/6 J wild-type mice (Jackson Laboratory stock No. 000664) were obtained and housed at the Laboratory Animal Resource Center (LARC) within the Chinese Institute for Brain Research, Beijing (CIBR). Thy1-GFP-M (STOCK Tg (Thy1-EGFP) MJrs/J, Jackson Laboratory stock No. 007788) and VGAT-Cre (B6J.129S6(FVB)-Slc32a1tm2(cre)Lowl/MwarJ, Jackson Laboratory stock No. 028862) transgenic mice were generously donated by Wenzhi Sun at CIBR. All mice were acquired at 5 weeks of age and allowed an average of 2 weeks to acclimate to their new environment before the experiments began. Mice were housed in groups of up to 5 pre-surgery and 1-3 post-surgery. Housing conditions: 12 h reversed light/dark cycle (testing during dark phase); 23–25 °C; 40–50% humidity; free access to food and water. All experimental procedures were approved by the Institutional Animal Care and Use Committee (IACUC) of CIBR (AP# CIBR-IACUC-063), in accordance with the governmental regulations of China. Wild-type mice were used for locomotion behavior tests (n = 12; 5 F (female)/7 M (male); Fig. 3) and Thy1-GFP-M transgenic mice were used for structural imaging (n = 3; 1 F/2 M; Supplementary Fig. 5). Dendritic and spine calcium imaging was performed in wild-type male mice pre-injected in the ACC with rAAV2/9-hSyn-Cre and rAAV2/9-hSyn-DIO-jGCaMP8s (n = 6 for Supplementary Fig. 6; n = 1 for Supplementary Fig. 7). Neuronal calcium imaging was performed in wild-type male mice pre-injected in ACC/M2 with rAAV2/9-CaMKIIα-jGCaMP7f (n = 5 for Fig. 2h, i; n = 1 for Fig. 4; n = 5 for Fig. 5; n = 2 for Supplementary Fig. 8) and in VGAT-Cre transgenic male mice pre-injected in ACC with rAAV2/9-hSyn-DIO-jGCaMP8s and in S1 with rAAV2/9-CaMKIIα-hM4D(Gi)-mCherry (n = 3 for Supplementary Fig. 11). Viral construction and packaging Recombinant adeno-associated virus (rAAV) vectors were serotyped with AAV9 coat proteins and packaged at BrainCase viral vector manufacturing facilities. The viral titers were approximately 3.3 × 1012 particles per milliliter for rAAV2/9-CaMKIIα-hM4D(Gi)-mCherry and 5.2 × 1012 particles per milliliter for rAAV2/9-CaMKIIα-jGCaMP7f. Sparse expression was achieved by injecting a mixture of diluted rAAV2/9-hSyn-Cre particles (original titer: ~1.3 × 1013 particles per milliliter, diluted 5,000-fold in sterilized phosphate-buffered saline) and high-titer, Cre-dependent GCaMP8s virus (rAAV2/9-hSyn-DIO-jGCaMP8s, 5.2 × 1012 infectious units per milliliter). Viral aliquots were stored in a light-protected freezer until use. Surgical procedures Mice were anesthetized with 1.5–2% isoflurane, and viral vectors were delivered to the ACC, M2, or S1 regions of the brain. A fitted plunger controlled by a hydraulic manipulator (Beijing Xinglin Life Tech., China) was inserted into a glass pipette to load and slowly inject 50 nL of viral vectors at a rate of 2 nL/5 s. Injections were performed bilaterally in the ACC at anteroposterior (AP) + 1.3 mm, mediolateral (ML) ± 0.3 mm, and dorsoventral (DV) −0.6 mm; bilaterally in S1 at AP −0.59 mm, ML ± 1.5 mm, and DV −0.4 mm; and unilaterally in M2 at AP 0.6 mm, ML ± 0.75 mm, and DV -0.5 mm. Following the injection, the microinjection needles were left in place for 10 minutes to allow viral diffusion and minimize the spread of viral particles along the injection tract. The pipette was then left in position for an additional 5 minutes before being slowly raised out of the brain. After 3 weeks of expression, the mice were anesthetized with 1.5% isoflurane for cranial window implantation. Analgesic compound lidocaine cream was applied to the skin 10 minutes before the surgical incision, and ophthalmic ointment was used to prevent eye drying. The body temperature was maintained at 36 °C using a feedback-controlled heating pad (FHC, USA). A craniotomy with a diameter of 4.3 mm was performed over either the ACC or M2, leaving the dura intact. A glass coverslip of matching diameter was placed over the cranial window, and the gap between the glass window and the skull was sealed with Vetbond (3 M, USA). After that, the isoflurane concentration was reduced to 0.5–1%. The miniBB2p, with a custom titanium baseplate attached, was adjusted relative to the glass window to find the target plane for free-moving imaging. The baseplate was then secured with dental acrylic, and a custom cover was placed on the baseplate, fixed with screws, to protect the cranial window when not in use. Before surgery and testing, the mice were handled and pre-trained in the recording environment until they were acclimated and foraged freely within the box. Mice handling and pretraining Mice were habituated to the experimental environment for 3 days prior to the locomotion test or free-moving imaging. During the same period, they also underwent daily handling sessions to acclimate to head-mounted procedures. Handling included gentle headcap pressing, back stroking, and holding the headcap firmly for approximately 10 seconds. Each session lasted 5–10 minutes and was designed to reduce stress and facilitate later dummy or real miniBB2p mounting in the awake state. All handling and behavioral procedures were conducted under simulated nighttime conditions. For the locomotion test, awake mice were fitted with a dummy miniBB2p (or not, for controls) and allowed to habituate to the experimental environment for 30 minutes. They were then gently transferred to the open field arena for a 5-minute exploratory adaptation, followed by a 30-minute free-movement recording session (EthoVision XT 16, 10 Hz sampling). For free-moving imaging, the real miniBB2p was mounted while the mice were awake, followed by a habituation period in the imaging chamber placed over a mesh table. Once the animal exhibited stable and naturalistic movements, imaging recordings were initiated. Imaging procedures At the beginning of each imaging session, the mice were head-fixed, and the miniBB2p was mounted on the baseplate. Behaviors of freely moving mice were recorded with a camera (MV-CS013-60GN, HIKROBOT) during the entire experiment. Initially, spontaneous neural activity was recorded while the mice habituated to the testing environment, freely exploring the 30 cm × 20 cm × 20 cm recording chamber without any experimenter-delivered sensory stimuli. For noxious stimulation, the plantar surface of the hind paw contralateral to the brain recording site was pricked with a 27-gauge needle (pin prick) while the mice were freely moving. The stimulation ceased upon the withdrawal of the paw. Non-noxious stimulation was delivered to the same hind paw using a 0.4 g von Frey filament. In most cases, there was no withdrawal response to the von Frey filament. Each recording session included approximately 10 trials with variable inter-trial intervals of around 30 seconds to prevent sensitization. Throughout the sessions, no signs of behavioral sensitization or physical damage to the paws were observed. Motion correction and image analysis To eliminate motion artifacts in the calcium imaging data from each session, piecewise non-rigid motion correction was applied using NoRMCorre28 or Flow-Registration29 (used in Supplementary Fig. 7). The motion-corrected 9 Hz calcium activity videos were saved as.TIFF files and subsequently used for cell identification. For C57BL/6 J mice injected with rAAV2/9-CaMKIIα-jGCaMP7f, calcium signals were extracted using Suite2P, which constrains the instances of calcium activity for each neuron30. The analysis produced three traces for each identified region of interest (ROI), corresponding to putative cell somata: the raw fluorescence signal Fcell(t), the neuropil fluorescence signal Fnp(t), and the deconvolved calcium activity E(t). Fcell(t) and Fnp(t) represent the weighted averages of activity within the ROI and the surrounding neuropil, respectively, excluding pixels overlapping with other ROIs. To correct for neuropil contamination, the neuropil signal was subtracted from the raw calcium signal using a fixed coefficient31, yielding the corrected signal: Fcorr(t) = Fcell(t) - 0.7 × Fnp(t). To mitigate the effects of slow fluctuations such as photobleaching on Fcorr, a running baseline F0(t) was extracted. The calcium activity was then expressed as the fractional change in fluorescence relative to the baseline ΔF/F, calculated as ΔF/F = (Fcorr(t) - F0(t))/F0(t). For VGAT-Cre transgenic mice injected with rAAV2/9-hSyn-DIO-jGCaMP8s, the calcium imaging data from VGAT+ cells were analyzed using the commercial image-analysis platform AIVIA 11.0 (DRVision Technologies LLC, Bellevue, WA) in conjunction with the Cellpose plugin. The segmentations from Cellpose were converted into masks for individual neurons, and the averaged fluorescence signal within each mask was used to calculate calcium transients. Locomotion test Custom-made dummy miniscopes (2.6 g) were utilized to assess the impact of miniBB2p on the behavior of mice during imaging. These dummies replicated the shape and weight distribution of the actual miniBB2p and were mounted onto implanted headbars, accompanied by one fiber and two cables. Twelve adult C57BL/6 mice (n = 6, 4 M/2 F, real implants with ACC cranial windows; n = 6, 3 M/3 F, sham implants with headbar-only) were co-housed (2–3 per cage) under a 12 h reversed light/dark cycle. All mice underwent two counterbalanced trial phases: a control phase involving open-field exploration in a white acrylic arena (97.6 cm × 45 cm × 38 cm) without attachments, and a dummy phase following the same procedure but with a mounted dummy miniscope. Each subject completed one trial type per 24 h cycle. Locomotor parameters, including total distance traveled, mean/median velocity, central zone entries, and distance distribution (central vs corner zones) were quantified using the EthoVision XT 16 tracking software. Brain slice preparation Mice were deeply anesthetized with isoflurane and then transcardially perfused with ice-cold phosphate-buffered saline (PBS) followed by paraformaldehyde (PFA). After extraction, the brains were fixed overnight in PFA. The fixed brains were then sectioned into 85 µm-thick slices using a vibratome (Leica VT1200S). These brain slices were mounted onto slides using a mounting medium containing DAPI (Solarbio, China) to preserve the fluorescence signal for long-term storage. Calcium response analyses For the pain stimulation experiments, trial-averaged calcium fluorescence traces were generated for individual neurons by z-scoring each trial from −5 to 5 seconds, with 0 indicating the time of stimulation. Z-scoring involved subtracting the mean and dividing by the standard deviation of a baseline period from −5 to −3 seconds prior to pinprick stimulation. The z-scored trials were then summed and divided by the total number of trials, resulting in a single trial-averaged calcium fluorescence trace for each neuron. To obtain a session-level analysis, trial-averaged calcium fluorescence traces from individual neurons were combined and averaged across all neurons, producing a single representative trace of neuronal activity. The peak calcium fluorescence for each neuron was identified within the post-stimulation window of 0 to 5 seconds. Each trial was z-scored as described and then binned into 1-second intervals. A 2-second moving window was applied to determine the maximum average calcium fluorescence for each trial. The peak values from all trials were then averaged to yield a singular value representing the peak post-stimulus activity of each neuron in a given session. To evaluate the effect of running on neural activity in M2, we binarized the behavior of the mice into running/resting states and compared their mean ΔF/F values for each neuron. The running modulation index (MI) is calculated as (ΔF/Frun - ΔF/Frest)/(ΔF/Frun + ΔF/Frest). A running onset was detected when a period of at least 400 ms of resting was followed by at least 400 ms of running24. For the investigation of neuronal response to running onsets, we inspected the ΔF/F responses with onsets that met two criteria simultaneously: (1) the onset had to be at least 10 seconds away from previous onset, and (2) the running episode had to last at least 1 second. This operation ensured that only well-separated and sustained running episodes were analyzed, minimizing the influence of transient or ambiguous movement signals. Chemogenetics Clozapine N-oxide (CNO; APExBIO, China) was prepared as a suspension in 0.9% saline, achieving a final concentration of 0.2 mg/mL. The solution was administered via intraperitoneal injection at a dose of 1 mg/kg. To activate the hM4D(Gi) DREADD, imaging was conducted 30 minutes following the systemic (intraperitoneal) injection of CNO. Behavior tracking The raw tracking video recorded during free-moving imaging was initially analyzed using DeepLabCut (DLC)32, which provided the positional data for specific body parts of the animal across each frame. Three key body parts were selected for analysis: the head, the body center, and the tail base. The DLC model was trained on a minimum of 20 frames, following the default training protocol, and underwent 30 thousand iterations. This training resulted in a final loss of approximately 0.003, with a training error of 1.48 pixels and a test error of 3.33 pixels. The animal’s position was recorded in x-y coordinates as x(t) and y(t). To smooth the positional traces, a low-pass filter was applied to both x(t) and y(t). The instantaneous movement speed was subsequently calculated by dividing the displacement of the head between consecutive frames by the time interval (1/frame rate), yielding a speed in centimeters per second (cm/s). Two-photon imaging was synchronized with the animal tracking camera in hardware, enabling precise temporal alignment between neuronal activity and behavioral tracking data. Calcium fluorescence traces were captured with the same number of frames as the tracking signals, ensuring that time points were pre-aligned across both datasets. Multi-day registration and cross-validation with a Gaussian-beam 2PM We recorded neuronal activity in vivo using miniBB2p and later acquired the high-resolution 3D morphological data from the same imaging volume using the tabletop Gaussian-beam 2PM with a 0.8 NA objective (CFI Apo NIR 40×, Nikon) on the same day. This paired acquisition protocol was repeated for the same imaging volume across multiple recording days. Cell registration across multiple recording days was performed using the ROIMatchPub MATLAB package (https://github.com/ransona/ROIMatchPub) after functional segmentation with Suite2p. The registration pipeline consisted of three main steps: (1) manual labeling of reference cells and landmarks across multi-day recordings, (2) automatic detection of potential cell matches based on a 50% overlap ratio threshold10, and (3) manual validation of matched cell candidates through morphological analysis to eliminate false positives. The registration reliability was further assessed through cross-validation between the 2D volumetric projections from miniBB2p with high-resolution 3D images from a tabletop Gaussian-beam 2PM. The 3D images were first segmented using Cellpose333, with subsequent refinement through AI-trainable segmentation in Imaris (v10.2) and manual verification based on morphological criteria. After that, the miniBB2p cell registrations generated by ROIMatchPub were systematically validated against their corresponding 3D segmented counterparts. Statistical tests For imaging data, paired neuronal recordings from a single session were compared using a two-tailed paired Student’s t-test, while unpaired data from separate sessions were analyzed using a two-tailed unpaired Student’s t-test. Changes in neuron populations before and after drug administration were assessed with a two-tailed Fisher’s exact test. To determine pain-responsive neurons, a one-tailed Wilcoxon rank sum test was conducted on pre- and post-stimulus values for all peripheral stimulations during pain stimulus sessions, with significance set at p < 0.025. A similar one-tailed Wilcoxon rank sum test was employed to identify the neurons that responded to running onsets by comparing calcium activity during resting and running periods. One-way repeated measures ANOVA with Tukey post hoc tests was used to assess the effects of photodamage in chronic recordings. Data processing Images were visualized and processed using the open-source software ImageJ. Unless stated otherwise, all images presented here were unprocessed raw images without smoothing, denoising, or deconvolution. “Green hot” lookup table in ImageJ was used for all miniBB2p captured images. Cross-section profiles, statistical graphs, and other coordinate graphs were drawn with Origin 2022, Graphpad Prism 9, and MATLAB (R2022b). All neural activities and behaviors were collected at 9 and 27 fps, respectively. The supplementary videos were made at 25 fps using Adobe Premiere Pro 2024. Reporting summary Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article. Supplementary information Supplementary Information Description of Additional Supplementary Files Supplementary Video 1 Supplementary Video 2 Supplementary Video 3 Supplementary Video 4 Supplementary Video 5 Supplementary Video 6 Reporting Summary Transparent Peer Review file Supplementary Information Description of Additional Supplementary Files Supplementary Video 1 Supplementary Video 2 Supplementary Video 3 Supplementary Video 4 Supplementary Video 5 Supplementary Video 6 Reporting Summary Transparent Peer Review file Source data Source Data Source Data