Skip to main content
Nature Communications logoLink to Nature Communications
. 2024 Mar 19;15:2456. doi: 10.1038/s41467-024-46484-5

The influence of cortical activity on perception depends on behavioral state and sensory context

Lloyd E Russell 1, Mehmet Fişek 1, Zidan Yang 1, Lynn Pei Tan 1, Adam M Packer 1, Henry W P Dalgleish 1, Selmaan N Chettih 2, Christopher D Harvey 2, Michael Häusser 1,
PMCID: PMC10951313  PMID: 38503769

Abstract

The mechanistic link between neural circuit activity and behavior remains unclear. While manipulating cortical activity can bias certain behaviors and elicit artificial percepts, some tasks can still be solved when cortex is silenced or removed. Here, mice were trained to perform a visual detection task during which we selectively targeted groups of visually responsive and co-tuned neurons in L2/3 of primary visual cortex (V1) for two-photon photostimulation. The influence of photostimulation was conditional on two key factors: the behavioral state of the animal and the contrast of the visual stimulus. The detection of low-contrast stimuli was enhanced by photostimulation, while the detection of high-contrast stimuli was suppressed, but crucially, only when mice were highly engaged in the task. When mice were less engaged, our manipulations of cortical activity had no effect on behavior. The behavioral changes were linked to specific changes in neuronal activity. The responses of non-photostimulated neurons in the local network were also conditional on two factors: their functional similarity to the photostimulated neurons and the contrast of the visual stimulus. Functionally similar neurons were increasingly suppressed by photostimulation with increasing visual stimulus contrast, correlating with the change in behavior. Our results show that the influence of cortical activity on perception is not fixed, but dynamically and contextually modulated by behavioral state, ongoing activity and the routing of information through specific circuits.

Subject terms: Neuroscience, Sensory processing


The mechanistic link between cortical activity and behaviors remains largely unclear. Here authors show that targeted holographic photostimulation of mouse visual cortex during a detection task alters performance based on the animal’s state and visual stimulus conditions, highlighting the dynamic influence of cortical activity on perception and behavior.

Introduction

The perception of a sensory stimulus is modulated by the behavioral state in which it is experienced – successful detection of a stimulus can be increased during periods of arousal or attention1,2. The neural representation of the same sensory stimulus is also modulated by behavioral state35 – stimulus-evoked responses are typically enhanced when subjects are alert. The behavioral state of an animal is a latent variable and can be inferred in a number of ways. Firstly, the arousal of an animal is thought to be under control of neuromodulatory activity primarily arising from the locus coeruleus6,7, which can influence the dilation and constriction of the pupil8, with high mental effort and arousal associated with larger pupil sizes9. A second manifestation of behavioral state is the synchronization of neural activity3,10. At opposite extremes, sleep is associated with synchronized activity, while wakefulness is associated with desynchronization. The modulation of cortical responses by behavioral state1114, task outcome15, and task demands16,17 has been extensively investigated. However, how the modulation of cortical activity by state or stimulus corresponds to the influence of the cortex on behavior has largely been studied using only correlational methods18,19. While the correlational approach has yielded important insights, the absence of cellular-level manipulations of the activity patterns means a cause-and-effect relationship between the observations cannot be established.

Classical experiments have shown that electrically stimulating specific cortical areas can bias sensory perception2026 and elicit artificial percepts2730. Optogenetic stimulation of cortex has confirmed and extended these findings3133. In all of these experiments the functional identity of activated neurons was largely unknown, as was the number of activated cells. With the advent of new techniques that enable activation of a known number of functionally characterized cells, a view is emerging that perception can be initiated, or biased by, a small number of specific neurons3440. However, challenging even the basic requirement of cortical neurons to solve some tasks, reversible silencing4145 or permanent lesioning4649 of cortex have produced contradictory findings about the necessity of cortical activity for perception and behavior5052.

Consequently, we lack a clear mechanistic link between cortical activity, how it engages local and downstream circuits, and ultimately how and when that activity influences a behavior of interest. To reconcile these disparate results and begin building a complete picture of how and when cortical activity leads to perception, we need to investigate the perceptual influence of specific patterns of neural activity during the processing of different stimuli in a variety of behavioral tasks and states.

To probe the influence of stimulus-relevant patterns of cortical activity on local network activity and behavior, we performed two-photon population calcium imaging of a volume of L2/3 V1 while simultaneously using two-photon holographic optogenetics5357 to activate specific groups of neurons in mice performing a visual contrast-varying detection task. We targeted groups of neurons based on their tuning for visual stimuli to ask whether increased neural activity in relevant neuronal ensembles leads to increased behavioral detection. This in vivo all-optical approach5867 also allowed us to assess the functional influence of the stimulated cells on the local network. Importantly, behavioral state was continuously monitored by measuring pupil size and neuronal synchrony and was used to index each behavioral session into states of higher and lower engagement, allowing us to investigate the impact of additional cortical activity during these different behavioral states. We found that photostimulation of task-relevant cells – defined as cells that preferentially respond to the orientation of visual stimulus selected for the detection task – impacted the non-photostimulated local network in a way that depended on the functional identity of the cells and the contrast of the visual stimulus. When the visual stimulus contrast was high, responses of neurons functionally similar to the photostimulated ensemble were more strongly suppressed than other cells. When the contrast was low these neurons were suppressed less than other cells. The effect of photostimulation on the animal’s behavioral report followed a similar pattern, whereby the detection of high contrast stimuli was suppressed, but the detection of low contrast stimuli was enhanced. This behavioral effect, and the linking of cortical activity to behavior, was only present when mice were most engaged in the task. A gradual decrease in task engagement transitioned mice from a state where additional cortical activity bidirectionally influenced their behavior to one where such activity had no reliable impact.

Results

Behavioral state and task performance

To allow all-optical interrogation in visual cortex of mice performing a visually guided behavior, we co-expressed the calcium sensor GCaMP6s6870 with the excitatory, somatically-restricted opsin C1V171,72 in pyramidal cells of L2/3 V1. Mice were head-fixed and trained to perform a visual stimulus detection task (Fig. 1a, b) where after withholding licks for a random interval, a water reward could be obtained for successfully licking to report the appearance of a small drifting grating patch of randomized orientation (Fig. 1c, d). Mice learned the task quickly with a maximal contrast stimulus, reaching a high level of stable performance within days (Supplementary Fig. 1). Lowering the stimulus contrast reduced performance on the task (Fig. 1e, Supplementary Fig. 1). To assess the relationship between cortical activity, behavior and behavioral state, we recorded the animal’s pupil size and neuronal synchrony throughout the behavioral session as a measure of arousal or alertness13,73,74. We observed a significant correlation between the size of the pupil and the degree of neuronal synchrony (Supplementary Fig. 2). We found that on threshold-stimulus trials (the stimulus contrast at which animals detected the stimulus on approximately half the trials), successful detections (hits) were associated with a more dilated pupil and lower neural synchrony in the period before the stimulus was presented (Fig. 1f, g; pupil diameter (normalized relative to the median of the session) on hits: +2.5 ± 10.8% vs misses: −6.6 ± 13.7%, P = 0.006 Wilcoxon signed-rank test; neuronal synchrony (average pairwise Pearson’s correlation coefficient) on hits: 0.0014 ± 0.0009 vs misses: 0.0024 ± 0.0021, P < 0.001, Wilcoxon signed-rank test). Based on this, we defined two behavioral states: one associated with a large pupil size and low neuronal synchrony, and the other with a smaller pupil size and higher neuronal synchrony (Fig. 1h). We split each session into these two states, indexing each trial by the pupil size and neuronal synchrony in the period before the stimulus appeared, and then compared the resulting psychometric curves between the two states (Fig. 1i). We found that performance was higher in the state with larger pupil size and lower neuronal synchrony – corresponding to a more-engaged state – consistent with previous reports4,7577 (Fig. 1i, d-prime averaged across all contrasts in the more-engaged state vs the less-engaged state: 1.52 ± 1.13 vs 1.32 ± 1.05, P = 0.0002 Wilcoxon signed-rank test). The more engaged state was also characterized by a greater detection sensitivity (Fig. 1j, width of psychometric curve in the more-engaged state vs the less-engaged state: 7.5 ± 8.3 vs 15.0 ± 15.2, P = 0.012 Wilcoxon signed-rank test) and lower stimulus contrast threshold (Fig. 1j, threshold of psychometric function in the more-engaged state vs the less-engaged state: 3.88 ± 1.47 vs 4.59 ± 2.11, P = 0.042 Wilcoxon signed-rank test) reflecting greater arousal or engagement in the task75,78,79. Importantly, we note that the less-engaged state does not correspond to a completely disengaged state, as mice were still performing the task to a high level. This subtle but clear distinction provides the opportunity to quantitatively compare conditions under which cortical activity may or may not play a role in shaping simple behaviors.

Fig. 1. Visual stimulus detection is modulated by behavioral state.

Fig. 1

a Experiment schematic. Mice coexpress GCaMP6s and C1V1-Kv2.1 in excitatory neurons of L2/3 V1 enabling simultaneous two-photon calcium imaging and two-photon holographic stimulation. Mice are head-fixed and trained to perform a visual stimulus detection task. Pupil size is recorded with a camera. b Timeline of animal preparation, training, and experiment. c Behavioral trial structure. After withholding licks for a randomized interval (4 ± 3 s) a stimulus (visual and/or optogenetic) is presented to the mouse. When a visual stimulus is presented the mouse has 1.5 s to lick the lickometer in order to receive a water reward. Neural analysis is performed in the 1 s immediately following stimulus offset (to avoid photostimulation artifact) using the 1 s immediately prior to the stimulus as baseline. The state of the animal is measured in the 4 s preceding the delivery of the stimulus. d Behavioral session structure. 12 different trial types are presented to the mouse in a pseudorandom blocked structure. Visual-only trials (40% of session) of varying contrast (1%, 2%, 5%, 10% and 100%) are interleaved with Visual+Photostimulation trials (40% of session) where a 1 s 20 Hz photostimulation is delivered coincident with the visual stimulus. Catch trials (20% of session) with and without photostimulation are delivered to assess chance licking probabilities. Any trial with a visual stimulus is rewarded if the mouse responds during the response window. e Example lick raster plot. Trials were delivered pseudorandomized but are shown sorted by stimulus contrast. Gray dots indicate lick responses, with the first lick (reaction time) highlighted in black. Right: the simultaneously recorded pre-trial pupil size, neuronal synchrony and running speed are shown for each trial. Orange indicates large values, blue indicates small values. f Pupillometry is performed throughout the behavioral session. Large and small pupil sizes are seen (left) reflecting different behavioral states. Stimulus triggered average pupil traces are averaged across all hit or miss trials of threshold stimuli, and then averaged across sessions (middle). On visual-only threshold trials hits (mice licked within response window) are associated with a larger pupil prior to the stimulus delivery (right). Error bars show mean ± SEM across sessions, n = 28 sessions, 12 mice. g Neuronal synchrony in the pre-trial period is computed as the average pairwise correlation between all pairs of cells’ deconvolved activity traces. Periods of low and high synchrony are seen (left) reflecting different behavioral states. Stimulus triggered average correlation traces are averaged across all hit or miss threshold trials, and then averaged across sessions. Note the traces are made with a 4 s sliding window hence the synchrony appears to increase before the stimulus is delivered (middle). On threshold contrast visual-only trials hits are associated with a lower level of synchrony prior to the stimulus delivery (right). Error bars show mean ± SEM across sessions, n = 28 sessions, 12 mice. h Each session is median-split into two collections of interspersed trials, based on pupil size (normalized relative to the median size in the session) and network synchrony (average pairwise Pearson’s correlation coefficient between all recorded neurons) on each trial preceding stimulus delivery. The more engaged state contains trials with the largest pupil sizes and lowest neuronal synchrony. The less engaged state contains trials with the smallest pupil sizes and highest neuronal synchrony. Each dot represents the average pupil size and synchrony for that state of a given session. Gray lines connect the two states in a given session (n = 28 sessions, 12 mice). i The behavior of the mice differs in the two states. The “more engaged” state, the state with large pupil size and low neuronal synchrony, is associated with higher stimulus detection rates, as expressed by higher d-prime values. Error bars show mean ± SEM across sessions. j The psychometric function is steeper (left) and more sensitive (right) when the animal is engaged. Error bars show mean ± SEM across sessions, n = 28 sessions, 12 mice. The insets above the plots illustrate the measurement of psychometric curve width (left) and threshold (right).

Behavioral effects of targeted photostimulation

To test the influence of activity in a stimulus-encoding population of neurons in V1 during different behavioral states, we targeted multiple cells for two-photon optogenetic photostimulation while recording the resulting neuronal and behavioral changes. We first identified the retinotopically appropriate and co-expressing field of view and then mapped the visual stimulus-responsive and photostimulation-responsive neurons (Fig. 2a, b). We then selected the maximum number of photostimulation-responsive neurons that shared the same visual stimulus orientation preference (median ~20 neurons, Fig. 2c–e). The orientation of the visual stimulus for the detection task was chosen to match the orientation preference of this neuronal ensemble. While the mice were performing the contrast-varying detection task, we photostimulated these co-tuned ensembles on a random subset of trials with and without concurrent visual stimulus presentation (Figs. 1c, d and 2f). Intriguingly, we observed a reliable effect of photostimulation on behavior only when the animal was more engaged. In this large pupil, low synchrony state, targeted photostimulation of ~20 neurons enhanced the detection of lower contrast visual stimuli, while the same photostimulus suppressed the detection of higher contrast visual stimuli (Fig. 2f, h; width of psychometric curve in the less engaged state without vs with photostimulation: 15.0 ± 15.2 vs 13.3 ± 32.5, P = 0.130 Wilcoxon signed-rank test. Width of psychometric curve in the more engaged state without vs with photostimulation: 7.5 ± 8.3 vs 25.4 ± 51.6, P = 0.0015 Wilcoxon signed-rank test. The more-engaged state vs the less-engaged state, repeated measures ANOVA, interaction of contrast and state P = 0.009). Taken together, photostimulation acted to widen the psychometric function, reducing sensitivity80 (Fig. 2g; change in width in the more-engaged state vs the less-engaged state: 17.9 ± 49.2 vs −1.8 ± 35.8, P = 0.036 Wilcoxon signed-rank test) without changing the threshold (change in threshold in the more-engaged state vs the less-engaged state: −0.2 ± 1.6 vs −0.4 ± 2.4, P = 0.982 Wilcoxon signed-rank test). In other words, increasing the activity of stimulus responsive neurons when the animal is most engaged in the task enhanced the detection of subthreshold stimuli, but suppressed the detection of suprathreshold stimuli (see also Supplementary Fig. 3). When the animal was less engaged (but still performing the task), we did not observe a reliable effect of cortical stimulation on behavior. Thus, behavioral state gates the effect of photostimulation, and photostimulation has a bidirectional effect depending on the contrast of coincident visual stimulation. Taken together, this suggests that primary visual cortex serves different roles depending on stimulus regime and the state of the animal.

Fig. 2. Targeted photostimulation of stimulus coding neurons in L2/3 V1 bidirectionally modulates stimulus detection when mice are engaged in the task.

Fig. 2

a From left to right, first panel: One-photon widefield imaging is performed while presenting drifting bars to the mouse to locate primary visual cortex. The two-photon FOV is positioned in a region with good GCaMP and opsin expression. The task visual stimuli are positioned in the retinotopically appropriate location. Scale bar represents 1 mm. Second panel: Example FOV (one plane from a 4-plane volume) showing construct expression in L2/3 mouse primary visual cortex. GCaMP6s is expressed transgenically and C1V1-Kv2.1 is expressed virally through injection. Third panel: Visual stimulus orientation preference map. 4 different orientations of drifting gratings are presented to the mouse. Pixel intensity is dictated by the stimulus triggered average response magnitude. Hue corresponds to preferred stimulus orientation. Fourth panel: Photostimulation responsivity of the FOV to clustered randomized photostimulation. The majority of recorded cells were grouped into 76 different clusters of 50 cells each (distributed across 4 planes) and targeted for sequential photostimulation to confirm responsivity prior to the experiment. Pixel intensity indicates the change in fluorescence caused by photostimulation. Color corresponds to the photostimulation cluster which caused the largest change in activity. White circles indicate example targets within this plane ultimately selected for targeted photostimulation of a co-tuned ensemble. All scale bars 100 μm. Examples shown are from one representative experiment but were repeated for each experiment in this study (n = 28 sessions, 12 mice). b Left: Example traces from the visual response mapping block of the experiment (prior to the behavioral task). Vertical lines indicate stimulus onsets with color indicating orientation (dashed lines for orientations over 135 degrees). Right: Example traces from the photostimulation response mapping block. Vertical lines indicate clusters of cells stimulated as a group. Cells are sorted by photostimulation cluster (in this experiment clusters were determined by orientation preference). c Example co-tuned stimulation ensemble. In this experiment 28 neurons were selected based on their responsivity to visual and optogenetic stimuli in b. Left: average responses to the drifting gratings of various orientations. Single lines represent individual neurons, thick black line indicates ensemble average. This ensemble shares a preference for 90 and 270 degree stimuli. Black triangle indicates the orientation of visual stimulus chosen for the remainder of this session. Middle: The ensemble response to photostimulation. Right: The spatial configuration of the neurons selected for stimulation. d Pixel-wise stimulus-triggered average (STA) showing the response of the FOV to the stimulation pattern from c. Red circles indicate target neurons on that imaging plane. Fade circles show all targets collapsed across planes. Scale bar represents 100 μm. e Boxplots showing the number and co-tuning of the photostimulated neurons across all experiments. Box shows the interquartile range (IQR), the plus sign shows the mean, solid line the median, and the whiskers denote 1.5 times the IQR (n = 28 sessions, 12 mice). f Photostimulation of co-tuned ensembles was paired with visual stimuli. Sessions are split into two states as in Fig. 1, here renamed to a ‘less engaged’ and a ‘more engaged’ state. Black lines indicate performance on visual-only trials. Red lines indicate performance on visual+photostimulation trials. Inset: Width of fitted psychometric curve. Error bars and shading show mean ± SEM across sessions, n = 28 sessions, 12 mice. Statistical test was two-sided Wilcoxon sign rank test, ** denotes P < 0.01. g The effect of photostimulation manifests as an increase in the width of fitted psychometric curves (n = 28 sessions, 12 mice). There was no change to the threshold of the psychometric functions. Error bars show mean ± SEM across sessions. Statistical tests were two-sided Wilcoxon sign rank, ** denotes P < 0.01, * denotes P < 0.05. h Photostimulation has a consistent effect on the detectability of visual stimuli in the ‘more engaged’ state and not in the ‘less engaged’ state. Photostimulation enhances detection of low (2%) contrast stimuli and suppressed the detection of higher (10%) contrast stimuli. Significance across each full curve indicates results of a one-way ANOVA within state. Significance across the two curves indicates the results of a repeated measures ANOVA. Significance above individual curve points indicates results of two-sided Wilcoxon signed-rank tests with Bonferroni (number of contrasts) correction. Error bars show mean ± SEM across sessions, n = 28 sessions, 12 mice. We use * to denote a P-value < 0.05, ** for P < 0.01 and *** for P < 0.001.

Network effects of targeted photostimulation

To explore the circuit mechanisms underlying the behavioral effects of photostimulation, we investigated the influence of photostimulation on downstream neurons. We used two-photon calcium imaging to simultaneously measure the activity in the local circuit during behavior with and without photostimulation in the two behavioral states. First, in the visual stimulus-only trials, we observed that increasing contrast increased population activity (Fig. 3a). The population average visually-evoked responses were larger in the more engaged state (Fig. 3b; average response magnitude in less-engaged vs more-engaged state: 0.029 ± 0.015 vs 0.031 ± 0.018, P < 0.0001 Wilcoxon signed-rank test; ref. 74), similar to the response modulation during locomotion12,14. These enhanced neural responses were strongest at 10% stimulus contrast and reflect the enhanced behavioral detection of the same stimuli (Fig. 1i). This neural enhancement in the engaged state held even when controlling for the different proportions of hit and miss trials (and thus the related motor or reward confounds) between the engagement states.

Fig. 3. Targeted photostimulation elicits a suppressive network response that scales with the strength of coincident sensory stimuli and the functional identity of neurons.

Fig. 3

a Example STA traces to visual only trials across contrasts in one experiment. Neurons are sorted by their average response across all contrasts. Black line indicates visual stimulus presentation. b The neural responses across the whole population in the more engaged state are significantly larger than in the less engaged state (n = 28 sessions, 12 mice). The ratio of hits and misses within each contrast have been matched across states. The line and shading represents the mean ± SEM. Individual points across the two curves were tested with two-sided Wilcoxon sign rank test with multiple comparison (Bonferroni) correction for number of contrasts. The average pooled responses were compared with a two-sided Wilcoxon sign rank test. *** denotes P < 0.001 and ** P < 0.01. c Top: example experimental volume. ROIs are colored by the change in activity caused by photostimulation during spontaneous gray screen periods. Vertical red lines indicate the directly stimulated cells. Bottom: example types of responses seen when the visual stimulus is paired with photostimulation. d Target cell responses. Left: responses to visual only trials across contrasts. Middle: responses to paired visual and photostimulation. Right: the change in activity caused by photostimulation. Target cells are strongly activated by photostimulation. The level of activation is significantly higher in the engaged state. The ratio of hits and misses within each contrast have been matched across states. The line and shading represents the mean ± SEM (n = 28 sessions, 12 mice). Comparisons were made with a two-sided Wilcoxon sign rank test. *** denotes P < 0.001. e Background cell responses. Left: The responses of all background neurons to visual only trials. Middle: The response of background neurons to paired visual and photo-stimulation. Right: The change in activity of background cells caused by photostimulation. The background cells are suppressed on average, across all contrasts. No difference is seen in the level of suppression between behavioral states. The line and shading represents the mean ± SEM (n = 28 sessions, 12 mice). Comparisons were made with a two-sided Wilcoxon sign rank test. ** denotes P < 0.01. f Top: the 2D spatial profile of photostimulation influence. All neurons are aligned relative to their nearest target spot (at 0,0), collapsed across z-planes. Spatially binned (5 ×5 µm), and Gaussian filtered (SD = 10 µm) for display only. A central hotspot of activity corresponds to directly targeted neurons. Surrounding the targeted neurons the predominant effect of photostimulation is suppression of neighboring cells (n = 28 sessions, 12 mice). Bottom: the 1D spatial profile of photostimulation influence. No difference is seen between the two states. The line and shading represents the mean ± SEM (n = 28 sessions, 12 mice). g Presenting the average network responses across all sessions on two axes; visual stimulus contrast and similarity to the target cells (quantified as the Pearson’s correlation of a given cell’s contrast response curve to that of the average target neuron). The top row corresponds to the directly targeted neurons. Left: responses to visual stimuli of increasing contrast alone. Note cells positively correlated with the target cells respond positively to increasing contrast. Middle: The responses to paired visual and photo-stimulation. Right: The difference reveals the change in activity caused by photostimulation. Note that cells similar to the target cells are more strongly suppressed at higher contrasts (n = 28 sessions, 12 mice). h The change in activity of background cells. Background neurons most similar to the target neurons show the strongest levels of suppression mediated by the photostimulation (green line). The level of suppression recruited increases as the visual contrast increases. (2-way ANOVA grouped by state and contrast. Effect of contrast F(4) = 11.9, P < 0.001. Effect of similarity F(19) = 2.9, P < 0.001. Interaction of contrast and similarity F(76) = 2.5, P < 0.001, n = 28 sessions, 12 mice). Lines show the mean and shading shows the SEM. i The relationship between the slope of suppression recruited by increasing visual contrasts, versus the functional similarity to the photostimulated neurons. Neurons within a similarity group are pooled across experiments and the slope of suppression versus contrast is computed. Error bars indicate the standard error of the fit, obtained by resampling animals/sessions with replacement. Neurons most similar to the target neurons are increasingly suppressed as contrast increases, which corresponds to a negative slope. Filled individual points indicate individually significant fits with Bonferroni multiple comparison correction. The line of best fit indicates the relationship across functional similarity groups of all the background cells, shading represents the CI of the fit. The directly stimulated neurons are shown at the far right and are excluded from the fit (n = 28 sessions, 12 mice).

Does this enhanced excitability in the more engaged state underpin the gating of behavioral effect to photostimulation? We first analyzed how targeted photostimulation engages the local circuitry (Fig. 3c). We looked at the responses of either the directly targeted (Fig. 3d) or the non-targeted (background) subpopulations (Fig. 3e) on trials with and without photostimulation, across the different contrasts and behavioral states. As before, we observed increasing activity in both populations as the visual stimulus contrast increased, with more activity on average in the engaged state. When the target cells were photostimulated, their activity was enhanced considerably as expected. In addition, a behavioral state dependence was observed: photostimulation was more effective in the engaged state, with larger photostimulation-evoked responses in the targeted cells (Fig. 3d; change in activity in target cells on less-engaged vs more-engaged trials: 0.68 ± 0.19 vs 0.81 ± 0.22, P < 0.0001 Wilcoxon signed-rank test). Conversely, the average activity of the non-targeted background cells was suppressed by photostimulation, but we observed no difference in the level of suppression between the states (Fig. 3e; activity in background cells on less-engaged vs more-engaged trials: −0.005 ± 0.008 vs −0.005 ± 0.007, P = 0.231 Wilcoxon signed-rank test) suggesting that the photostimulated cells recruit similar levels of local inhibition regardless of behavioral state. We investigated the effect of titrating the number of stimulated cells and observed that increasing the number of directly stimulated cells increased the amount of suppression of other cells in the network (Supplementary Fig. 5; ref. 34). In more engaged states the excitatory/inhibitory (E/I) balance is shifted towards excitation81 consistent with the enhanced target cell response to direct photostimulation as observed in our data. However, the predominant effect of background suppression, with no difference between engagement states, confirms the dominance of inhibitory connections in cortical circuitry8289, revealing highly effective stabilization of network activity in either state, despite the E/I balance being shifted towards excitation.

To characterize the spatial spread of responses through the local network caused by photostimulation we constructed a photostimulation-triggered spatial average of the change in activity in all cells across all photostimulation trials aligned to the nearest target stimulation site. This analysis positions the directly targeted cells at the center of the map and the other cells in the local network relative to them (Fig. 3f). The activity-enhanced cells were localized in a narrow zone around each target site, corresponding to direct photostimulation, as well as potential synaptic recruitment of other cells (Supplementary Fig. 8). We observed a pronounced annulus of suppressed cells around the directly targeted cells (Fig. 3f) producing a center-surround motif of enhancement and suppression. No difference in spatial profile of the network influence of photostimulation was seen between behavioral states.

These findings suggest that the contrast-dependent behavioral effect of stimulating L2/3 V1 neurons (Fig. 2f–h) cannot be explained simply by the influence stimulated neurons have on the overall activity level of the local circuit, because the change in overall activity (pooled over target and background populations) across contrasts and states remains relatively constant (Supplementary Fig. 6).

Functional similarity defines the network effects of targeted photostimulation

It is known that functionally similar neurons are more highly interconnected72,88,90,91, forming subnetworks which may facilitate computations to enhance the detection or discrimination of sensory stimuli92. To ask if different subnetworks of neurons respond differently across contrasts, we characterized the functional similarity of each recorded neuron relative to the photostimulated cell population. We defined similarity as the correlation of a neurons’ contrast response curve with the average contrast response curve of all target neurons. This contrast response curve describes how neurons respond to the behaviorally relevant visual stimulus of increasing contrasts of a fixed drifting orientation (discrimination of orientation of the stimulus being behaviorally irrelevant in our task). The contrast-response curve of a given neuron is linked to the visual stimulus responsivity of each cell and implicitly linked to the orientation preference (neurons preferring the displayed orientation will respond more strongly). Using the similarity of contrast curves between a background cell and the target neurons, we found that background cells which are more similar to target neurons in terms of their contrast response curves are also more similar to target neurons in terms of their visual response magnitude, trial-by-trial correlation and their orientation tuning curves (Supplementary Fig. 7A–D). We therefore refer to the contrast curve correlation between background and target cells, which captures intrinsic contrast responses as well as potential indirect network interactions, as our measure of behaviorally relevant functional similarity.

The functional similarity of background cells determines their response to target cell photostimulation. Using our measure of functional similarity we binned cells into groups of increasing similarity to the target population. We then plotted the response of each group as a function of visual contrast for visual-stimulation-only trials (Fig. 3g, left), for visual-and-photostimulation trials (Fig. 3g, middle) and the difference between the two (Fig. 3g right). Importantly, to cross-validate, we measured functional similarity using one half of all trials and measured visual and photostimulation responses using the other half. Sorting cells in this way again reveals increasing neural response magnitude as the stimulus contrast increases (Fig. 3g, left), with cells functionally similar to the target cells responding positively to the visual stimuli and functionally dissimilar cells responding negatively. However, when looking at the change in activity caused by photostimulation – which was suppression on average across the whole background population – we observed a strong stimulus contrast dependence to the suppression of the most functionally similar neurons. Neurons that are most similar to the targeted neurons, which are more responsive to the behaviorally relevant visual stimulus, were increasingly more suppressed by photostimulation as visual contrast increased, whereas functionally dissimilar neurons were not (Fig. 3g right, h). As a result, in addition to a significant effect of contrast on the photostimulation response, there was also a statistically significant interaction between visual contrast and functional similarity (2-way ANOVA grouped by contrast and similarity: effect of contrast F(4) = 11.9, P < 0.001; effect of similarity F(19) = 2.9, P < 0.001; interaction of contrast and similarity F(76) = 2.5, P < 0.001). To summarize these effects, we next measured the slope of photostimulation induced change in activity as a function of contrast and plotted it against normalized similarity (Fig. 3i. Linear fit R2 = 0.94, P < 0.001). This analysis showed that photostimulation induces a change in activity that depends systematically on how similar a neuron is to the targeted population. The more similar the responding neuron is to the targeted population, the more effective photostimulation is in suppressing it at high contrast. We observed similar contrast and functional-identity dependent patterns of influence when the similarity metric is contrast response similarity as above, orientation tuning curve similarity or the magnitude of visual responses (Supplementary Fig. 7E–J).

Linking network activity to behavior

To relate the pattern of photostimulation-mediated changes in network activity (Fig. 3g, h) to the behavioral changes (Fig. 2h), we focused on the threshold and threshold-adjacent contrast levels (reasoning that performance on the lowest contrast was unaffected by photostimulation because it is far below the detection limit, and that performance on the maximum contrast was unchanged because it is saturated). Since we showed that the effect of photostimulation on network activity depended on the functional identity of the cells in the network, we reasoned that any relationship between the network effects and behavioral effects of photostimulation must also depend on functional identity. We therefore examined each group of neurons characterized by their functional similarity individually (Fig. 4a, left). For example, we collected across all sessions the group of neurons most functionally similar to the targeted neurons and plotted the effect of photostimulation on their activity against the effect of photostimulation on behavior from those sessions (Fig. 4a, top right). We then measured the correlation of these network effects and behavioral effects, and refer to this measurement as the neural-behavioral coupling. We then repeated this analysis for each functional similarity group and plotted the neural-behavioral couplings as a function of similarity (Fig. 4a, bottom right; Fig. 4b, orange data). We performed the same analysis for data obtained in the disengaged state (Fig. 4b, blue data). We found that the neural-behavioral coupling of a given population of neurons was systematically related to the functional similarity of those neurons with the photostimulated neurons, with the coupling between neural and behavioral effects increasing as the functional similarity to the target neurons increases (mean correlation coefficient across resamples r = 0.19, P < 0.001 with respect to the shuffled distribution). Importantly, the same was not true of data obtained during the disengaged state (mean correlation coefficient across resamples r = −0.04, P = 0.279 with respect to the shuffled distribution). This indicates that the network effects of exogenous cortical activation can explain behavioral effects only when activation is performed during engaged states, and only when one interrogates the appropriate task-relevant neurons.

Fig. 4. The coupling between behavioral response and network response to photostimulation depends on the functional similarity of neurons, and is gated by brain state.

Fig. 4

a Relating the photostimulation induced change in behavior to the photostimulation induced change in network activity within subpopulations of functionally defined neurons. An example schematic showing how the neural-behavioral coupling is computed. Left: example behavioral and neural data from an example session (only the intermediate contrasts (2, 5, 10%) are considered for the coupling analysis). Top right: All data across sessions belonging to one functional similarity group are used to compute the linear correlation coefficient between the change in behavior and the change in neural activity, termed the neural-behavioral coupling. Bottom right: We collect neural-behavioral coupling measurements for all functional similarity groups of neurons. b The neural-behavioral coupling as a function of functional similarity (with respect to the target neurons). A relationship between the change in activity and the change in behavior is only seen in the more engaged state. We observe a monotonic relationship across functional similarity groups whereby the neurons most functionally similar to the stimulated targets show the tightest coupling with behavior. Separate data points at the far right are the directly targeted cells and not included in the fit. The error bars around individual datapoints are standard error (SE), the error bars around the fitted lines are SE, both are computed by resampling with replacement. Significance indicates the percentile of the shuffled distributed the real slopes lie in where *** refers to a P value < 0.001. n = 28 sessions, 12 mice.

Discussion

We demonstrate that the causal influence of augmenting task-related activity in L2/3 of mouse V1 depends on behavioral state: exogenous stimulation only translates into an effect on behavior when the animal is highly engaged in the task at hand. When the animal is less engaged, the additional cortical activity has no consistent influence, perhaps suggesting a different population of neurons are relied upon to solve the task in this state. We also show that the artificially generated patterns of cortical activity can either help or impair detection of the visual stimulus, depending on the strength of the visual stimulus the perturbation is delivered coincident with. In other words, the activity patterns evoked by photostimulation are altered by interaction with activity patterns evoked by sensory stimulation. These findings provide new insights into how cortex can have a flexible impact on sensory-guided behavior.

Why, and how, is the influence of cortical activity gated by behavioral state? In primates, turning attention to a particular location of visual space has two effects: enhanced sensory-evoked neural responses, and improved behavioral performance93. However, it is unclear whether the enhanced neural responses reflect or drive the perceptual improvement. Our results provide causal evidence that L2/3 of mouse V1 determines the perception of a stimulus only when mice are in an engaged state. When the mice are less engaged (but still performing the task) they may resort to a more reflexive, and perhaps sub-cortical, strategy. This gating may be implemented by relative weighting of the effect of visual cortical activity on higher cortical or sub-cortical areas, perhaps through neuromodulatory circuits6. One possible candidate is the superior colliculus (SC), which is involved in processing visual information and coordinating motor output94,95. The SC and visual cortex bidirectionally interact96, with V1 projecting prominently to the SC97, modulating visually evoked responses there98 and behaviors controlled by it99102. Indeed, inactivation of mouse SC impacts perceptual behavior103. Alternatively, gating may be implemented by differentially weighting activity arising from cortical or sub-cortical sources on a common downstream target, for example the pulvinar nuclei of the thalamus104. We observed task-related activity in cortex in the disengaged state, but our perturbation results suggest that this activity does not propagate as effectively or is not integrated as strongly downstream as in the engaged state. The more synchronized cortical oscillations in the less engaged state may impede the transmission of information between areas105,106.

Interestingly, we did not observe a state-dependence of the local network response to photostimulation – the resulting suppression of activity was similar across the behavioral states, reflecting highly effective synaptic recruitment of local inhibition83,84,86 which dominates the network response89 despite the E/I balance being shifted towards excitation in more engaged states81 (see also Fig. 3b). However, when the animal was more engaged in our task, neurons were activated more strongly by the visual stimulus (consistent with results from primates attending to a visual stimulus107109), and the target cells themselves were more excited by the direct photostimulation. Therefore, in the task-engaged state, the photostimulated target cell activity and the activity of other cells that escaped local inhibition must be more effectively transmitted further downstream to unobserved areas110. Our results should inspire future work to investigate how activity propagates from L2/3 to the L5 output network and from there ultimately to other cortical, and sub-cortical, areas in different behavioral states.

What is the link between the network and the behavioral effects of photostimulation? In broad terms, as the behavioral effect of photostimulation became more suppressive, so did the network effects. While the behavioral effect at low contrast was facilitating, the local network effects were still negative on average, indicating that the strong direct drive of target cells outweighs the suppression of local or other unobserved downstream neurons. As the visual contrast increases the behavioral effect of photostimulation becomes negative, mirrored by more suppression of local neurons, suggesting that the relative contribution of the directly stimulated target cells is overridden by the greater levels of suppression in the network. Our finding that functionally similar neurons are more strongly affected by photostimulation as contrast increases, and that their activity is most strongly related to behavior, indicates that mapping the routing of information through functionally specific circuits is crucial to explaining behavior. Mechanistically, this effect may be mediated by functionally specific inhibitory connectivity111. Our core results on the network effects of targeted photostimulation (Fig. 3g–i) are consistent with a previously described like-suppresses-like motif 72. Depending on how we divide background cells into subpopulations we see varying degrees of facilitation of functionally similar cells at low contrasts (Supplementary Fig. 7E–J) as in other studies where predominantly excitatory network effects were observed37,38. Taken together our results align with predictions made by a recent modeling study112 simulating the effect of optogenetic perturbations in a realistic model of visual cortex with a range of stimulus contrasts. In terms of the behavioral relevance of visual encoding, when the stimulus contrast is high, cortex may act to reduce redundancy through like-to-like suppression and ensure an efficient code111,113118. Additional stimulation in this condition may go beyond reducing redundancy to suppressing behaviorally useful information, leading to a reduction in performance.

Our results are consistent with a dynamic allocation of cortical resources according to attention-like behavioral states119 and thus highlight a modulatory role of cortex in a learned behavior likely also served by subcortical pathways. This perspective helps to reconcile apparently contradictory findings about the role of the cortex in behavioral tasks42,43,4951. Our results are complementary to recent findings from lesion and silencing experiments50,120 suggesting that some fully learned tasks are no longer cortically dependent, but go beyond those studies in showing that the influence of cortex can change even on very short timescales. Such short time-scale modulation by internal state is reminiscent of attentional processes, which may rely on mechanisms similar to what we study here, to modify the influence of cortex over behavioral output. This gating of cortical influence on behavior by attentional or behavioral states demonstrates that the causality of cortical activity depends on behavioral context and reminds us that no brain region acts in isolation121123. Accounting for stimulation-induced suppression and state-dependent gating of downstream effects as described here will likely be important for the successful operation of future brain machine interfaces (BMIs).

Methods

All experimental procedures were carried out under license from the UK Home Office in accordance with the UK Animals (Scientific Procedures) Act (1986).

Animal preparation

We used transgenic GCaMP6s mice (Emx1-Cre;CaMKIIa-tTA;Ai9469) of both sexes aged between P49 and P67 (at time of surgery). Doxycycline treatment in drinking water from birth to P49 prevented interictal activity in the Ai94 mouse line124. Animals were kept on a 12 hr light/dark cycle at a temperature of 22 °C and 62% humidity. To prepare the mice for all-optical experiments, we first excised the scalp and implanted a metal headplate. We then removed the skull and dura overlying visual cortex, injected virus encoding the opsin and implanted a chronic cranial imaging window in place of the skull. Sterile procedures were used throughout. Before surgery, mice were given a subcutaneous injection of 0.3 mg/mL buprenorphine hydrochloride (Vetergesic) and anaesthetized with isoflurane (5% for induction, 1.5% for maintenance). The scalp above the dorsal surface of the skull was removed and an aluminum headplate with a 7 mm diameter circular imaging well was fixed to the skull centered over the right monocular primary visual cortex (2.5 mm lateral and 0.5 mm anterior from lambda) using dental cement. A 4 mm diameter craniotomy was drilled inside the well of the headplate, and the dura was then carefully removed. A calibrated pipette bevelled to a sharp point (inner diameter ~15 μm) connected to a hydraulic injection system (Harvard apparatus) was used to inject small volumes of virus (AAV2/9-CaMKII-C1V1(t/t)-mRuby2-Kv2.1). The virus (stock concentration: ~6.9 ×1014 gc/ml) was diluted 10-fold in buffer solution (20 mM Tris, pH 8.0, 140 mM NaCl, 0.001% Pluronic F-68). We made ~5 insertions of the injection pipette, each site spaced by ~300 μm avoiding blood vessels. At each site we slowly lowered the pipette to a depth of 300 µm below pia and injected 150 nl of the virus solution at 50 nl/min. After each injection the pipette was left in place for a further 3 min before slowly retracting. We then press-fit a chronic window (a 3 mm coverslip bonded to the underside of a 4 mm coverslip with UV-cured optical cement, NOR-61, Norland Optical Adhesive) into the craniotomy, sealed with cyanoacrylate (Vetbond) and fixed in place with dental cement (SuperBond). Following surgery, animals were monitored and allowed to recover for at least 7 days. After recovery we began behavioral training. All-optical experiments were then performed >3 weeks post-surgery, allowing for sufficient expression levels (animals were aged P77–P171, median = P122 at time of experiments).

Behavioral training

We used an operant conditioning protocol whereby head-fixed mice were required to lick at a water spout positioned in front of them to report detection of a visual stimulus. Licks were recorded electrically. If the mice reported the presence of the stimulus correctly, a sugar water reward (10% w/v sucrose) was delivered through the water spout. The behavior hardware was controlled by custom software (PyBehaviour, https://github.com/llerussell/PyBehaviour) interfacing with an Arduino to trigger stimuli, record licks and deliver rewards. Mice had free access to food in their home cage, but access to water was limited to that acquired during the task. Mice had their weight monitored before and after daily training and were supplemented with additional water to maintain a minimum of 80% of their starting body weight. Before training, mice were habituated to handling and head restraint over 2 days. Training then took place in individual sound-dampened enclosures in which the mice were head-fixed and allowed to run on a treadmill. While not an integral part of the task design, we found that allowing mice to be free to run improved their performance in the task. Trials were triggered after mice withheld licks for 4 ± 3 s, after which a monocular visual stimulus appeared in the center of the monitor. If the mice licked at the water spout at any point within 1.5 s of the stimulus appearing a reward was delivered. In the first few days of training a reward was delivered automatically at 800 ms. Mice quickly learnt the requirements of the task and their reaction times preceded this automatic reward delivery time. After a few days the automatic reward delivery was disabled. After the stimulus and response window there was a fixed inter-trial period of 7 s before the next ‘withhold’ period was started. We also delivered randomly interleaved catch trials (no visual stimulus) to record chance rate of licking and assess accuracy in the task. Once stable performance was reached, we progressed the mice to a psychophysical variant of the task where we introduced a range of contrasts (1%, 2%, 5%, 10%, 100%) to assess their perceptual sensitivity and threshold. We found that task performance was insensitive to stimulus location on the monitor. For the final experiment the trial order was pseudo randomized to ensure that repeats of the same probe types were not immediately consecutive.

Visual stimulation

Visual stimuli were generated using custom software (using PsychoPy, ref. 125). 30° Gabor patches of drifting sinusoidal gratings (8 directions, 0 to 315° in 45° increments) with a spatial frequency of 0.04 cycles per degree and a temporal frequency of 2 Hz were presented on a monitor (typically 51.8 cm width, 32.4 cm height, 15 cm from the animals left eye covering up to ± 47° of the vertical visual field and ± 60° of the horizontal visual field), with a spherical distortion applied to correct perspective errors.

Training

During training the orientation of the stimulus was randomized on every trial and the duration of the stimulus was 1 s. Rewards were delivered if the mouse licked during the response window regardless of the orientation of visual stimulus.

Mapping orientation preference

To map orientation preference of single cells in a FOV with two-photon imaging, the visual stimuli were positioned in the retinotopically appropriate location and were presented in a randomized order with a duration of 3 s, interleaved by 5 s of mean luminance gray. If mice licked at the water spout during this mapping block a water reward was delivered.

Experiment

During the behavioral experiments with photostimulation, the visual stimuli parameters were the same as during training, except only one orientation was presented (to match the photostimulation ensemble’s preference) and the stimulus was positioned in the retinotopically appropriate location for the imaging field of view. A range of contrasts (1%, 2%, 5%, 10%, 100%) with equal trial proportions were presented to the animals.

Widefield imaging

To locate primary visual cortex, and position the experimental field of view, widefield GCaMP imaging was performed (usable FOV~2 × 2 mm). GCaMP6s fluorescence produced by one-photon excitation (470 nm LED, Thorlabs) was collected through a 5x/0.1-NA air objective (Olympus) onto a CMOS camera (Hamamatsu ORCA Flash 4.0, binned image size of 512 × 512 pixels, 20 Hz frame rate). Contrast-reversing checkerboard bars, 10° wide were drifted vertically and horizontally across a gray screen at a speed of 25°/s in an interleaved sequence. Stimulus-triggered change in fluorescence for the two different stimuli revealed areal borders and identification of primary visual cortex126. This was repeated with two-photon imaging on the day of the experiment to confirm the retinotopic location of the chosen field of view.

Two-photon population imaging

Two-photon imaging was performed with a resonant scanning microscope (Ultima II, Bruker Corporation) using a Chameleon Ultra II laser (Coherent) driven by PrairieView. A 16×/0.8-NA water-immersion objective (Nikon) was used for all experiments. An ETL (Optotune EL-10-30-TC, Gardasoft driver) was used to perform volumetric imaging, spanning a 100 μm range with 33.3 μm spacing between 4 planes. The FOV size was 710 × 710 μm at a resolution of 512 × 512 pixels. The number of cells recorded (ROIs after curation) per experiment ranged from 1266 to 4891 (mean = 2765 ± 995). The per-plane frame rate was 7 Hz (total acquisition rate 30 Hz). GCaMP6s was imaged at 920 nm and mRuby (conjugated to C1V1-Kv2.1) was imaged at 765 nm. Power on the sample was 50 mW at the shallowest plane (~150–200 μm below pia) and increased to ~85 mW at the deepest plane (~250–300 μm below pia), interpolating for intermediate planes, to equalize imaging quality across planes. To maximize imaging quality127 we calculated the tilt of the sample relative to the microscope and then rotated the objective along two axes to be perpendicular to the implanted coverslip window.

Two-photon photostimulation

Two-photon photostimulation was carried out using a fiber laser at 1030 nm (Satsuma, Amplitude Systèmes, 2 MHz repetition rate). The laser beam was split via a reflective spatial light modulator (SLM) (7.68 × 7.68 mm active area, 512 × 512 pixels, OverDrive Plus SLM, Meadowlark Optics/Boulder Nonlinear Systems) which was installed in-line of the photostimulation path (NeuraLight 3D, Bruker Corporation). Phase masks used to generate focused beamlet patterns in the sample were calculated via the weighted Gerchberg-Saxton algorithm. The targets were weighted according to their location relative to the center of the SLM’s addressable FOV to compensate for the decrease in diffraction efficiency when directing beamlets to peripheral positions. We calibrated the targeting of SLM spots in imaging space by burning arbitrary patterns with the SLM using the photostimulation laser in a fluorescent plastic slide before taking a volumetric stack of the sample with the imaging laser. We manually located the burnt spots and the corresponding affine transformation from SLM space to imaging space was computed. For 3D stimulation patterns we interpolated the transformation required from the nearest calibrated planes (Calibration code: https://github.com/llerussell/SLMTransformMaker3D). To increase stimulation efficiency, we offset the photostimulation FOV with the photostimulation galvanometers such that the center of SLM space was close to the cortical/imaging-space centroid of targeted cells. Spiral photostimulation patterns (3 rotations, 10 μm diameter, 20 ms duration) were generated by moving all beamlets simultaneously with the galvanometer mirrors. The laser power was adjusted to maintain 6 mW per target cell. Photostimulation during the behavioral task was delivered at 20 Hz (1 spiral every 50 ms) for 1 s with the same onset time as the visual stimulus.

Characterization of photostimulation resolution with pharmacological blockade

To characterize the stimulation resolution, we stimulated single cells in separate non-behavioral sessions with the same stimulation parameters as used in the experiments (15 μm spiral, 20 ms spiral duration, repeated every 50 ms (20 Hz) for 1 s). We offset the stimulation spot using the SLM by 0, 5, 10, 15, 20, 30 μm laterally and −75, −50, −25, −10, 0, +10, +25, +50, +75 μm axially (at 0 μm lateral offset). In each animal (n = 3 mice), we stimulated 8 single cells: one at a time every 2 s, for 10 repeats of each stimulation offset for each cell. In these experiments, we used animals implanted with chronic windows with a small access hole drilled in the middle, covered with a silicone plug128. By removing the plug we gained access to the brain surface (dura removed prior to window implantation), to which we could apply pharmacological agents. We applied a mixture of 1 mM NBQX and 2 mM AP5 (in IVE)129,130 to block excitatory synaptic activity to disambiguate off-target stimulation from synaptic recruitment of nearby cells.

Naparm (Near automatic photoactivation response mapping)

To find photostimulation-responsive cells we semi-automatically detected cell locations from expression images and stimulus-triggered average or pixel-correlation images (STA Movie Maker, https://github.com/llerussell/STAMovieMaker) fed into Cellpose131 and manually curated. These cell body coordinates were then clustered into equal size groups of user-determined size (between 10 and 50) and the groups were stimulated one by one. The associated phase mask, galvanometer positioning, and Pockels cell control protocol were generated with custom MATLAB software (Naparm, https://github.com/llerussell/Naparm) and executed by the photostimulation modules of the microscope software (PrairieView, Bruker Corporation) and the SLM control software (Blink, Meadowlark). For photo-responsivity mapping purposes, we used a stimulation rate of 20 Hz, for 500 ms per pattern, stimulating a different pattern every 1.5 s, and performed 8–10 trials of each pattern. These data were then analyzed online together with the visual response mapping data to extract activity traces and design stimulation ensembles (see below).

Synchronization

For subsequent synchronization during analysis, analog signals of various trigger lines were recorded with a National Instruments DAQ card, controlled by PackIO132. The recorded inputs included two-photon imaging frame pulses, photostimulation triggers, galvanometer command signals, triggers to and frame flip pulses from the visual stimulus and the SLM phase mask update. Photostimulation trials for the responsivity mapping block were triggered at a fixed rate from an output line on the DAQ card. For the online behavior experiments photostimulation and visual trials were triggered through the behavior software and hardware.

Experimental protocol

On the day of the full experiment, the following protocol was used. First, we located a region of cortex showing optimal coexpression of opsin and indicator, guided by widefield retinotopy, and confirmed the corresponding retinotopic location with two-photon imaging. After determining where to position the visual stimulus on the monitor we then presented drifting gratings of 8 different orientations while performing two-photon imaging to map orientation preferences of the recorded cells. Rewards were delivered during the visual stimuli if the mouse licked. Next, we photostimulated a large proportion of all cells in the recorded volume to find which ones were photostimulation-responsive. Finally, we designed photostimulation patterns for use in the behavior experiment (see below). We then gave the mice ~10 warm up ‘easy’ (high contrast) trials before the main behavioral experiment began. We recorded in 20 min blocks, manually correcting for any drift in imaging FOV between recordings.

Online photostimulation ensemble design

To increase the speed of data analysis immediately prior to the experiment, we streamed the raw acquisition samples to custom software (PrairieLink, RawDataStream, https://github.com/llerussell/Bruker_PrairieLink). We used this raw stream to process the pixel samples, construct imaging frames, and perform online motion correction. Processing online allowed us to directly output to a custom file format making the data immediately available for analysis. Motion-corrected movies were loaded into MATLAB (MathWorks), and traces were extracted from both the photostimulation and the visual stimulation movies, using the photostimulation targets as seed points around which circular ROIs were dilated. We subtracted a neuropil signal from the ROI signal before determining responsivity. We determined cells as photostimulation-responsive if their evoked response (in a~500 ms window after stimulus offset) to their direct stimulation was >30% ΔF/F on >50% trials. We determined cells as visually responsive by the same criteria (with response window of 2 s during the stimulus presentation), additionally specifying their preferred orientation as the stimulus that elicited the largest average response. The final stimulation pattern was then designed in each experiment. After filtering for photostimulation-responsive cells, the co-tuned group was selected, taking the largest group of photostimulation-responsive and orientation-tuned neurons (minimum number of targets: 6, maximum: 73, median: 23).

Pre-processing: Imaging frame registration, ROI segmentation and neuropil correction

For the final analysis, the raw calcium imaging movies were pre-processed using Suite2p133. The pipeline included image registration, segmentation of active region of interest (ROIs), and of local surrounding neuropil signal. The final selection of ROIs was filtered semi-automatically using anatomical criteria to include only neuronal somata and discard spurious ROIs. We manually inspected all FOVs to ensure consistent results. We subtracted a neuropil signal from every ROI signal. The contamination of the ROI signal by the neuropil signal depends on many factors, including expression levels, imaging quality, and axial sectioning by the imaging plane. We used robust linear regression to estimate the coefficient of neuropil contamination for each ROI (Supplementary Fig. 9; ref. 68). The slope of this fit was used to scale the neuropil signal before subtraction from the ROI signal, such that after subtraction there was no correlation between the ROI baseline and neuropil. Neuropil subtraction had minimal effect on the response magnitude, and negative responses to visual- and photo-stimulation were seen even without subtracting the neuropil contamination (Supplementary Figs. 9 and 10).

ROI exclusion zones

To reduce potential off-target photostimulation artifacts, we excluded from consideration all cells within a 30 μm diameter cylinder extending through all axial planes when analyzing the network response to photostimulation due to potential imaging and photostimulation artifacts (see Supplementary Fig. 9). We redefined our target stimulation pattern identities based on the ROIs segmented by Suite2p within the 30 μm lateral disk around each of the SLM target locations. We also excluded ROIs in the first 100 rows of pixels of each imaging frame due to an ETL artefact related to the settle time of the lens when changing planes.

Neuronal response metric

To measure neuronal responses, we extracted the mean fluorescence in a ~500 ms window (4 frames) starting immediately after the photostimulation ended (and/or visual stimulus to ensure comparable measurements) and subtracted the mean fluorescence in the ~1 s baseline (7 frames) before the onset of photostimulation (or visual stimulus). We divided the difference in the means by the mean of the baseline window, resulting in trial-by-trial ΔF/F values. We excluded all photostimulation frames because of the associated artefact contaminating the activity traces; the slow kinetics of GCaMP6s permit this, although the magnitude of response is underestimated as a result.

Hit:miss ratio matching

To counteract motor and reward-related confounds of licks occurring within the neural analysis window, we ensured that the ratio of hits to misses (trials with licks vs trials with no licks) were equalized across comparisons. Ensuring a 50:50 ratio of hits to misses across all trial types in a given session would result in unnecessary loss of data in trials where hits or misses made up the entirety of trial responses. The more relevant control to make is not across contrasts, but across behavioral states (the more-engaged state versus the less-engaged state) or trial type (with or without photostimulation). We therefore ensured that the proportion of hits to misses at a particular stimulus contrast were equal across a given comparison (state or photostimulation). We determined the minimum number of hits on a given contrast across the conditions and the minimum number of misses on a given contrast across conditions (e.g., at 5% contrast in both states, or at 5% contrast in the less-engaged state with and without photostimulation). We then resampled without replacement taking the minimum common number of hits and the minimum number of misses from the original trials. As the minimum number is computed across conditions, the resampled collections of trials have the same proportion of hits to misses in both conditions. We then averaged the resampled trials together and repeated this procedure 10,000 times, storing the average result for a given neurons response in that condition.

Contrast response similarity metric

To functionally characterize all recorded neurons relative to the photostimulated neurons, we compared their responses to different contrasts of the visual stimulus (only one orientation was used) presented in the final behavioral experiments. As our functional similarity measurement (correlation of average responses to visual stimuli) and photostimulation mediated change metric (average difference in responses between trials with visual stimuli and photostimulation and trials with just visual stimuli) would share the same datapoints we cross-validated. Specifically, we randomly split the dataset in half and used one half for the contrast similarity measurement and the other half for the measurement of photostimulation induced changes. For the contrast similarity metric in a given session we averaged together the photostimulated population to give a group average response curve. We then computed the Pearson’s correlation of all single cell contrast response curves with the photostimulated population average curve. For the photostimulation mediated change in activity of a given cell we averaged together responses in all trials of a particular contrast and stimulation condition. We subtracted the visual only trial responses from the joint visual and photostimulation trial responses. We binned all neurons per session into 20 evenly spaced bins ranging from maximally dissimilar to maximally similar to the target group. We computed the average response within each similarity group. We performed all analyses in Figs. 3h, i and 4 with these cross-validated metrics, repeating the procedure 5000 times with different random trial splits, computing the metric of interest within each split and reporting the average across splits.

In Supplementary Fig. 7 we also characterize neurons based on their orientation tuning curves (8 different orientations were presented in a short mapping session before the main photostimulation experiment) and computed the Pearson’s correlation of those single cell tuning curves to the photostimulated population average tuning curve.

Neural-behavioral coupling

To obtain bootstrapped statistics of the neural-behavioral coupling we performed the following shuffling and resampling procedures. We split the network into functional similarity bins and compute the cross-validated change in activity (see above). For each similarity bin we correlate the average response within group, and pooled across sessions, to the 3 intermediate contrasts (2, 5, 10%) with the change in d-prime on the same contrasts. Each similarity group from each session thus contributes 3 datapoints to the neural-behavioral coupling measurements. This correlation coefficient is termed the neural-behavioral coupling. We then performed a linear regression on the neural-behavioral couplings as a function of functional similarity to summarize the overall effect whereby most highly similar neurons have the strongest coupling with behavior. We bootstrapped the neural-behavioral coupling fit through the functional similarity groups by resampling sessions with replacement, 5000 times. We report the mean slope obtained through this resampling procedure. To ask whether the resampled distribution of slopes is different from those expected by chance given the dataset we performed a shuffling procedure to derive a null distribution against which to compare. For this, we shuffled trial contrast identity amongst the intermediate contrasts, mixing behavioral and neural responses across trials but maintaining the overall statistics within sessions. We repeated this shuffle 5000 times and within each shuffle we computed cross-validated contrast similarity and photostimulation response metrics. We averaged these responses across shuffle to obtain the final shuffled behavioral and neural responses. With these shuffled responses we performed the same neural-behavioral coupling procedure to generate a null distribution of slopes expected by chance.

Behavioral session truncation

To ensure we only analyzed periods of the behavioral session where the mice were similarly engaged and motivated, we truncated the session when the rolling average performance (20 trial sliding window) of the ‘easy’ highest contrast trials dropped below 80% of the starting performance.

Data exclusion criteria

We excluded trials if >50% of photostimulation targets failed to respond on that trial. We also excluded trials if the mice licked early (within the first 150 ms of the presentation of the visual stimulus). Whole sessions were excluded if fewer than 10 trials in any trial type remained (the median minimum number of trials per trial type (note each session has 12 trial types) in included sessions = 31 trials (range 10–56)). Out of 32 completed sessions, 3 were excluded because of poor photostimulation efficiency.

Statistical procedures

No statistical methods were used to predetermine sample size. Investigators were not blinded to allocation during experiments and outcome assessment. Summary statistics in the text are reported as mean ± SD unless otherwise indicated. Solid lines and shaded areas or error bars in plots represent mean ± SEM unless otherwise indicated. Statistical tests used are specified in the text and were generally paired, two-tailed and non-parametric. We use the following convention for representing P-values in all figures: P > = 0.05 (n.s.), P < 0.05 (*), P < 0.01 (**), P < 0.001 (***).

Pre-trial pupil size

We recorded the right pupil throughout the experiment using a Dalsa Genie Nano-M1280 camera with a Kowa LM50JC lens. The camera frames were acquired at 30 Hz triggered by pulses from the 2P imaging system. The laser light used for 2P imaging, evident through the back of the pupil, was blocked from the camera using a 900 nm shortpass filter. The animal was illuminated with an 850 nm LED. The visual stimulus monitor provided ambient light. We used DeepLabCut134 to track 11 points (6 around the circumference of the pupil, 4 around the eye lid, 1 on the nose and 1 on the tongue (only visible when the animal licked), the tongue point allowed for synchronization with the imaging and behavioral data by cross-correlating the DeepLabCut tongue signal with the electrically recorded lickometer signal. The area bounded by the 6 pupil points was used as the pupil size. We normalized the pupil size by the median size across the whole session.

Pre-trial synchrony

To compute the network synchrony prior to presentation of the visual stimulus, we used deconvolved activity traces (OASIS133,135) smoothed with a Gaussian filter (sigma = 0.5 s). We used a 4 s window immediately prior to the initiation of the trial (delivery of a stimulus, if not a catch trial) as the ‘pre-trial’ period. We then computed pairwise Pearson’s correlations between all cells within this time window and averaged together all pairwise correlation coefficients across all cells (including targets) to give the total network correlation or synchrony. We z-scored all network correlations within animal and across all trial types to facilitate across animal comparisons. When comparing hit and miss trials, we resampled 10,000 times to match trial numbers.

Pre-trial state

We used both the pupil-size and neural synchrony to produce a combined measure of state trial-by-trial. To compute this, we z-scored both variables and summed them, weighting the pupil by −1 to account for the inverse relationship between the two variables. Based on this combined state score we median split each session into two equal size subsets, corresponding to two behavioral states.

Psychometric curve fitting

We used Psignifit136 to fit a Weibull curve fixing the lambda (lapse rate) and gamma (guess rate) parameters, while allowing the estimation of alpha and beta (threshold and slope). The threshold of the curve is defined as the stimulus contrast where behavioral performance is 50%. The width of the curve is defined as the difference in stimulus units between 5% and 95% behavioral performance.

We computed d-prime for each stimulus type to control for chance rate of licking within a session using the catch trials without photostimulation as the false alarm rate. We also observe the same results when computing d-prime using the catch trials with photostimulation as the false alarm rate (Supplementary Fig. 4).

Reporting summary

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

Supplementary information

Peer Review File (3.3MB, pdf)
Reporting Summary (2.4MB, pdf)

Source data

Source Data (543.1KB, xlsx)

Acknowledgements

We thank Matteo Carandini, Beverley Clark, Kenneth Harris, Nick Steinmetz and Arnd Roth for helpful discussions and comments on the manuscript; Brendan Bicknell, Dustin Herrmann and Evelyn Wong for comments on the manuscript; Soyon Chun and Agnieszka Jucht for mouse breeding; Maite Marcantoni and Florence Bui for behavioral training during pilot experiments; Arthur Gretton and Peter Latham for analysis advice; and Bruker Corporation for technical support. This work was supported by grants from the Wellcome Trust (PRF 201225 and 224688), ERC (AdG 695709), MRC (MR/T022922/1) and the BBSRC (BB/N009835/1).

Author contributions

L.E.R. performed surgeries, trained animals, performed experiments, and analyzed data. Z.Y. and L.P.T. trained animals. M.F. and A.M.P. provided valuable advice about experimental design and analysis. L.E.R. built hardware and software for control of behavioral training and for calibration and control of photostimulation. H.W.P.D. helped build photostimulation control software. S.C. and C.D.H. provided C1V1-Kv2.1 virus. L.E.R. and M.H. conceived and designed the study and wrote the manuscript with input from all authors.

Peer review

Peer review information

Nature Communications thanks the anonymous reviewers for their contribution to the peer review of this work. A peer review file is available.

Data availability

Datasets supporting the findings of this study are available from the corresponding author upon request. Source data are provided with this paper.

Code availability

Custom code used for data acquisition, photostimulation control, behavioral training and analysis have been deposited online: Naparm https://github.com/llerussell/Naparm, 10.5281/zenodo.10449686, PyBehaviour https://github.com/llerussell/PyBehaviour, 10.5281/zenodo.10449684, 3D SLM calibration https://github.com/llerussell/SLMTransformMaker3D, 10.5281/zenodo.10449682, STAMovieMaker https://github.com/llerussell/STAMovieMaker, 10.5281/zenodo.10449680, RawDataStream https://github.com/llerussell/Bruker_PrairieLink, 10.5281/zenodo.10449690, Objective rotation https://github.com/llerussell/MONPangle, 10.5281/zenodo.10449688.

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

The online version contains supplementary material available at 10.1038/s41467-024-46484-5.

References

  • 1.McCormick DA, Nestvogel DB, He BJ. Neuromodulation of brain state and behavior. Annu Rev. Neurosci. 2020;43:391–415. doi: 10.1146/annurev-neuro-100219-105424. [DOI] [PubMed] [Google Scholar]
  • 2.Raymond JE. Attentional modulation of visual motion perception. Trends Cogn. Sci. 2000;4:42–50. doi: 10.1016/S1364-6613(99)01437-0. [DOI] [PubMed] [Google Scholar]
  • 3.Harris KD, Thiele A. Cortical state and attention. Nat. Rev. Neurosci. 2011;12:509–523. doi: 10.1038/nrn3084. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.McGinley MJ, et al. Waking state: rapid variations modulate neural and behavioral responses. Neuron. 2015;87:1143–1161. doi: 10.1016/j.neuron.2015.09.012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Treue S. Neural correlates of attention in primate visual cortex. Trends Neurosci. 2001;24:295–300. doi: 10.1016/S0166-2236(00)01814-2. [DOI] [PubMed] [Google Scholar]
  • 6.Lee SH, Dan Y. Neuromodulation of brain states. Neuron. 2012;76:209–222. doi: 10.1016/j.neuron.2012.09.012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Sara SJ. The locus coeruleus and noradrenergic modulation of cognition. Nat. Rev. Neurosci. 2009;10:211–223. doi: 10.1038/nrn2573. [DOI] [PubMed] [Google Scholar]
  • 8.Joshi S, Li Y, Kalwani RM, Gold JI. Relationships between pupil siameter and neuronal activity in the locus coeruleus, colliculi, and cingulate cortex. Neuron. 2016;89:221–234. doi: 10.1016/j.neuron.2015.11.028. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Hess EH, Polt JM. Pupil size in relation to mental activity during simple problem-solving. Science. 1964;143:1190–1192. doi: 10.1126/science.143.3611.1190. [DOI] [PubMed] [Google Scholar]
  • 10.McCormick DA, McGinley MJ, Salkoff DB. Brain state dependent activity in the cortex and thalamus. Curr. Opin. Neurobiol. 2015;31:133–140. doi: 10.1016/j.conb.2014.10.003. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Goard M, Dan Y. Basal forebrain activation enhances cortical coding of natural scenes. Nat. Neurosci. 2009;12:1444–1449. doi: 10.1038/nn.2402. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Niell CM, Stryker MP. Modulation of visual responses by behavioral state in mouse visual cortex. Neuron. 2010;65:472–479. doi: 10.1016/j.neuron.2010.01.033. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Vinck M, Batista-Brito R, Knoblich U, Cardin JA. Arousal and locomotion make distinct contributions to cortical activity patterns and visual encoding. Neuron. 2015;86:740–754. doi: 10.1016/j.neuron.2015.03.028. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Polack PO, Friedman J, Golshani P. Cellular mechanisms of brain state-dependent gain modulation in visual cortex. Nat. Neurosci. 2013;16:1331–1339. doi: 10.1038/nn.3464. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Britten KH, Shadlen MN, Newsome WT, Movshon JA. The analysis of visual motion: a comparison of neuronal and psychophysical performance. J. Neurosci. 1992;12:4745–4765. doi: 10.1523/JNEUROSCI.12-12-04745.1992. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Chen Y, et al. Task difficulty modulates the activity of specific neuronal populations in primary visual cortex. Nat. Neurosci. 2008;11:974–982. doi: 10.1038/nn.2147. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Boudreau CE, Williford TH, Maunsell JH. Effects of task difficulty and target likelihood in area V4 of macaque monkeys. J. Neurophysiol. 2006;96:2377–2387. doi: 10.1152/jn.01072.2005. [DOI] [PubMed] [Google Scholar]
  • 18.Assad JA. Neural coding of behavioral relevance in parietal cortex. Curr. Opin. Neurobiol. 2003;13:194–197. doi: 10.1016/S0959-4388(03)00045-X. [DOI] [PubMed] [Google Scholar]
  • 19.Cohen MR, Maunsell JH. Attention improves performance primarily by reducing interneuronal correlations. Nat. Neurosci. 2009;12:1594–1600. doi: 10.1038/nn.2439. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Salzman CD, Britten KH, Newsome WT. Cortical microstimulation influences perceptual judgements of motion direction. Nature. 1990;346:174–177. doi: 10.1038/346174a0. [DOI] [PubMed] [Google Scholar]
  • 21.Salzman CD, Murasugi CM, Britten KH, Newsome WT. Microstimulation in visual area MT: effects on direction discrimination performance. J. Neurosci. 1992;12:2331–2355. doi: 10.1523/JNEUROSCI.12-06-02331.1992. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Seidemann E, Zohary E, Newsome WT. Temporal gating of neural signals during performance of a visual discrimination task. Nature. 1998;394:72–75. doi: 10.1038/27906. [DOI] [PubMed] [Google Scholar]
  • 23.DeAngelis GC, Cumming BG, Newsome WT. Cortical area MT and the perception of stereoscopic depth. Nature. 1998;394:677–680. doi: 10.1038/29299. [DOI] [PubMed] [Google Scholar]
  • 24.Ditterich J, Mazurek ME, Shadlen MN. Microstimulation of visual cortex affects the speed of perceptual decisions. Nat. Neurosci. 2003;6:891–898. doi: 10.1038/nn1094. [DOI] [PubMed] [Google Scholar]
  • 25.Afraz SR, Kiani R, Esteky H. Microstimulation of inferotemporal cortex influences face categorization. Nature. 2006;442:692–695. doi: 10.1038/nature04982. [DOI] [PubMed] [Google Scholar]
  • 26.Cicmil N, Krug K. Playing the electric light orchestra–how electrical stimulation of visual cortex elucidates the neural basis of perception. Philos. Trans. R. Soc. Lond. B Biol. Sci. 2015;370:20140206. doi: 10.1098/rstb.2014.0206. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Romo R, Hernandez A, Zainos A, Salinas E. Somatosensory discrimination based on cortical microstimulation. Nature. 1998;392:387–390. doi: 10.1038/32891. [DOI] [PubMed] [Google Scholar]
  • 28.Murphey DK, Maunsell JH. Behavioral detection of electrical microstimulation in different cortical visual areas. Curr. Biol. 2007;17:862–867. doi: 10.1016/j.cub.2007.03.066. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29.Bartlett JR, Doty RW. An exploration of the ability of macaques to detect microstimulation of striate cortex. Acta Neurobiol. Exp. 1980;40:713–727. [PubMed] [Google Scholar]
  • 30.Houweling AR, Brecht M. Behavioural report of single neuron stimulation in somatosensory cortex. Nature. 2008;451:65–68. doi: 10.1038/nature06447. [DOI] [PubMed] [Google Scholar]
  • 31.Huber D, et al. Sparse optical microstimulation in barrel cortex drives learned behaviour in freely moving mice. Nature. 2008;451:61–64. doi: 10.1038/nature06445. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32.Sachidhanandam S, Sreenivasan V, Kyriakatos A, Kremer Y, Petersen CC. Membrane potential correlates of sensory perception in mouse barrel cortex. Nat. Neurosci. 2013;16:1671–1677. doi: 10.1038/nn.3532. [DOI] [PubMed] [Google Scholar]
  • 33.Histed MH, Maunsell JH. Cortical neural populations can guide behavior by integrating inputs linearly, independent of synchrony. Proc. Natl Acad. Sci. USA. 2014;111:E178–E187. doi: 10.1073/pnas.1318750111. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 34.Dalgleish, H. W. et al. How many neurons are sufficient for perception of cortical activity? eLife9, 10.7554/eLife.58889 (2020). [DOI] [PMC free article] [PubMed]
  • 35.Gill JV, et al. Precise holographic manipulation of olfactory circuits reveals coding features determining perceptual detection. Neuron. 2020;108:382–393 e385. doi: 10.1016/j.neuron.2020.07.034. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Daie, K., Svoboda, K. & Druckmann, S. Targeted photostimulation uncovers circuit motifs supporting short-term memory. Nat. Neurosci., 10.1038/s41593-020-00776-3. (2021). [DOI] [PubMed]
  • 37.Carrillo-Reid, L., Han, S., Yang, W., Akrouh, A. & Yuste, R. Controlling visually guided behavior by holographic recalling of cortical ensembles. Cell, 10.1016/j.cell.2019.05.045 (2019). [DOI] [PMC free article] [PubMed]
  • 38.Marshel, J. H. et al. Cortical layer-specific critical dynamics triggering perception. Science365, 10.1126/science.aaw5202. (2019). [DOI] [PMC free article] [PubMed]
  • 39.Robinson NTM, et al. Targeted activation of hippocampal place cells drives memory-guided spatial behavior. Cell. 2020;183:2041–2042. doi: 10.1016/j.cell.2020.12.010. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40.Tanke N, Borst JGG, Houweling AR. Single-cell stimulation in barrel cortex influences psychophysical detection performance. J. Neurosci. 2018;38:2057–2068. doi: 10.1523/JNEUROSCI.2155-17.2018. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41.Lee SH, et al. Activation of specific interneurons improves V1 feature selectivity and visual perception. Nature. 2012;488:379–383. doi: 10.1038/nature11312. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Glickfeld LL, Histed MH, Maunsell JH. Mouse primary visual cortex is used to detect both orientation and contrast changes. J. Neurosci. 2013;33:19416–19422. doi: 10.1523/JNEUROSCI.3560-13.2013. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 43.Resulaj, A., Ruediger, S., Olsen, S. R. & Scanziani, M. First spikes in visual cortex enable perceptual discrimination. Elife7, 10.7554/eLife.34044. (2018). [DOI] [PMC free article] [PubMed]
  • 44.Goldbach, H. C., Akitake, B., Leedy, C. E. & Histed, M. H. Performance in even a simple perceptual task depends on mouse secondary visual areas. Elife10, 10.7554/eLife.62156. (2021). [DOI] [PMC free article] [PubMed]
  • 45.Jin M, Glickfeld LL. Mouse higher visual areas provide both distributed and specialized contributions to visually guided behaviors. Curr. Biol. 2020;30:4682–4692 e4687. doi: 10.1016/j.cub.2020.09.015. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 46.Lashley KS. Mass action in cerebral function. Science. 1931;73:245–254. doi: 10.1126/science.73.1888.245. [DOI] [PubMed] [Google Scholar]
  • 47.Schneider GE. Two visual systems. Science. 1969;163:895–902. doi: 10.1126/science.163.3870.895. [DOI] [PubMed] [Google Scholar]
  • 48.Dean P. Visual acuity in hooded rats: effects of superior collicular or posterior neocortical lesions. Brain Res. 1978;156:17–31. doi: 10.1016/0006-8993(78)90076-8. [DOI] [PubMed] [Google Scholar]
  • 49.Dean P. Grating detection and visual acuity after lesions of striate cortex in hooded rats. Exp. Brain Res. 1981;43:145–153. doi: 10.1007/BF00237758. [DOI] [PubMed] [Google Scholar]
  • 50.Hong YK, Lacefield CO, Rodgers CC, Bruno RM. Sensation, movement and learning in the absence of barrel cortex. Nature. 2018;561:542–546. doi: 10.1038/s41586-018-0527-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 51.Wolff SB, Olveczky BP. The promise and perils of causal circuit manipulations. Curr. Opin. Neurobiol. 2018;49:84–94. doi: 10.1016/j.conb.2018.01.004. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 52.Otchy TM, et al. Acute off-target effects of neural circuit manipulations. Nature. 2015;528:358–363. doi: 10.1038/nature16442. [DOI] [PubMed] [Google Scholar]
  • 53.Rickgauer JP, Tank DW. Two-photon excitation of channelrhodopsin-2 at saturation. Proc. Natl Acad. Sci. USA. 2009;106:15025–15030. doi: 10.1073/pnas.0907084106. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 54.Papagiakoumou E, et al. Scanless two-photon excitation of channelrhodopsin-2. Nat. Methods. 2010;7:848–854. doi: 10.1038/nmeth.1505. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 55.Andrasfalvy BK, Zemelman BV, Tang J, Vaziri A. Two-photon single-cell optogenetic control of neuronal activity by sculpted light. Proc. Natl Acad. Sci. USA. 2010;107:11981–11986. doi: 10.1073/pnas.1006620107. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 56.Packer AM, et al. Two-photon optogenetics of dendritic spines and neural circuits. Nat. Methods. 2012;9:1202–1205. doi: 10.1038/nmeth.2249. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 57.Prakash R, et al. Two-photon optogenetic toolbox for fast inhibition, excitation and bistable modulation. Nat. Methods. 2012;9:1171–1179. doi: 10.1038/nmeth.2215. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 58.Rickgauer JP, Deisseroth K, Tank DW. Simultaneous cellular-resolution optical perturbation and imaging of place cell firing fields. Nat. Neurosci. 2014;17:1816–1824. doi: 10.1038/nn.3866. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 59.Packer AM, Russell LE, Dalgleish HW, Häusser M. Simultaneous all-optical manipulation and recording of neural circuit activity with cellular resolution in vivo. Nat. Methods. 2015;12:140–146. doi: 10.1038/nmeth.3217. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 60.Carrillo-Reid L, Yang W, Bando Y, Peterka DS, Yuste R. Imprinting and recalling cortical ensembles. Science. 2016;353:691–694. doi: 10.1126/science.aaf7560. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 61.Dal Maschio M, Donovan JC, Helmbrecht TO, Baier H. Linking neurons to network function and behavior by two-photon holographic optogenetics and volumetric imaging. Neuron. 2017;94:774–789 e775. doi: 10.1016/j.neuron.2017.04.034. [DOI] [PubMed] [Google Scholar]
  • 62.Yang, W., Carrillo-Reid, L., Bando, Y., Peterka, D. S. & Yuste, R. Simultaneous two-photon imaging and two-photon optogenetics of cortical circuits in three dimensions. Elife7, 10.7554/eLife.32671. (2018). [DOI] [PMC free article] [PubMed]
  • 63.Forli A, et al. Two-photon bidirectional control and imaging of neuronal excitability with high spatial resolution in vivo. Cell Rep. 2018;22:3087–3098. doi: 10.1016/j.celrep.2018.02.063. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 64.Mardinly AR, et al. Precise multimodal optical control of neural ensemble activity. Nat. Neurosci. 2018;21:881–893. doi: 10.1038/s41593-018-0139-8. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 65.Vladimirov N, et al. Brain-wide circuit interrogation at the cellular level guided by online analysis of neuronal function. Nat. Methods. 2018;15:1117–1125. doi: 10.1038/s41592-018-0221-x. [DOI] [PubMed] [Google Scholar]
  • 66.Chen IW, et al. In vivo submillisecond two-photon optogenetics with temporally focused patterned light. J. Neurosci. 2019;39:3484–3497. doi: 10.1523/JNEUROSCI.1785-18.2018. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 67.Russell LE, et al. All-optical interrogation of neural circuits in behaving mice. Nat. Protoc. 2022;17:1579–1620. doi: 10.1038/s41596-022-00691-w. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 68.Chen TW, et al. Ultrasensitive fluorescent proteins for imaging neuronal activity. Nature. 2013;499:295–300. doi: 10.1038/nature12354. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 69.Madisen L, et al. Transgenic mice for intersectional targeting of neural sensors and effectors with high specificity and performance. Neuron. 2015;85:942–958. doi: 10.1016/j.neuron.2015.02.022. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 70.Wekselblatt JB, Flister ED, Piscopo DM, Niell CM. Large-scale imaging of cortical dynamics during sensory perception and behavior. J. Neurophysiol. 2016;115:2852–2866. doi: 10.1152/jn.01056.2015. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 71.Yizhar O, et al. Neocortical excitation/inhibition balance in information processing and social dysfunction. Nature. 2011;477:171–178. doi: 10.1038/nature10360. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 72.Chettih SN, Harvey CD. Single-neuron perturbations reveal feature-specific competition in V1. Nature. 2019;567:334–340. doi: 10.1038/s41586-019-0997-6. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 73.Reimer J, et al. Pupil fluctuations track rapid changes in adrenergic and cholinergic activity in cortex. Nat. Commun. 2016;7:13289. doi: 10.1038/ncomms13289. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 74.Reimer J, et al. Pupil fluctuations track fast switching of cortical states during quiet wakefulness. Neuron. 2014;84:355–362. doi: 10.1016/j.neuron.2014.09.033. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 75.Beaman CB, Eagleman SL, Dragoi V. Sensory coding accuracy and perceptual performance are improved during the desynchronized cortical state. Nat. Commun. 2017;8:1308. doi: 10.1038/s41467-017-01030-4. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 76.Speed A, Del Rosario J, Burgess CP, Haider B. Cortical state fluctuations across layers of V1 during visual spatial perception. Cell Rep. 2019;26:2868–2874 e2863. doi: 10.1016/j.celrep.2019.02.045. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 77.Jacobs EAK, Steinmetz NA, Peters AJ, Carandini M, Harris KD. Cortical state fluctuations during sensory decision making. Curr. Biol. 2020;30:4944–4955 e4947. doi: 10.1016/j.cub.2020.09.067. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 78.Pinto L, et al. Fast modulation of visual perception by basal forebrain cholinergic neurons. Nat. Neurosci. 2013;16:1857–1863. doi: 10.1038/nn.3552. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 79.Lee CCY, Kheradpezhouh E, Diamond ME, Arabzadeh E. State-dependent changes in perception and coding in the mouse somatosensory cortex. Cell Rep. 2020;32:108197. doi: 10.1016/j.celrep.2020.108197. [DOI] [PubMed] [Google Scholar]
  • 80.Carandini M, Churchland AK. Probing perceptual decisions in rodents. Nat. Neurosci. 2013;16:824–831. doi: 10.1038/nn.3410. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 81.Bennett C, Arroyo S, Hestrin S. Subthreshold mechanisms underlying state-dependent modulation of visual responses. Neuron. 2013;80:350–357. doi: 10.1016/j.neuron.2013.08.007. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 82.Packer AM, Yuste R. Dense, unspecific connectivity of neocortical parvalbumin-positive interneurons: a canonical microcircuit for inhibition? J. Neurosci. 2011;31:13260–13271. doi: 10.1523/JNEUROSCI.3131-11.2011. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 83.Jouhanneau JS, Kremkow J, Poulet JFA. Single synaptic inputs drive high-precision action potentials in parvalbumin expressing GABA-ergic cortical neurons in vivo. Nat. Commun. 2018;9:1540. doi: 10.1038/s41467-018-03995-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 84.Hofer SB, et al. Differential connectivity and response dynamics of excitatory and inhibitory neurons in visual cortex. Nat. Neurosci. 2011;14:1045–1052. doi: 10.1038/nn.2876. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 85.Kapfer C, Glickfeld LL, Atallah BV, Scanziani M. Supralinear increase of recurrent inhibition during sparse activity in the somatosensory cortex. Nat. Neurosci. 2007;10:743–753. doi: 10.1038/nn1909. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 86.Fino E, Yuste R. Dense inhibitory connectivity in neocortex. Neuron. 2011;69:1188–1203. doi: 10.1016/j.neuron.2011.02.025. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 87.Silberberg G, Markram H. Disynaptic inhibition between neocortical pyramidal cells mediated by Martinotti cells. Neuron. 2007;53:735–746. doi: 10.1016/j.neuron.2007.02.012. [DOI] [PubMed] [Google Scholar]
  • 88.Yoshimura Y, Dantzker JL, Callaway EM. Excitatory cortical neurons form fine-scale functional networks. Nature. 2005;433:868–873. doi: 10.1038/nature03252. [DOI] [PubMed] [Google Scholar]
  • 89.Haider B, Häusser M, Carandini M. Inhibition dominates sensory responses in the awake cortex. Nature. 2013;493:97–100. doi: 10.1038/nature11665. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 90.Ko H, et al. Functional specificity of local synaptic connections in neocortical networks. Nature. 2011;473:87–91. doi: 10.1038/nature09880. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 91.Lee WC, et al. Anatomy and function of an excitatory network in the visual cortex. Nature. 2016;532:370–374. doi: 10.1038/nature17192. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 92.Harris KD, Mrsic-Flogel TD. Cortical connectivity and sensory coding. Nature. 2013;503:51–58. doi: 10.1038/nature12654. [DOI] [PubMed] [Google Scholar]
  • 93.Carrasco M. Visual attention: the past 25 years. Vis. Res. 2011;51:1484–1525. doi: 10.1016/j.visres.2011.04.012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 94.Ito S, Feldheim DA. The mouse superior colliculus: an emerging model for studying circuit formation and function. Front. Neural Circ. 2018;12:10. doi: 10.3389/fncir.2018.00010. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 95.Oliveira AF, Yonehara K. The mouse superior colliculus as a model system for investigating cell type-based mechanisms of visual motor transformation. Front. Neural Circ. 2018;12:59. doi: 10.3389/fncir.2018.00059. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 96.Sprague JM. Interaction of cortex and superior colliculus in mediation of visually guided behavior in the cat. Science. 1966;153:1544–1547. doi: 10.1126/science.153.3743.1544. [DOI] [PubMed] [Google Scholar]
  • 97.Froudarakis E, et al. The visual cortex in context. Annu Rev. Vis. Sci. 2019;5:317–339. doi: 10.1146/annurev-vision-091517-034407. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 98.Zhao X, Liu M, Cang J. Visual cortex modulates the magnitude but not the selectivity of looming-evoked responses in the superior colliculus of awake mice. Neuron. 2014;84:202–213. doi: 10.1016/j.neuron.2014.08.037. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 99.Liang F, et al. Sensory cortical control of a visually induced arrest behavior via corticotectal projections. Neuron. 2015;86:755–767. doi: 10.1016/j.neuron.2015.03.048. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 100.Zingg B, et al. AAV-mediated anterograde transsynaptic tagging: mapping corticocollicular input-defined neural pathways for defense behaviors. Neuron. 2017;93:33–47. doi: 10.1016/j.neuron.2016.11.045. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 101.Ruediger, S. & Scanziani, M. Learning speed and detection sensitivity controlled by distinct cortico-fugal neurons in visual cortex. Elife9, 10.7554/eLife.59247. (2020). [DOI] [PMC free article] [PubMed]
  • 102.Sridharan D, Steinmetz NA, Moore T, Knudsen EI. Does the superior colliculus control perceptual sensitivity or choice bias during attention? Evidence from a multialternative decision framework. J. Neurosci. 2017;37:480–511. doi: 10.1523/JNEUROSCI.4505-14.2017. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 103.Wang L, McAlonan K, Goldstein S, Gerfen CR, Krauzlis RJ. A causal role for mouse superior colliculus in visual perceptual decision-making. J. Neurosci. 2020;40:3768–3782. doi: 10.1523/JNEUROSCI.2642-19.2020. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 104.Bennett C, et al. Higher-order thalamic circuits channel parallel streams of visual information in mice. Neuron. 2019;102:477–492 e475. doi: 10.1016/j.neuron.2019.02.010. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 105.Akam T, Kullmann DM. Oscillatory multiplexing of population codes for selective communication in the mammalian brain. Nat. Rev. Neurosci. 2014;15:111–122. doi: 10.1038/nrn3668. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 106.Stitt I, Zhou ZC, Radtke-Schuller S, Frohlich F. Arousal dependent modulation of thalamo-cortical functional interaction. Nat. Commun. 2018;9:2455. doi: 10.1038/s41467-018-04785-6. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 107.McAdams CJ, Reid RC. Attention modulates the responses of simple cells in monkey primary visual cortex. J. Neurosci. 2005;25:11023–11033. doi: 10.1523/JNEUROSCI.2904-05.2005. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 108.Moran J, Desimone R. Selective attention gates visual processing in the extrastriate cortex. Science. 1985;229:782–784. doi: 10.1126/science.4023713. [DOI] [PubMed] [Google Scholar]
  • 109.McAdams CJ, Maunsell JH. Effects of attention on orientation-tuning functions of single neurons in macaque cortical area V4. J. Neurosci. 1999;19:431–441. doi: 10.1523/JNEUROSCI.19-01-00431.1999. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 110.van Vugt B, et al. The threshold for conscious report: Signal loss and response bias in visual and frontal cortex. Science. 2018;360:537–542. doi: 10.1126/science.aar7186. [DOI] [PubMed] [Google Scholar]
  • 111.Znamenskiy, P. et al. Functional selectivity and specific connectivity of inhibitory neurons in primary visual cortex. bioRxiv, 294835, 10.1101/294835. (2018).
  • 112.Cai, B. et al. Modeling robust and efficient coding in the mouse primary visual cortex using computational perturbations. bioRxiv, 10.1101/2020.04.21.051268. (2020).
  • 113.Tsodyks MV, Skaggs WE, Sejnowski TJ, McNaughton BL. Paradoxical effects of external modulation of inhibitory interneurons. J. Neurosci. 1997;17:4382–4388. doi: 10.1523/JNEUROSCI.17-11-04382.1997. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 114.Olshausen BA, Field DJ. Sparse coding of sensory inputs. Curr. Opin. Neurobiol. 2004;14:481–487. doi: 10.1016/j.conb.2004.07.007. [DOI] [PubMed] [Google Scholar]
  • 115.Ozeki H, Finn IM, Schaffer ES, Miller KD, Ferster D. Inhibitory stabilization of the cortical network underlies visual surround suppression. Neuron. 2009;62:578–592. doi: 10.1016/j.neuron.2009.03.028. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 116.Ahmadian Y, Rubin DB, Miller KD. Analysis of the stabilized supralinear network. Neural Comput. 2013;25:1994–2037. doi: 10.1162/NECO_a_00472. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 117.Rubin DB, Van Hooser SD, Miller KD. The stabilized supralinear network: a unifying circuit motif underlying multi-input integration in sensory cortex. Neuron. 2015;85:402–417. doi: 10.1016/j.neuron.2014.12.026. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 118.Sadeh S, Clopath C. Inhibitory stabilization and cortical computation. Nat. Rev. Neurosci. 2021;22:21–37. doi: 10.1038/s41583-020-00390-z. [DOI] [PubMed] [Google Scholar]
  • 119.Knudsen EI. Neural circuits that mediate selective attention: a comparative perspective. Trends Neurosci. 2018;41:789–805. doi: 10.1016/j.tins.2018.06.006. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 120.Quintana, D. et al. Dissociating instructive from permissive roles of brain circuits with reversible neural activity manipulations. bioRxiv, 10.1101/2023.05.11.540397. (2023).
  • 121.Steinmetz NA, Zatka-Haas P, Carandini M, Harris KD. Distributed coding of choice, action and engagement across the mouse brain. Nature. 2019;576:266–273. doi: 10.1038/s41586-019-1787-x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 122.Allen WE, et al. Thirst regulates motivated behavior through modulation of brainwide neural population dynamics. Science. 2019;364:253. doi: 10.1126/science.aav3932. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 123.Urai AE, Doiron B, Leifer AM, Churchland AK. Large-scale neural recordings call for new insights to link brain and behavior. Nat. Neurosci. 2022;25:11–19. doi: 10.1038/s41593-021-00980-9. [DOI] [PubMed] [Google Scholar]
  • 124.Steinmetz, N. A. et al. Aberrant cortical activity in multiple GCaMP6-expressing transgenic mouse lines. eNeuro4, 10.1523/ENEURO.0207-17.2017 (2017). [DOI] [PMC free article] [PubMed]
  • 125.Peirce JW. Generating stimuli for neuroscience using PsychoPy. Front. Neuroinform. 2008;2:10. doi: 10.3389/neuro.11.010.2008. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 126.Marshel JH, Garrett ME, Nauhaus I, Callaway EM. Functional specialization of seven mouse visual cortical areas. Neuron. 2011;72:1040–1054. doi: 10.1016/j.neuron.2011.12.004. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 127.Galinanes GL, et al. Optical alignment device for two-photon microscopy. Biomed. Opt. Express. 2018;9:3624–3639,. doi: 10.1364/BOE.9.003624. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 128.Roome CJ, Kuhn B. Chronic cranial window with access port for repeated cellular manipulations, drug application, and electrophysiology. Front. Cell Neurosci. 2014;8:379. doi: 10.3389/fncel.2014.00379. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 129.Chadderton P, Margrie TW, Häusser M. Integration of quanta in cerebellar granule cells during sensory processing. Nature. 2004;428:856–860. doi: 10.1038/nature02442. [DOI] [PubMed] [Google Scholar]
  • 130.Mateo C, et al. In vivo optogenetic stimulation of neocortical excitatory neurons drives brain-state-dependent inhibition. Curr. Biol. 2011;21:1593–1602. doi: 10.1016/j.cub.2011.08.028. [DOI] [PubMed] [Google Scholar]
  • 131.Stringer C, Wang T, Michaelos M, Pachitariu M. Cellpose: a generalist algorithm for cellular segmentation. Nat. Methods. 2021;18:100–106. doi: 10.1038/s41592-020-01018-x. [DOI] [PubMed] [Google Scholar]
  • 132.Watson, B. O., Yuste, R. & Packer, A. M. PackIO and EphysViewer: software tools for acquisition and analysis of neuroscience data. bioRxiv, 054080, 10.1101/054080. (2016).
  • 133.Pachitariu, M. et al. Suite2p: beyond 10,000 neurons with standard two-photon microscopy. bioRxiv, 061507, 10.1101/061507. (2017).
  • 134.Mathis A, et al. DeepLabCut: markerless pose estimation of user-defined body parts with deep learning. Nat. Neurosci. 2018;21:1281–1289. doi: 10.1038/s41593-018-0209-y. [DOI] [PubMed] [Google Scholar]
  • 135.Friedrich J, Zhou P, Paninski L. Fast online deconvolution of calcium imaging data. PLoS Comput. Biol. 2017;13:e1005423. doi: 10.1371/journal.pcbi.1005423. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 136.Schütt HH, Harmeling S, Macke JH, Wichmann FA. Painfree and accurate Bayesian estimation of psychometric functions for (potentially) overdispersed data. Vis. Res. 2016;122:105–123. doi: 10.1016/j.visres.2016.02.002. [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Peer Review File (3.3MB, pdf)
Reporting Summary (2.4MB, pdf)
Source Data (543.1KB, xlsx)

Data Availability Statement

Datasets supporting the findings of this study are available from the corresponding author upon request. Source data are provided with this paper.

Custom code used for data acquisition, photostimulation control, behavioral training and analysis have been deposited online: Naparm https://github.com/llerussell/Naparm, 10.5281/zenodo.10449686, PyBehaviour https://github.com/llerussell/PyBehaviour, 10.5281/zenodo.10449684, 3D SLM calibration https://github.com/llerussell/SLMTransformMaker3D, 10.5281/zenodo.10449682, STAMovieMaker https://github.com/llerussell/STAMovieMaker, 10.5281/zenodo.10449680, RawDataStream https://github.com/llerussell/Bruker_PrairieLink, 10.5281/zenodo.10449690, Objective rotation https://github.com/llerussell/MONPangle, 10.5281/zenodo.10449688.


Articles from Nature Communications are provided here courtesy of Nature Publishing Group

RESOURCES