a Mouse V1 sparsely expressing the genetically encoded calcium indicator GCaMP7s was imaged through a cranial window in vivo, while the mouse was presented with 12 drifting-grating stimuli, each repeated for 10 trials. b (upper) Lateral images of a soma (Z = 390 µm) and (middle) axial images of its nearby dendrites measured without and with AO correction of Gaussian focus; (lower) Signal profiles along the dashed purple lines. Aberration measurement was performed using the soma. c Wavefront on pupil plane/SLM2 for aberration correction of Gaussian focus, after transmitted through the annular mask, and the computed focal-plane pattern on SLM1 for aberration-corrected Bessel focus. d Gaussian imaging stack from Z = 340 µm to Z = 400 µm color-coded by depth. e A single optical section (Z = 350 µm) image with Gaussian focus, measured without and with AO. f Bessel images of the same volume as in d, obtained without and with AO. g Trial-averaged calcium transients (n = 20 trials) evoked by 12 drifting-grating stimuli and corresponding tuning curves for one dendrite (D1) and three spines (S1–3), measured with Gaussian and Bessel foci, without and with AO, respectively. Only tuning curves that passed the statistical criteria for orientation selectivity were fitted (see “Methods”). Shadows and error bars: SEM. h Global orientation selectivity indices (gOSIs) for n = 91 active spines from the volume imaged by Bessel focus scanning without and with AO. Box-and-whisker plots: center line, median; box upper and lower limits, 25th and 75th percentile; whiskers, SD. Two-sided paired t-test, ***p < 0.001. i Cumulative distributions of gOSI. Kolmogorov–Smirnov test, p < 0.001. Post-objective powers: 108 mW for Gaussian and 97 mW for Bessel. Wavelength: 940 nm. AU arbitrary unit. Source data are available as a source data file.