Glutamate indicators with improved activation kinetics and localization for imaging synaptic transmission

The fluorescent glutamate indicator iGluSnFR enables imaging of neurotransmission with genetic and molecular specificity. However, existing iGluSnFR variants exhibit low in vivo signal-to-noise ratios, saturating activation kinetics and exclusion from postsynaptic densities. Using a multiassay screen in bacteria, soluble protein and cultured neurons, we generated variants with improved signal-to-noise ratios and kinetics. We developed surface display constructs that improve iGluSnFR’s nanoscopic localization to postsynapses. The resulting indicator iGluSnFR3 exhibits rapid nonsaturating activation kinetics and reports synaptic glutamate release with decreased saturation and increased specificity versus extrasynaptic signals in cultured neurons. Simultaneous imaging and electrophysiology at individual boutons in mouse visual cortex showed that iGluSnFR3 transients report single action potentials with high specificity. In vibrissal sensory cortex layer 4, we used iGluSnFR3 to characterize distinct patterns of touch-evoked feedforward input from thalamocortical boutons and both feedforward and recurrent input onto L4 cortical neuron dendritic spines.

The fluorescent glutamate indicator iGluSnFR enables imaging of neurotransmission with genetic and molecular specificity. However, existing iGluSnFR variants exhibit low in vivo signal-to-noise ratios, saturating activation kinetics and exclusion from postsynaptic densities. Using a multiassay screen in bacteria, soluble protein and cultured neurons, we generated variants with improved signal-to-noise ratios and kinetics. We developed surface display constructs that improve iGluSnFR's nanoscopic localization to postsynapses. The resulting indicator iGluSnFR3 exhibits rapid nonsaturating activation kinetics and reports synaptic glutamate release with decreased saturation and increased specificity versus extrasynaptic signals in cultured neurons. Simultaneous imaging a nd e lect ro ph ys iology at individual boutons in mouse visual cortex showed that iGluSnFR3 t r a ns i e nts r ep ort single action potentials with high specificity. In vibrissal sensory cortex layer 4, we used iGluSnFR3 to characterize distinct patterns of touch-evoked feedforward input from thalamocortical boutons and both feedforward and recurrent input onto L4 cortical neuron dendritic spines.
Glutamate is the most abundant neurotransmitter in the vertebrate brain, with approximately one glutamatergic synapse per cubic micrometer of neuropil 1,2 . Despite such close packing, synaptic glutamate signaling incurs little crosstalk 3 . Synapses achieve this spatial specificity partly through the kinetics and localization of ionotropic glutamate receptors. Glutamate is released when vesicles fuse to the presynaptic membrane, producing brief, localized concentration transients that are sensed by closely apposed postsynaptic glutamate Article https://doi.org/10.1038/s41592-023-01863-6 by lower-throughput assays to richly characterize variants without compromising library size.
In each round, the input population was diversified by error-prone PCR, recombination or site-directed mutagenesis. We screened each library in bacterial colonies (roughly 10 5 per round) under 2P (rounds [5][6][7][8] or one-photon (other rounds) excitation, selecting bright colonies to retain fast-maturing variants with high glutamate-bound brightness ([Glu] cytosolic ≅ 100 mM in Escherichia coli). For these variants (roughly 400 per round) we measured fluorescence spectra in clarified lysate before and after adding glutamate, retaining only those with large responses and desirable spectral properties. For 4-20 variants per round, we measured (in various rounds): affinity, pH response, quantum yield, extinction coefficient, 2P spectra, fluorescence correlation spectroscopy (FCS) and stopped-flow kinetics. In the final two rounds, winners from several previous rounds were displayed on cultured rat neurons 24 , where we measured brightness, membrane trafficking, bleaching and responses to field-stimulated APs using high-speed (180 frames per s) imaging. We selected iGluSnFR3.v857 ('v857', 15 mutations versus WT; Supplementary Note 3) for its high K fast , rapid on-cell kinetics, brightness, fractional fluorescence response (ΔF/F 0 ) and photostability (Figs. 1a-e and 2a-e). We selected the closely related variant iGluSnFR3.v82 ('v82', 13 mutations versus WT) for comparison, for its large one-AP response amplitude but kinetic properties less favorable for synaptic specificity.
As soluble proteins, v82 and v857 have less-saturating activation kinetics than WT, with estimated K fast values 6 and 33 times larger, respectively (Supplementary Note 1 and Fig. 1d,e). Both show increased fluorescence response to saturating glutamate (Fig. 1b,c), due largely to dimmer glutamate-free states (Extended Data Table 1), and have high specificity for glutamate over other neurotransmitters, amino acids and drugs (Extended Data Fig. 1). v857 has an SYG rather than GYG chromophore sequence (Supplementary Note 3), a blue-shifted fluorescence spectrum, larger glutamate-bound quantum yield, lower extinction coefficient, reduced pH sensitivity of the unbound state, reduced affinity in vitro, larger 2P action cross-section and higher 2P-excited molecular brightness measured by FCS (Extended Data Table 1 and Extended Data Figs. [2][3][4]. v857 exhibits strong quantum yield increase on glutamate binding, potentially useful for generating fluorescence lifetime indicators 25 . In cultured neurons, surface-displayed v82 and v857 traffic well (Fig. 2a), show larger responses to field-stimulated APs (Fig. 2b,d), larger dynamic range and lower glutamate affinity than WT (Extended Data Fig. 5). v82 has a slightly slower and v857 a slightly faster one-AP rise time than WT (Fig. 2c). v857 and v82 show higher time-integrated SNRs than WT in all conditions tested (Fig. 2e).
Together, these results identify v857 as a sensitive, selective iGluSnFR variant with rapid on-neuron kinetics and high K fast . v82 is a sensitive, selective variant with higher affinity, slower on-neuron kinetics, and lower K fast than v857: properties that should make it more responsive to extrasynaptic glutamate.

Imaging of synaptic signals in neuronal culture
We characterized sensitivity, spatial specificity and saturation by monitoring signals from spontaneous and evoked glutamate release at synapses between cultured neurons using widefield imaging. APs evoke synchronous release of varying numbers of vesicles per synapse. Additionally, spontaneous vesicle release produces asynchronous postsynaptic potentials (miniature release events, 'minis') typically corresponding to single vesicles 26,27 . With APs silenced (1 μM tetrodotoxin citrate (TTX)), synapses expressing v857 show large-amplitude asynchronous fluorescence transients ('optical minis' 14,15 ) (Supplementary Video 1 and Fig. 3a-c). As with electrophysiologically observed minis 27 , optical mini rates increase in hyperosmotic sucrose buffer ( Supplementary Fig. 1). The high photostability of v857 allowed continuous 15-minute recordings of receptors with low affinity and rapid activation kinetics 4,5 . Synaptic glutamate is quickly taken up by glutamate transporters, but some escapes the synaptic cleft and signals extra-synaptically via high-affinity receptors 3 . Methods are needed to measure distinct signals at many synapses in vivo to study the nature of dendritic integration, including how inputs are arranged 6,7 , mechanisms governing synaptic plasticity 8,9 and neuronal computation 10,11 . Such methods should have high sensitivity to monitor many synapses simultaneously deep in tissue over single trials, high spatial specificity to record from distinct synapses, low saturation to quantify release and fast kinetics.
The intensity-based Glutamate-Sensing Fluorescent Reporter (iGluSnFR) and its variants have been widely adopted to image synaptic activity, including spontaneous and evoked quantal release [12][13][14][15][16] , and extrasynaptic signaling 17,18 . However, existing iGluSnFR variants have low signal-to-noise ratio (SNR) in vivo, limiting how many synapses can be monitored simultaneously. Moreover, although experiments have bounded the spatial extent of iGluSnFR signals 10,13,[18][19][20][21] , these bounds are large. For example, SF-Venus-iGluSnFR.A184S signal correlations span 3.6 μm in vivo 18 , a volume containing roughly 30 glutamatergic synapses 1,2 . It is therefore unclear, from iGluSnFR measurements alone, whether a signal originates from a synaptic partner or a nearby unconnected axon. Measurements and simulations suggest that this large spatial extent is caused by saturation of ON rates 20,22 near release sites (Supplementary Note 1). The glutamate concentration that half-saturates ON rates, K fast , is distinct from K D , the concentration that half-saturates steady-state fluorescence. Experiments also suggested that iGluSnFR's membrane-display construct (PDGFR) has poor nanoscopic localization to postsynapses; signals are larger on axons than dendrites 20 and fusion to a postsynaptic protein increased signals of a low-affinity variant 13 .
We sought to engineer iGluSnFR variants with increased sensitivity and improved specificity for synaptic versus extrasynaptic glutamate signals. We performed 20 rounds of diversification and selection in bacteria (roughly 10 6 variants screened) and lysate (roughly 10 4 variants screened), with the final two rounds including assays in cultured neurons (roughly 10 3 variants screened), while selecting for kinetic and photophysical properties predicted to improve synapse-specific signals. With a selected variant, iGluS-nFR3.v857, we screened C-terminal membrane-display domains to identify variants with improved synaptic responses, then investigated their nanoscopic localization to postsynapses in vivo. We assessed saturation and synaptic specificity of iGluSnFR variants in neuronal culture by manipulating vesicle release and puffing glutamate onto neurons. In mouse cortex in vivo, we characterized responses to action potentials (APs) using simultaneous patch-clamp electrophysiology and imaging, and to awake whisker stimulation. Finally, we used iGluSnFR3 to compare spatiotemporal activity patterns of feedforward thalamocortical and recurrent inputs to layer 4 (L4), 400 μm below the pia. Thalamocortical boutons exhibit low-latency responses phase-locked to whisker stimulation, while L4 neuron spines in the same compartment each exhibit characteristic timings varying over tens of milliseconds, reflecting the timing distribution of recurrent inputs. The measurement of these distinct patterns on densely intertwined neuronal structures demonstrates the spatial specificity of iGluSnFR3 for synaptic versus extrasynaptic glutamate.

iGluSnFR3 engineering
We started our screen with SF-Venus-iGluSnFR-A184V (hereafter, wild-type, WT), a yellow variant with large two-photon (2P) cross-section 20 at wavelengths over 1,000 nm (ref. 23) and the highest K fast among superfolder variants (Supplementary Note 1). We evolved indicators through 20 rounds of mutagenesis and screening in bacteria, purified protein and cultured neurons (Supplementary Note 2). We used high-throughput assays to discard unwanted variants followed Article https://doi.org/10.1038/s41592-023-01863-6 optical minis without reduction in SNR (Extended Data Fig. 6). v82 detected fewer optical minis than v857, while WT detected far fewer still (Fig. 3d). Optical minis of v857 had a narrower spatial extent than those of v82 (Fig. 3d,e; minis of WT could not be characterized due to low SNR), indicating that v82 undergoes kinetic saturation during minis (Supplementary Note 1).
To further assess spatial specificity, we recorded single-AP responses in dense cultures where sparse neurons coexpressed iGluSnFR and a release site marker (Ruby-synapsin) (Fig. 3f). Using SF-iGluSnFR.A184V, numerous sites of functional signals lacked mRuby labeling, indicating crosstalk from nearby unlabeled axons, which was greatly reduced using v857 (Fig. 3g). To quantitatively assess crosstalk, we compared responses when expressing either iGluSnFR alone or both iGluSnFR and tetanus toxin light chain (TeNT). TeNT cleaves synaptobrevin, blocking vesicle fusion 28 (Supplementary Fig. 3). Axons coexpressing TeNT retained responses, likely corresponding to crosstalk. Amplitudes of crosstalk responses were greatly reduced in v857 + TeNT neurons (Fig. 3h,i) compared to v857 alone. In SF-iGluSnFR. A184V + TeNT coexpressing neurons, amplitudes were no smaller than SF-iGluSnFR.A184V alone.

Improved membrane-display constructs
The spatial specificity of glutamate transmission relies on nanoscopic localization of receptors to postsynaptic densities apposed to presynaptic active zones. However, electrophysiology and imaging studies suggested iGluSnFR may be excluded from postsynaptic densities 13 . We reasoned that display constructs with improved localization would show improved synaptic responses. We compared display sequences while assessing the amplitude, SNR and detection rate of optical minis. We did not try to localize iGluSnFR exclusively to postsynapses, which requires low expression levels, risking susceptibility to bleaching.
SnFR indicators are targeted to the outer membrane via insertion between an N-terminal IgΚ secretion leader sequence and C-terminal PDGFR transmembrane domain 19 . We compared v857 in this construct to 15 C-terminal variants including GPI anchors, transmembrane domains, cytosolic motifs and endoplasmic reticulum and Golgi export signals (Supplementary Table 1). Of these, two GPI anchors (GPI COBL9 , GPI NGR ) and a modified cytosolic fragment of Stargazin (SGZ) increased SNR of optical minis (Fig. 4a,b). These variants exhibited narrower  optical minis and improved surface trafficking as measured by ΔF/F on glutamate application ( Supplementary Fig. 4). A followup screen combining GPI COBL9 (henceforth, GPI) with 14 N-terminal leader sequences 31 resulted in no further improvement compared to the existing IgK leader ( Supplementary Fig. 4).
We next evaluated nanoscopic localization of these functionally improved constructs. We injected adeno-associated virus (AAV) encoding Cre-dependent SGZ, GPI and PDGFR variants of v857 into the cortex of Emx1-Cre mice. We performed expansion microscopy 32 with immunolabeling for green fluorescent protein (GFP) (iGluSnFR),   Bottom, zoom of soma (1) and neurites (2) with corresponding correlation images showing release sites. b, Traces for individual sites in the same recording, each normalized to its standard deviation (s.d.), ordered by SNR. Sites ranked 1-20 and 491-500 are shown. The bottom shows a zoom of region highlighted in cyan above. c, Detected site density, event rate and SNR for WT and iGluSnFR3 variants expressed using hSyn.minDisplay. n = 9 FOV (v82 and v857); 8 FOV (WT), three culture wells per variant. Boxplots show mean (black line), 25th-75th percentile (box), 5th-95th percentile (whiskers), remaining points individual. *P < 0.01, two-sided Wilcoxon test versus WT. d, Kymographs of optical minis for v82 (left n = 96 sites) and v857 (right n = 2,862 sites). Scale bars, 100 ms. e, The left shows the optical mini ΔF/F 0 as a function of distance from peak for v82 and v857, calculated one frame after onset. The right shows the optical mini ΔF/F 0 as a function of time for v82 and v857, calculated one pixel from the center. n = 96 sites, v82; n = 2,862 sites, v857. Shading denotes s.e.m. d 1/2 is the distance to halfmaximum response. FWHM, full-width at half-maximum. **P < 1 × 10 −4 , bootstrap test (two-sided). f, Overlaid transmission (grayscale) and fluorescence images of sparsely transfected iGluSnFR+mRuby-synapsin culture. g, Representative mRuby-synapsin image (left) and iGluSnFR response (five APs at 50 Hz, right) for SF-iGluSnFR.A184V (top) and v857 (bottom). White arrows indicate putative crosstalk sites. h, Representative ΔF/F 0 of SF-iGluSnFR.A184V and v857 for one-AP field stimulation at bath [Ca 2+ ] of 1.  Bassoon (presynapse) and Homer1 (postsynapse) (Fig. 4c). For all variants, anti-GFP labeling was heterogeneously distributed within the membrane. However, reduced labeling of postsynapses specifically in PDGFR-labeled neurons was clearly observed in aligned average images over all identified synapses (Fig. 4d). Postsynaptic localization, that is, the ratio of anti-GFP signal at the synapse center to that within a 3 × 6 μm (expanded) postsynaptic region, was increased for GPI and SGZ constructs (Fig. 4e).
These results identify motifs that increase the SNR of synaptic signals, improve trafficking in cultured neurons, and improve iGluSnFR's postsynaptic localization in vivo.

In vivo iGluSnFR3 imaging and electrophysiology
We next characterized iGluSnFR3 signals in mouse visual cortex. We observed strong signals in mice injected with AAVs encoding v857.GPI or v857.PDGFR variants, including 1-photon widefield recordings during visual stimulation ( Supplementary Fig. 5), 2P recordings of spines and boutons (Supplementary Video 2), and increased photostability relative to WT (Extended Data Fig. 7). Although immunolabeling of virally expressed SGZ indicated strong expression and good membrane localization in mouse cortex (Fig. 4c,d), and bright expression and functional signals in rat cortical culture, SGZ exhibited dim native fluorescence and weak functional responses in mouse cortex ( Supplementary  Fig. 4). We therefore performed all remaining in vivo experiments with the PDGFR and GPI variants.
Glutamate imaging is a promising approach for studying synaptic activity in the intact brain 10,18,20,33 but the relationship between in vivo iGluSnFR signals and synaptic activity, such as presynaptic APs, remains incompletely characterized. We therefore imaged individual boutons on axons of individual sparsely labeled glutamatergic neurons during simultaneous cell-attached electrophysiological recordings from the parent cell bodies. Layer 2/3 pyramidal neurons in mouse primary visual cortex were electroporated with plasmids encoding either v857.GPI or SF-iGluSnFR.A184S. Cell-attached recordings and     concurrent 2P imaging at 500 Hz frame rate were performed in lightly anesthetized, head-fixed mice (Fig. 5a,b). Boutons of v857-expressing neurons exhibited larger and faster one-AP-associated transients than those expressing SF-iGluSnFR.A184S (Fig. 5c,d). To quantify synaptic specificity, we compared transient amplitudes associated with single electrophysiologically observed APs to those not associated with APs. v857 showed a greater difference in these amplitudes than A184S (Fig. 5e). Using an amplitude threshold on denoised traces, 70% of presynaptic APs were detected with v857 at a false positive rate of 0.2 Hz, while 70% of presynaptic APs were detected with SF-iGluSnFR.A184S at a false positive rate of 3.7 Hz (Fig. 5f). At this threshold, we attribute most APs undetected by v857 to failures of synaptic release, since measurement noise was far lower than the variability in single-AP event amplitudes. We measured amplitude distributions of AP-associated fluorescence transients collected from each of three adjacent boutons during 1.5 min of continuous optical and electrophysiological recording ( Fig. 5f,g). We next recorded from dendrites while presenting visual motion stimuli to lightly anesthetized mice (Fig. 5h). v857 reported direction-tuned responses more localized to dendritic spines and of larger amplitude than those reported by SF-iGluSnFR.A184S (Fig. 5i-k).

Imaging ascending and recurrent inputs to barrel cortex L4
We next used iGluSnFR3 to study feedforward and recurrent inputs to vS1, the primary vibrissa (whisker) sensory cortex. Rodents rhythmically  sweep their vibrissae to sense objects through touch 34 . Signals ascend from vibrissal follicles through ventral posteromedial (VPM) thalamus, then to L4 of vS1, where each vibrissa is represented by a column of neurons forming a characteristic 'barrel' structure. L4 excitatory cells within a barrel receive about 10% of their excitatory input from thalamocortical projections 35 , with most remaining (recurrent) connections originating from other L4 excitatory cells in the barrel 36,37 . The depth of L4 (roughly 350-450 μm) and the small synapse volume (<1 femtoliter) are challenges for measuring precisely timed synaptic activity, which we overcame using iGluSnFR3's high SNR and direct wavefront sensing adaptive optics 2P (AO2P) microscopy 33 .
We expressed iGluSnFR variants in thalamocortical axons by injecting AAV into VPM (Fig. 6a). Thalamic boutons in L4 of awake, head-fixed mice showed large-amplitude transients induced by vibrissal touch during active whisking (Extended Data Fig. 8). To quantify thalamocortical responses across frequencies, we used air-puff stimulation (Fig. 6b) in awake mice ( Fig. 6c and Supplementary Fig. 6 and Extended Data Fig. 9). Rhythmic stimulation from 2-30 Hz produced time-locked rapid-onset responses (Supplementary Video 3) that were characterized for five iGluSnFR variants across stimulation frequencies (Fig. 6d,e; 1,609 individual boutons, 13 mice). v857 showed greater modulation than SF-iGluSnFR variants at all frequencies, over twofold greater than SF.iGluSnFR.A184V and fivefold greater than WT for 2-20 Hz stimulation rates. Using v857, our AO2P microscope sampling at 125 Hz resolved single-trial responses at rates ≤15 Hz with SNR above 1.
We expressed v857.GPI in L4 dendrites by injecting Cre-dependent AAV into vS1 of Scnn1a-Cre mice 38 . We recorded spine responses (Fig. 6f), which should predominantly reflect recurrent input, while stimulating vibrissae at 5 Hz (Supplementary Video 4). Spine responses each showed characteristic lags differing across synapse pairs by up to 70 ms (ref. 39) (Fig. 6g,h). Similar comparisons across 123 thalamocortical boutons from two mice showed no time lag differences ( Fig. 6i-k). As a population (145 dendritic spines from two mice), the lags of recurrent connections are broadly distributed with an average delay within L4 of 17 ms (Fig. 6l). The absence of heterogeneous time lags for the dense network of axons imaged in VPM-labeled mice further demonstrates the high specificity of v857 for synaptic versus extrasynaptic signals in vivo.

Discussion
Glutamate imaging has long promised to complement dendritic Ca 2+ imaging for recording spatially resolved synaptic inputs. Dendritic Ca 2+ imaging reports postsynaptic signals governed largely by (nonlinear) N-methyl-d-aspartate (NMDA) receptor activation at spines 40 , but which are less-studied at nonspiny synapses and spatially mixed by propagating potentials and dendritic spikes 7 . Glutamate imaging avoids these confounds for studying spatial arrangements of inputs and their correlations, but imaging membrane signals demands especially sensitive and photostable indicators 41 , and exhibits confounds of synaptic crosstalk and kinetic saturation. iGluSnFR3 was engineered to improve all these properties.
Several limitations remain for iGluSnFR. As with previous generations, color variants are needed for multiplexing and affinity variants for different cells or compartments 20 . For measuring absolute analyte concentrations, fluorescence lifetime is more suitable than intensity contrast 25 . Achieving high spatial specificity with noncooperative indicators such as iGluSnFR requires high imaging speeds (Supplementary Note 1), whereas cooperative indicators could achieve this at lower frame rates. Although faster than WT, iGluSnFR3.v857 on-cell kinetics are slower than synaptic glutamate dynamics, and high-sensitivity variants of faster indicators (for example, iGlu u (ref. 22), SF-iGluSnFR.S72A (ref. 20) are needed. The SGZ and GPI sequences reduce postsynaptic exclusion of iGluSnFR and improve spatial specificity but the SGZ construct performed poorly in vivo. Further evaluation of display sequences may yield yet better localization and function in vivo. Work is also needed to evaluate glutamate buffering effects on endogenous signaling 42 .
iGluSnFR3 provides advantages over previous methods. Its low kinetic saturation enables more quantitative measurements previously confounded by saturation effects. Its reliable detection of single electrophysiologically identified APs in vivo improves interpretation of signals and may facilitate in vivo studies of release parameters. Its SNR, kinetics and spatial specificity allow recording from populations of synapses while resolving milliseconds-differences in the timing of individual inputs. These capabilities will allow observation of synaptic dynamics underlying theories of neuronal computation and learning 9,11,43 .

Online content
Any methods, additional references, Nature Portfolio reporting summaries, source data, extended data, supplementary information, acknowledgements, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at https://doi.org/10.1038/s41592-023-01863-6. Line indicates root-mean-square (r.m.s.) noise level for v857.GPI. ***P < 0.001; NS, not significant; one-way analysis of variance followed by Bonferroni's test. f-h, Measurement of response lags for v857.GPI-labeled L4 spines to 5 Hz vibrissal stimulation. f, Mean (left) and s.d. (right) images of L4 v857.GPI-labeled spines. Scale bar, 10 μm. g, The left shows a cross-correlation of signals from two active spines highlighted at right. The right shows a pixelwise lag of peak response relative to the recording's dominant mode. h, Time series from spines identified in g with a representative trial in gray and mean in black. i-k, Same as f-h for thalamocortical boutons labeled with v857.GPI: mean and s.d. images scale bar, 10 μm (i), correlation and spatial coherence (j) and time series (k). I, Lag of peak response for thalamocortical boutons (123 ROI) and dendritic spines (145 ROI

Construction of mammalian expression vectors
To express sensors on the cell surface, iGluSnFR coding sequences were PCR amplified from the bacterial expression (pRSET) constructs, followed by Gibson assembly into pAAV.hSyn (or Cre-dependent pAAV.hSyn.FLEX) vectors, into which the N-and C-terminal flanking sequences (IgK leader and surface display sequence) were first inserted. For the development of the display constructs library, the N-terminal leader or C-terminal surface display sequence was substituted using Gibson assembly. Recombinant AAV particles (rAAVs) were prepared by Viral Tools at Janelia according to their standard protocol. A list of iGluSnFR variants used in each experiment is presented in Supplementary Table 2.

Construction of display construct library
Synthetic DNA consisting of different N-terminal secretion peptides and C-terminal anchoring domains were codon-optimized for Mus musculus and ordered as gene blocks from Integrated DNA Technologies (IDT). The fragments were PCR amplified and inserted into a pAAV.hSyn iGluSnFR vector via Gibson assembly. For the insertion of N-terminal secretion peptides, the vector backbone was created by digesting the pAAV.hSyn.iGluSnFR gene with NheI and BamH1 to cut out IgK sequence and substituting the new fragments. For C-terminal anchors, the iGluSnFR gene was digested with PstI and HindIII, to cut out PDGFR and substituting the other anchors. The C-terminal libraries were cloned in combination with IgK as N-terminal secretion peptide, and N-terminal secretion peptide libraries were cloned with GPI COBL9 as the C-terminal anchoring domain. The C-terminal domains were selected from among sequences previously shown to improve secretion and membrane trafficking, and transmembrane domains from single-pass transmembrane proteins present in postsynaptic densities. Sequences and references are presented in Supplementary Table 1.

Bacterial colony and lysate measurements
iGluSnFR variants in soluble form in pRSET vector (Thermo Fisher Scientific) were transformed via electroporation into competent E. coli bacteria and plated. Fluorescence was excited with 488 nm light on an LED light

Protein purification and in vitro characterization
pRSET bacterial expression vector (Thermo Fisher Scientific) encoding the soluble form of the iGluSnFR protein of interest fused to an N-terminal 6-His tag was chemically transformed into E. coli strain T7 Express Competent E. coli (New England Biolabs). A 4 ml culture containing LB + 100 μg ml −1 ampicillin, inoculated with a single bacterial colony, was grown overnight (37 °C, 250 rpm) before being diluted into 500 ml of Studier's autoinduction medium (ZYM-5052). The culture was grown at 30 °C, 250 rpm for 30 h before cells were collected by centrifugation (8,000g for 10 min). The resulting lysate was purified using Ni-NTA chromatography using HisPur Ni-NTA beads (Thermo Fisher Scientific), and dialyzed using Slide-A-Lyzer dialysis cassettes (Thermo Fisher Scientific) with PBS for 24 h. Glutamate-saturated and nominal glutamate-free measurements were performed in 100 mM glutamate in PBS and PBS only, respectively. Glutamate titrations were performed using a series of serially diluted buffers. The fluorescence measurements were fit with a Hill equation: where F 0 and F max are fluorescence without glutamate and with saturated glutamate, respectively, and n is the Hill coefficient. Observed apparent Hill coefficients were in all cases 1 ± 0.2. pH titrations were performed by making a series of 100 mM glutamate in PBS buffers and PBS only buffers with varying pH ranging from 5 to 9 (pH adjusted using concentrated HCl and NaOH). Fluorescence intensities as a function of pH were measured in both glutamate-saturated and glutamate-free states, and fitted with a sigmoidal binding function to determine the apparent pKa and apparent ΔF/F as a function of pH. The sigmoidal binding function used was fit using Graphpad Prism v.8 software: the parameters F max and F min are limit brightnesses at high and low pH, and pKa is the apparent pK a of the indicator. All terms were free parameters except pH and F. ΔF/F 0 was computed using the raw fluorescence (F) values of glutamate-bound and glutamate-free state with respect to pHs between 5 and 9:

One-photon photophysical measurements
One-photon fluorescence intensity spectra in presence and absence of glutamate were obtained using the Tecan Infinity M1000 plate reader. Excitation scans were performed from 460 to 530 nm (emission set at 550 nm, bandwidth 10 nm, step 2 nm), emission scans were performed from 500 to 600 nm (excitation set at 480 nm, bandwidth 10 nm, step 2 nm). Fluorescence intensities for glutamate titrations were obtained by exciting at 510 nm and collecting at 530 nm (bandwidth 10 nm). The extinction coefficient was determined using the alkali denaturation method, determining the denatured chromophore concentration using the extinction coefficient of denatured GFP as a reference (44,000 M −1 cm −1 at 447 nm). The extinction coefficient was computed by dividing the absorbance in nondenatured state by the calculated chromophore concentration. Absolute quantum yield measurements were performed using a Quantaurus-QY spectrophotometer (Hamamatsu Photonics), for purified proteins in PBS (APO condition) and 20 mM glutamate (SAT condition). Quantum yield measurements were made using default settings of the device, exciting between 470 and 510 nm. The quantum yield at 490 nm excitation is reported.

Stopped-flow kinetics
Measurements of ON kinetics were made using an applied Photophysics SX20 Stopped-flow Reaction Analyzer using fluorescence detection, exciting at 505 nm and detecting with a 520 nm long pass filter, mixing equal volumes of dilute purified indicator protein and PBS + glutamate buffer. Measurements were performed at room temperature (22 °C). Recorded intensity traces were fit in MATLAB; code is available in the code and data package. At least three replicates per concentration were averaged, and a monoexponential saturation curve was fit to the average trace. The duration of the recording fit was from 1 ms (the mixing time of the instrument) to 4 × t 90 , where t 90 is the time at which intensity increased to 90% of its maximum (Supplementary Fig. 7). The rate-concentration relationship was then fit to the three-state model using MATLAB's fit function. Errors of fit were computed from the fit objects using the MATLAB built-in confint function.

2P photophysical measurements
The 2P measurements were carried out on protein solutions (2-4 μM) in PBS with 0 mM (apo) and 100 mM (sat) added glutamate, using an inverted microscope (IX81, Olympus) equipped with a ×60, 1.2 NA water immersion objective (Olympus). Excitation was performed with an 80 Mhz Ti-Sapphire laser (Chameleon Ultra II, Coherent) to collect 2P excitation spectra from 710 to 1,080 nm. Fluorescence collected by the objective was passed through a shortpass filter (720SP, Semrock) and a bandpass filter (550BP200, Semrock), and detected by a fiber-coupled Avalanche Photodiode (SPCM_AQRH-14, Perkin Elmer). The brightness spectra were normalized for 1 μM concentration and further used to obtain action cross-section spectra with fluorescein as a reference. FCS was used to obtain the 2P molecular brightness of the iGluSnFR3 soluble proteins at 950 and 1,030 nm, as described in ref. 46. Briefly, the peak molecular brightness was defined by the rate of fluorescence obtained per total number of emitting molecules. Here, 50-200 nM soluble iGluSnFR protein solutions were prepared in 100 mM glutamate PBS buffer and excited with 960 and 1,030 nm wavelength at powers ranging from 2-30 mW for 200 s. The obtained fluorescence was collected by an Avalanche Photodiode and fed to an autocorrelator (Flex03LQ, Correlator.com). The obtained autocorrelation data were fit to a diffusion model to determine the number of molecules <n> present in the focal volume. The 2P molecular brightness (ε) at each laser power was calculated as the average rate of fluorescence <F> per emitting molecule <n>, defined as ε = <F>/<n> in kilocounts per second per molecule.

Preparation of neuronal culture
Neonatal (P0) Sprague-Dawley (Charles River) rat pups were used regardless of sex. Pups were euthanized, then cortical and hippocampal tissue was dissected and dissociated in papain enzyme (Worthington Biochemicals, roughly 35 U per cortical and hippocampal pair) in neural dissection solution (10 mM HEPES pH 7.4 in Hanks' Balance Salt Solution) for 30 min at 37 °C. After 30 min, enzyme solution was aspirated out and tissue pieces were subjected to trituration in 10% fetal bovine serum containing modified Eagle medium. Following trituration, cell suspension was filtered through a 40 μm strainer and the resulting single-cell suspension was centrifuged. Cell pellet was resuspended in plating media (28 mM glucose, 2.4 mM NaHCO 3 , 100 μg ml −1 transferrin, 25 μg ml −1 insulin, 2 mM l-glutamine and 10% fetal bovine serum in modified Eagle medium) and cell counts were taken. Electroporation was conducted using the Lonza/Amaxa 4D nucleofector according to the manufacturer's instructions, using 500 ng of plasmid and 5 × 10 5 viable cells per transfection. Transfected cells were then seeded into three replicate wells in poly-d-lysine-coated glass-bottom 24-well plates or 35 mm dishes, and cultured at 37 °C with 5% CO 2 . Cultures were fed twice a week by replacing 50% of the medium with fresh NbActiv.

Glutamate titrations in neuronal culture
Experiments were performed with rat hippocampal and/or cortical primary cultures as described above. Fourteen days posttransfection, culture medium was exchanged with 1 ml of imaging buffer solution (145 mM NaCl, 2.5 mM KCl, 10 mM glucose, 10 mM HEPES, 2 mM CaCl 2 , 1 mM MgCl 2 , pH 7.3). Glutamate-free apo widefield images were taken at the center of each well using a Nikon Eclipse microscope (×20, 0.4 NA, 505 nm excitation, 525/50 emission). Glutamate-saturated widefield images were taken at the same FOV after the addition of 100 μl of 100 mM extracellular glutamate in imaging buffer (100 mM glutamate, 145 mM NaCl, 2.5 mM KCl, 10 mM glucose, 10 mM HEPES, 2 mM CaCl 2 , 1 mM MgCl 2 , pH 7.3). On-membrane glutamate titrations were performed by exchanging the culture medium with 1 ml of imaging buffer solution containing varying concentrations of glutamate. A scalar constant background was first subtracted from all images. We quantified full-field ΔF/F for each FOV as: (mean brightness of SAT image)/(mean brightness of APO image) − 1.

On-cell kinetics in neuronal culture
iGluSnFR3 variants were transfected in mixed hippocampal and neocortical primary cultures as described above. Imaging was performed 13-15 days posttransfection. Culture medium was exchanged with imaging buffer containing 2 μM TTX. Glass pipettes (approximate resistance 5-7 MΩ) were pulled using a P-1000 puller (Sutter instruments). Pipettes were filled with imaging buffer containing 3, 30 or 300 μM Glutamate and connected to a pressure ejector (Picospritzer

Nature Methods
Article https://doi.org/10.1038/s41592-023-01863-6 III; Parker). For each puff, pressure was set to 20 PSI and duration to 3 s. An external trigger was used to initiate a puff after 2 s of baseline imaging. After each puff an intertrial interval was imposed of at least 2 min. Videos were recorded for 7 s at 666 frames per s with 128 × 128 px per frame using a Nikon Eclipse microscope (×20, 0.75 NA, 505 nm excitation center wavelength, 525/50 nm emission band). Recordings were corrected for bleaching by fitting a biexponential curve to the intensity during the 2-s baseline period. ΔF/F was then computed over the 50-frame period following puff onset, and a region of interest (ROI) selected as a circle of 2 μm radius centered over the pixel with largest ΔFF following Gaussian smoothing in space. Traces were extracted for the ROI in each cell, and a monoexponential saturating curve was fit to each. To remove occasional outliers with slow rates likely due to a misalignment of the pipette and cell, traces with rate constant less than 80% of the median rate constant across cells were discarded.

Imaging optical minis
iGluSnFR3 variants were transfected in mixed hippocampal and neocortical primary cultures from neonatal (P0) rat pups. Then, 14 days posttransfection, culture medium was exchanged with 1 ml of hyperosmotic buffer containing sucrose (100 mM sucrose, 145 mM NaCl, 2.5 mM KCl, 10 mM glucose, 10 mM HEPES, 2 mM CaCl 2 , 1 mM MgCl 2 , pH 7.3). Next, 2 μM of TTX (diluted in deionized water) was added to each culture medium to silence the firing of APs. Videos were recorded for 60 s at 100 frames per s across three FOV per well using a Nikon Eclipse microscope (×60, 1.4 NA, 505 nm excitation center wavelength, 525/50 nm emission band). Additional experiments (Extended Data Fig. 5 and Supplementary Fig. 1) were performed with a spinning disk confocal microscope (Nikon TiE, Yokogawa CSU-X1) with temperature-controlled sample chamber (37 °C) and focus-locking mechanism for longer-duration recordings. Primary cultures were plated on 35 mm MatTek dishes, and imaged in the same imaging buffer. We recorded for 15 min continuously at each FOV. The recordings were split into 3-min segments due to memory constraints, and processed in a similar manner to the widefield recordings, as described below, with an additional step to remove periodic noise associated with spinning disk illumination.

Analysis of optical minis
Analysis of optical minis was automated using a constrained nonnegative matrix factorization (NMF) framework with spatial components initialized from a correlation image (inspired by refs. 47,48). The NMF model describes a video as a set of spatial footprints, each of which varies over time. The spatial footprints and their activities are all nonnegative. To perform factorization in a memory-efficient manner, each recording was first downsampled twice in each spatial dimension and eight times in time by binning. F 0 was then computed per pixel and subtracted from the video to generate a downsampled baseline-subtracted video. A correlation image was computed where each pixel value is the mean correlation between that pixel and its four-connected neighbors across time, after highpass filtering the video at 8 Hz. NMF was performed on the downsampled baseline-subtracted video using a multiplicative updates algorithm, subject to constraints on the contiguity and sparsity of spatial components. The spatial factors were initialized as 2D gaussians (σ = 530 nm) with a spatial extent of 2.8 × 2.8 μm, with no support outside this extent. A factor was added at each local maximum in the correlation image that exceeded a threshold value. An additional 20% of spatial factors were added to model background; these were not spatially constrained during optimization. Following factorization, spatial factors were merged if they were immediately adjacent or overlapping in space and had a Spearman rank correlation in time of at least 0.25. The spatial factors were then upsampled to the original spatial resolution and a final 20 rounds of multiplicative updates were performed on the full-resolution (space and time) data to generate a high-resolution factorization. From the resulting factorizations we computed the SNR and the detected event frequency of each site. The SNR was defined as the amplitude of the third-largest peak in the highpass-filtered signal over the 1-min duration of the recordings used for screening, divided by the standard deviation of noise estimated from the trace power spectrum. Detected event frequency was defined as the number of peaks exceeding three standard deviations of the noise. Detected site density is the number of detected sites with SNR > 3 per unit area.
To produce kymographs (Fig. 3d) and calculate spatial extent of minis (Fig. 3e), the NMF-derived ΔF/F 0 time series at each site was highpass filtered and events detected by threshold crossing (three times the standard deviation of the highpass-filtered trace, or 0.2, whichever was greater). The center of each event in time and space was then detected in the original high-resolution video smoothed with a 2.5 pixel Gaussian filter. Events were only retained for analysis if (1) the signal returned to baseline with 3 s, (2) a significant signal (more than 2 s.d. above mean) was observed in the region just outside the smoothing radius (400-800 nm) and (3) the detected peak was the largest signal in the immediate spatiotemporal window (−0.2-0.3 s, 2 μm in space). Because the 1.4 NA objective used has a narrow depth of field, some events are out of focus. To reject out-of-focus events, images were analyzed for spatial extent and the highest-resolution quartile were retained for each condition. Results were similar when retaining the top 50%. Raw images were binned by distance from the spatial center of the event and averaged, then F 0 was calculated as the mean fluorescence within a 200 ms period before event onset, to compute ΔF/F 0 kymographs. The distance plot (Fig. 3e) is the mean ΔF/F 0 at the frame after event onset for each indicator. The spatial extent d 1/2 was calculated as the distance over which the mean ∆F/F 0 dropped below half of the measured maximum (the pixel to which responses were aligned was censored to avoid selection bias). The bootstrap statistic was calculated by randomly resampling each population with replacement and calculating d 1/2 for each group, and comparing the result for the two indicators. See spatialAnalysis.m and summarizeSpatialAnalysis.m on Figshare (https://doi.org/10.25378/janelia.21985406) 49 .

Manipulations of synaptic release
Hippocampal CA1-CA3 regions were dissected with dentate gyrus removed from P1 Sprague-Dawley rats of either sex (mixed litter), dissociated (bovine pancreas trypsin; 5 min at room temperature) and plated on polyornithine-coated coverslips (Carolina Biological; item 633095; 22 × 22 × 0.17 mm borosilicate glass) inside a 6 mm diameter cloning cylinder (Ace Glass) as previously described 50 . Calcium phosphate transfection was performed on 5-day-old cultured neurons with plasmids encoding iGluSnFR variants, or for TeNT experiments, the same concentration of iGluSnFR-encoding plasmid plus a plasmid encoding TeNT 51 . Treatment and control cultures (for example + and −TeNT) for each experiment were paired, that is, used the same batches of neurons, plated and transfected at the same time, and cultured in the same incubator. Experiments were performed at 35 °C using a custom-built objective heater. Coverslips were mounted in a rapid-switching, laminar-flow perfusion and stimulation chamber on the stage of a custom-built laser microscope. The chamber had a width of 8 mm, a length of 10 mm and a height of 2 mm with two platinum electrodes was used for perfusion and stimulation. Then 1 ms pulses of 35 mA were passed across the electrodes to trigger APs. The total volume of the chamber was roughly 150 μl and was perfused at a rate of 400 μl min −1 . During imaging, cells were continuously perfused in a standard saline solution containing the following in mM: 119 NaCl, 2.5 KCl, 2 CaCl 2 , 2 MgCl 2 , 25 HEPES, 30 glucose, solutions were supplemented with 10 μM 6-cyano-7-nitroquinoxaline-2,3-dione (Alomone) and 5-phosphono-d-norvaline, d-norvaline, 5-phosphono-, d(−)-APV, d-2-amino-5-phosphonovaleric acid, d-2-amino-5-phosphopentanoic acid and d(−)-AP-5 (Alomone). For measuring exocytosis, neurons transfected with iGluSnFr variants were illuminated by a 488 nm laser (Chroma) through a Zeiss EC Plan-Neofluar ×40 1.3 NA Objective. iGluS-nFr fluorescence emission was collected through an ET525/50 m filter (Chroma) and captured with an IXON Ultra 897 electron multiplying charge coupled device (EMCCD) (Andor). iGluSnFr fluorescence was collected with an exposure time of 9.83 ms and images were acquired at 100 Hz. pHluorin-transfected cells were imaged under the same conditions as iGluSnFR variants, except with 8 mW of illumination intensity. Stimulation for firing APs for evoked vesicle fusion were evoked by passing 1 ms current pulses, yielding fields of roughly 12 V cm −2 using platinum and iridium electrodes. Spontaneous release was easily identified by eye in absence of stimulation. Images were analyzed in ImageJ (http://rsb.info.nih.gov/ij) by using custom-written plugins (http://rsb. info.nih.gov/ij/plugins/time-series.html). GluSnFR measurements were made from manually selected ROI (2 μm diameter) drawn at individual responsive boutons on isolated axons, then averaged across sites for each cell. Boutons were identified as spots that had robust punctate responses to a stimulation train of five field-stimulated APs delivered at 50 Hz (to help find both high and low release probability presynaptic terminals). Fewer than 5% of responsive areas of the axon were discarded as a result of having responsive boutons too close with merging fluorescence responses. This analysis of individual release sites differs from previous analyses of larger areas of mixed neurites 20 . Individual cells were treated as the unit of variability; analysis of variance indicated no effect of culture batch on response amplitudes.

Neuronal culture screen
Details on culture screening and analysis are provided in Supplementary Note 2. iGluSnFR variants were cloned into a mammalian expression vector and nucleofected into hippocampal and/or cortical primary cultures prepared as described above. Imaging was performed in poly-d-lysine-coated 96-well glass-bottom plates. Fourteen days posttransfection, culture medium was exchanged three times with 500 μl of imaging buffer (145 mM NaCl, 2.5 mM KCl, 10 mM glucose, 10 mM HEPES, 2 mM CaCl 2 , 1 mM MgCl 2 , pH 7.3) and imaged in 75 μl of imaging buffer and drug cocktail to inhibit synaptic transmission (10 μM CNQX, 10 μM (R)-CPP, 10 μM gabazine, 1 mM (S)-MCPG (Tocris)). Neurons were field stimulated with 1 and 20 pulses at 83 Hz, and imaged with a ×10 objective using an EMCCD camera (Hamamatsu Orca Fusion C13440-20C, 1,024 × 1,024, center quad, 5.5 ms exposure, 182 Hz, 798 frames). Illumination was delivered by blue light (470/40 nm, Cairn Research Ltd; emission 525/50 using GFP filter cube). The approximate light density used was 0.34 mW mm −2 at 470 nm. Stimulation pulses were synchronized with the camera using data acquisition cards (National Instruments), controlled with Wavesurfer v.1.0.6 software (https:// wavesurfer.janelia.org/). Imaging was performed at room temperature. Time-integrated SNR (Fig. 2e) was calculated by integrating the photon response over the duration that it exceeded the baseline (mean response over 80 samples before stimulus onset), and dividing by the shot noise associated with the baseline brightness over that period (that is, the square root of the integrated baseline).

2P-excited bleaching measurements in vivo
To investigate photobleaching properties of new iGluSnFR variants in vivo, we imaged dendrites of excitatory cortical neurons in the visual cortex of C57BL/6J mice ( Jackson Laboratory), without regard to sex. Viral injections (100 nl, 250 μm below brain surface) in 8-week old mice were performed followed by implantation of a 4 mm cranial window, as described previously 18 . Imaging was performed on a customized AO2P based on a Thorlabs Bergamo II microscope 3-6 weeks after injection. Excitation was provided from a Coherent Discovery NX TPC. The objective was a Olympus XLUMPFLN objective, ×20, 1.0 NA. A FOV of 133 × 67 μm was scanned at 156 Hz for the bleaching experiments. Emitted light was filtered through a 525/50 bandpass dichroic, collected via a ThorLabs PMT2100, and digitized via a laser-clocked National Instruments DAQ card controlled by ScanImage 2020. The imaging parameters were selected to match those we use in typical synaptic imaging experiments. Recordings of 12,000 frames were collected at 156 fps with laser power of 33 mW at sample at a wavelength of 1,010 nm, maximum depth of 100 μm below dura for both SF-Venus. iGluSnFR.A184V and iGluSnFR3.v857-PDGFR. Recordings were motion corrected 52 and pixels were selected that exceeded a threshold mean brightness over time. The traces for the selected pixels were then averaged to generate a single photobleaching trace. A constant background level, the mean recorded brightness in an unlabeled portion of the image, was subtracted for each FOV. A total of 34 FOV (from five mice) for v857 and 27 FOV (from five mice) for SF-Venus.iGluSnFR. A184V were analyzed.

One-photon in vivo imaging
We performed bulk imaging of iGluSnFR responses in the same mice transduced with AAVs encoding iGluSnFR variants as described for 2P-excited bleaching measurements, above. Four animals per construct were imaged at four time-points after surgery (3, 4, 5 and 6 weeks postinjection). In every animal there were four injection sites, two for a given iGluSnFR3 construct and two for SF-Venus.iGluSnFR.A184V serving as a within-animal control. A custom-build widefield microscope was used, incorporating an Orca Flash 4.0 Camera and a Thorlabs ITL200 tube lens. Each mouse received four nonoverlapping AAV injections. Low-magnification fluorescence recordings of all injection sites were performed with an Olympus UPlanApo ×4 objective, and sites were recorded individually through a ×25 Olympus XLPlan N 1.05 NA objective. Excitation: SOLIS 470 nm LED; hq 470/40 41109 Chroma Excitation filter. Et 560/40 319882 Chroma Emission filter. 512 × 512 16-bit images (four-times pixel binning in both x and y) were acquired at 100 fps using Hamamatsu HC Image software. Illumination intensity was constant across all sessions. Drifting grating visual stimuli were presented using the same apparatus, grating spatial and temporal frequencies, and anesthesia conditions described in ref. 18. Motion stimuli (2 s duration) of eight directions were presented in sequence spaced by 2 s periods of luminance-matched gray screen, eight times each.
Recordings were motion corrected 53 and background was subtracted by manually selecting a ROI within vasculature in each FOV. Pixels of interest were automatically detected based on their brightness and distance from automatically detected vasculature. Pixels of interest were averaged to generate a single trace, separated into low-frequency (F 0 ) and high-frequency (ΔF) components, and motion artifacts were then subtracted from the ΔF trace by regression of the low-pass filtered x and y offsets obtained during motion correction (and corresponding quadratic terms) against the trace. Responses were averaged across stimulus presentations to generate a direction-independent mean response for each session. A subset of sessions showed very weak or no evoked modulation. We therefore sorted sessions for each site by power in the (0.2 0.3) Hz frequency interval and used only the top 50% of sessions per variant to calculate the grand mean response for each indicator.
Intrinsic signal imaging (ISI) was performed during the first and last imaging sessions for each animal to assess visual responsiveness at each recorded site over time. ISI was performed on the same microscope as fluorescence imaging, using a Mitutoyo 7.5 × 0.21 NA objective, by collecting reflected light from a M625L4 LED (Thorlabs) illuminating the FOV from an angle outside the acceptance cone of the objective. This commonly used geometry for ISI reduces collection of light reflected from glass surfaces. Then 16-bit full-field images were collected at 33.3 fps using Hamamatsu HC Image software. Light intensity was set to the maximum that avoided camera pixel saturation anywhere within the FOV. The same eight stimuli used for fluorescence imaging were repeated over a period of approximately 30 min to generate ISI traces, which were then processed in a similar manner to fluorescence recordings. Article https://doi.org/10.1038/s41592-023-01863-6 Mouse preparation for AO2P imaging WT mice (C57BL/6J, males, younger than 8 weeks old, Jackson Laboratory) were used for thalamocortical bouton imaging. Adult (more than 8 weeks old) transgenic mice (Scnn1a-Tg3-Cre, no. 009613, Jackson Laboratory) were used for layer four dendritic spine imaging. Mice were anesthetized with isoflurane using a precision vaporizer, 3% (vol/vol) in oxygen for induction and 1-2% (vol/vol) for maintenance and given the analgesic buprenorphine subcutaneously (0.1 μg per gram body weight). Body temperature was maintained at 37 °C with a heating pad during anesthesia. The animal was placed in a stereotaxic frame. A 4-mm craniotomy was created over the right vS1 cortex (centroid at 1.5 mm posterior to the bregma and 3.4 mm lateral from the midline). The dura was left intact. A cranial window by a single 4-mm round coverslip (no. 1) was embedded in the craniotomy and sealed with cyanoacrylate glue (Loctite, catalog no. 401). Meta-bond (Parkell) was further applied around the edge to reinforce stability. A titanium head-bar was attached to the skull with Meta-bond and the remaining exposed bone was covered with dental acrylic (Lang Dental).
Virus injection was conducted before the craniotomy was made. To label the thalamocortical projections in vS1 cortex, Cre-dependent SF-Venus-iGluSnFR.A184V/SF-iGluSnFR. A184V 13 GC ml −1 ) were diluted and mixed to the final titer of from 8.5 × 10 12 to 1.1 × 10 13 GC ml −1 for iGluSnFR virus and 3.4 × 10 10 or 6.3 × 10 9 GC ml −1 for Cre virus and then injected (50 nl, 10 nl min −1 ) to the barreloids of VPM nucleus in WT mice, 1.7 mm posterior to the bregma, 1.8 mm lateral from the midline and at a depth of 3.25 mm. To label the layer four dendrites and spines in vS1 cortex, virus of iGluSnFR3.v857.GPI (AAV2/1.hSyn.FLEX.iGluSnFR3.v857.GPI, original titer: 3.17 × 10 13 GC ml −1 ) was diluted to 1.06 × 10 13 GC ml −1 and injected at a 45° angle into the vS1 of Scnn1a-cre mice to the target coordinates of 1.5 mm posterior to bregma, 3.4 mm lateral from midline and 400 μm deep. For all injections glass pipettes (Drummond) were pulled and beveled to a tip at 30-μm outer diameter and a syringe pump (Kd Science, Legato 185) was used to control the infusion.

In vivo AO2P imaging
In vivo imaging was carried out after 4 weeks of expression and 3 days of habituation for head fixation. All imaging experiments used head-fixed awake mice under AO2P. Mice were anesthetized with isoflurane shortly and given a retro-orbital intravenous injection of 20 μl Cy5.5-dextran PBS solution to label the lumen blood vessels 30 min before imaging. AO correction was applied at the imaging depth below 350 μm using the method described previously 33 . Briefly, direct wavefront sensing was performed through the labeled microvessels within a square region of 50 to 100 μm on edge, with the exact central location as the functional imaging ROI. The excitation wavelength for wavefront sensing was 1,250 nm. The measured wavefront error was then applied to the deformable mirror during the functional imaging of the same ROI. Wavefront measurement and correction were repeated when switching to a different ROI. For functional imaging, the laser was tuned to 950 nm for SF-iGluSnFR.A184V, 1,030 nm for SF-Venus-iGluSnFR.A184V and iGluSnFR3.v82.GPI and 1,000 nm for iGluSnFR3.v857.GPI/PDGFR. Postobjective power was under 100 mW for all measurements.

Vibrissa tracking and stimulation
The vibrissae of the mice were trimmed 3 days before functional experiments, leaving only one vibrissa, that was C1, C2 or D1, whose corresponding cortical column had an optimal expression of iGluS-nFR. The mice were head fixed to the imaging rig with a running disk.
The experiments were carried out in the absence of visible light and the running disk was illuminated by two infrared LEDs (Thorlabs, M940L3) to generate a bright-field contrast for vibrissae tracking. A high-speed camera (Basler, acA1300-200um) was used to track the vibrissae at the frame rate of 500 Hz. Air-puff deflection was used for vibrissa stimulation. Pulse-controlled compressed air, 20-ms pulse width, 5 p.s.i. at the source, was delivered through a fine tube, which was placed parallel to the side of the mouse snout and 20 mm away from the targeted vibrissa. The frequency of the air puffs was from 2 to 30 Hz. A motorized moving pole was used for dynamic pole touch experiments. The pole moves back and forth within a 5-mm range along the azimuthal direction at an average speed of 1.25 mm s −1 . The positions of the vibrissa and pole were extracted using DeepLabCut 54 and custom code written in MATLAB.

Single-cell electroporation and 2P imaging in mouse V1 in vivo
For in vivo experiments, 50-55-day-old male C57Bl/6 mice were implanted with a headplate for subsequent 2P glutamate imaging. Anesthesia was induced with 2% isoflurane in pure oxygen and maintained at 1.5% during surgery. The body temperature was continuously monitored and maintained by a heating plate at 37.5 °C. Both eyes were covered with ophthalmic ointment. After injecting a local anesthetic (2% xylocaine) and an analgesic (Metamizole, 200 mg kg −1 ), a headplate was attached to the skull above the left hemisphere of the brain with dental cement.
The procedure for single-cell electroporation of plasmids was adopted from a previously described method with some modifications 55 . The plasmid of either SF-iGluSnFR.A184S or iGluSnFR3.v857 was dissolved in an artificial intracellular solution (135 mM K-gluconate, 4 mM KCl, 10 mM HEPES, 4 mM Mg-ATP, 0.3 mM Na 2 -GTP, 10 mM Na-Phosphocreatine) at a final concentration of roughly 100 ng μl −1 . A fluorescent dye (100 μM OGB-1) was also included to visualize the patch-pipette and to verify the success of electroporation. For electroporation, a 3 mm round craniotomy was made above the left primary visual cortex (V1) and a coverslip of a similar size was fixed onto the craniotomy with Vetbond (3M). The glass coverslip had a small perforation that allowed the access of a patch-pipette to the cortical tissue underneath. After electroporation, the perforated coverslip was replaced by an intact one and the edge of the craniotomy was completely sealed with Vetbond.
Imaging of labeled neurons was performed 7 days after the electroporation with a custom-built 2P microscope. The microscope was equipped with a 12-kHz resonant scanner (Cambridge Technology) and controlled by LabVIEW. Excitation laser was a mode-locked Ti:sapphire laser (Mai Tai DeepSee, Spectra-Physics) and the average power below the objective (×40, NA 0.8, Nikon) was between 20 and 30 mW. Dendrites of neurons expressing SF-iGluSnFR.A184S were imaged at 100 Hz frame rate with 940 nm excitation light and dendrites labeled with iGluSnFR3 were imaged at 200 Hz with 950 nm excitation light. For visual stimulation, a 10.5-inch Samsung tablet was placed at a distance of 10 cm in front of the right eye of the mouse. The screen covered a visual space of 96° in azimuth and 70° in elevation and had a mean brightness of 4.8 cd m −2 . Full-field square wave drifting gratings (0.03 cycle per degree spatial frequency, 2 Hz temporal frequency, 2 s duration) were presented at eight directions (45° step, in a fixed order) using a custom Android app.
For simultaneous 2P axonal imaging and cell-attached recordings, a z-stack of images of the labeled neuron was acquired and the axon was manually traced to identify unambiguously boutons from the same neuron. Before recording, a perfusion chamber was fixed on top of the headplate, and the coverslip on the cortex was changed to one with an opening. Warm artificial cerebro-spinal fluid (125 mM NaCl, 26 mM NaHCO 3 , 4.5 mM KCl, 2 mM CaCl 2 , 1.25 mM NaH 2 PO 4 , 1 mM MgCl 2 and 20 mM glucose) was perfused throughout the experiment to keep the brain temperature constant. A patch-pipette filled with artificial cerebro-spinal fluid containing 25 μM Alexa Fluor 594 was Nature Methods Article https://doi.org/10.1038/s41592-023-01863-6 approached under visual control to the soma of the labeled neuron and, once the tip of the patch-pipette touched the membrane, gentle negative pressure was applied to obtain a seal resistance of 40 MΩ. Once a stable cell-attached recording was established, spontaneous activity was recorded, while 2P glutamate imaging of axonal boutons was performed at a frame rate of 500 Hz. Electrophysiological signals were acquired either in the current-clamp or in the voltage-clamp mode by a patch-clamp amplifier (EPC10, HEKA).

Mouse V1 data analysis
All data were processed and analyzed using MATLAB. Drifts of images in the xy plane were corrected using a cross-correlation based registration algorithm. ROI were automatically segmented based on the correlation image for each recording. The mean fluorescence signal F from each ROI was extracted and the fluorescence change was calculated as ∆F/F 0 = (F − F 0 )/F 0 . For dendritic recordings with visual stimulation, F 0 was defined as the mean of fluorescence signals during a period of 2 s before visual stimulation. For spontaneous activity recorded from axonal boutons, F0 was defined as the mean of fluorescence signals during all 'No AP periods'. 'No AP periods' were the intervals between APs, starting 200 ms after the last AP. All traces displayed in Fig. 5 were filtered using a Savitzky-Golay filter.
For the analysis of kinetics and specificity (Fig. 5e), the traces from axonal boutons were denoised with a nonnegative deconvolution algorithm 56 using the estimated range of tau for each sensor. 'Single APs' were APs that were separated by more than 200 ms from the preceding and following APs. The amplitude of a 'single-AP event' was the peak fluorescence value during a period of 20 ms following the electrically recorded spike. 'No AP events' were local maxima of the deconvolved trace during 'No AP periods'.
Pixelwise orientation maps (Fig. 5i,j) were generated as previously reported 18 . Briefly, responses (mean fluorescence change) to eight visual stimulation directions were obtained for each pixel. The responses were mapped onto orientation vector space and summed. The preferred orientation was the angle of the resultant vector. Orientation selectivity was calculated as the length of the resultant vector divided by the sum of responses to each orientation. The response magnitude was defined as the two-norm of responses to all directions. The hue of the orientation map encodes preferred orientation, the saturation corresponds to orientation selectivity, and the lightness is set by response magnitude and is normalized to the pixel with the largest magnitude from the map of v857.

Expansion microscopy
Female Emx1-cre mice 8 weeks old were injected in cortex at multiple sites in a 3.5 mm craniotomy over V1 with 40 nl of 5 × 10 11 GC ml −1 AAV2/1 encoding hSyn.Flex-iGluSnFR.v857 in the three backbones (PDGFR, GPI and SGZ; one construct per mouse; two mice per construct). A cranial window was affixed to seal the craniotomy and allow expression to be confirmed before histology. Mice were transcardially perfused 16 days after virus injection, and gels prepared from labeled cortical regions using a protease-free variant of Ten-fold Robust Expansion (TREx) microscopy 32 . Gels were labeled with primary and secondary antibodies as follows: Primary: mouse anti-Bassoon no. ab82958 (abcam) dilution 1:200, rabbit anti-Homer no. ab97593 (abcam) dilution 1:200, chicken anti-GFP no. ab13970 (abcam) dilution 1:500. Secondary: goat anti-mouse AF594 A-11012 (Invitrogen), goat anti-rabbit Atto 647N 40839-1ML-F (Sigma Aldrich) and goat anti-chicken AF 488 A-11039. For imaging, gels were expanded in purified water (Millipore Milli-Q) for 1 h, placed in a glass-bottomed dish (coated in poly-l-lysine to prevent sample drift), and imaged using a Zeiss LSM800 confocal microscope using a ×40, 1.1 NA water immersion objective. All images were acquired with the same image settings, except photomultiplier voltages were adjusted to prevent digitizer saturation and adjust dynamic range across samples. Synapses were annotated manually by Fourier transform, and quality of annotations was verified blind to genotype by KP. The annotator was asked to: 'Draw a line connecting the presynapse to the postsynapse on an axis locally perpendicular to the iGluSnFR-labeled membrane, in the 2D image plane corresponding to the center of intensity of the pre-and postsynaptic labels. Only synapses with their axis in the plane of the image should be labeled.' Annotations, image data and software to visualize them (requires MATLAB) are available on Figshare (https://doi.org/10.25378/janelia.21985406).

Statistics and reproducibility
Values and errors reported throughout the text are mean ± s.e.m. unless otherwise noted. Statistical analyses were performed in Graphpad Prism v.8 (in vitro photophysics) and MATLAB (others), as described in the text. Data and code used to produce the figures, and instructions for generating them, are provided on Figshare (https://doi.org/10.25378/ janelia.21985406). Representative example experiments were performed the following number of times independently with similar results to those shown: Fig. 3a, 18 cultures; Fig. 3g, three cultures (nine cells); Fig. 4c, six mice; Fig. 5a,b, five neurons and Supplemental Fig. 7, three cultures.

Reagent availability
A variety of mammalian and bacterial expression plasmids for iGluS-nFR3 variants v82 and v857 are available through Addgene (https:// www.addgene.org/browse/article/28220233/). Requests for AAVs and other reagents can be made by contacting K.P.

Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.