Introduction

Optical imaging of neuronal activity and neuromodulator concentration often involves recording the changes in fluorescence intensity of calcium or neuromodulator sensors expressed in neurons. In vivo, the hemodynamic changes in tissue around at the imaging location can modulate light transmission. Changes in blood volume through vasodilation and vasoconstriction as well as hemoglobin oxygenation change the transmission properties of the tissue. This is referred to as hemodynamic occlusion. Often, these hemodynamic changes are driven by local neuronal activity, a phenomenon known as neurovascular coupling (Attwell et al., 2010; Iadecola and Nedergaard, 2007). Hemodynamic changes are known to contribute significantly to activity measurements in techniques like fiber photometry (Zhang et al., 2022) and widefield microscopy (Ma et al., 2016; Waters, 2020). For these techniques, several methods have been proposed to control for the hemodynamic contribution to these activity measurements (Lohani et al., 2022; Valley et al., 2020; Zhang et al., 2022). However, the potential contribution of hemodynamic signals to activity measurements acquired using two-photon imaging remains largely unexplored.

Here, we characterized hemodynamic signals in two-photon imaging of mouse cortex. We expressed an activity independent marker (GFP) in mouse cortical neurons and measured fluorescence changes using two-photon imaging while mice were interacting with a virtual environment. We found changes in GFP fluorescence in response to locomotion and visual stimuli of a magnitude comparable to that measured with common activity sensors like GCaMP and GRAB variants. GFP signals were apparent both in population average responses and at individual neuron level. Moreover, these signals were heterogeneous over dorsal cortex and cortical layers. We compared the size of GFP signals to the calcium responses reported by GCaMP6 sensors, and to the neuromodulator signals reported by the GRAB sensors for dopamine (GRAB-DA1m), serotonin (GRAB-5HT1.0), acetylcholine (GRAB-ACh3.0), and norepinephrine (GRAB-NE1m). We found that a large fraction of the GRAB response to the different neuromodulators was explained by the GFP signal, consistent with an earlier study characterizing this relationship for GRAB-5HT1.0 and GRAB-5HT3.0 (Ocana-Santero et al., 2024). Based on our findings, we speculate that the primary driver of the hemodynamic signals in two-photon imaging is hemodynamic occlusion. If so, then this problem is likely primarily mitigated by using high dynamic range sensors with low baseline fluorescence, and best controlled for using activity independent fluorescence measurements.

Results

To quantify hemodynamic occlusion in two-photon microscopy we imaged GFP in mouse cortex during behavior. We used an AAV vector (AAV2/1-Ef1α-eGFP-WPRE) injected in primary visual cortex (V1) and anterior cingulate cortex (ACC) to express GFP in cortical neurons. Given that the Ef1α promoter biases expression to excitatory neurons, we estimate that most (95%) of the GFP-expressing neurons were excitatory (Attinger et al., 2017). We then used a two-photon microscope to record GFP signals while mice explored a virtual tunnel. Mice were head-fixed on a spherical treadmill surrounded by a toroidal screen and exposed to a set of visuomotor conditions known to activate neurons in V1 and ACC (Attinger et al., 2017; Keller et al., 2012; Leinweber et al., 2017; Zmarz and Keller, 2016). First, mice were exposed to a closed loop condition during which running speed was coupled to visual flow speed in a virtual tunnel. Mice were also exposed to an open loop condition, during which locomotion and visual flow in the virtual tunnel were not coupled, to darkness, and to the presentation of full-field drifting gratings. Throughout all experimental conditions, mice were free to locomote on the spherical treadmill and did so voluntarily. Unless stated otherwise, we will use ‘response’ to refer to the observed change in GFP fluorescence.

Locomotion onset and visual stimuli resulted in strong changes in GFP population responses

At the onset of locomotion, we found a transient increase in apparent GFP fluorescence in the population response of layer 2/3 (L2/3) neurons in V1 (Figure 1A). This increase in fluorescence of approximately 1% ΔF/F0 was only marginally smaller than the fluorescence changes typically observed at locomotion onset with genetically encoded calcium indicators (approximately 2% ΔF/F0 for GCaMP6f (Widmer et al., 2022; Yogesh and Keller, 2023), approximately 1.5% ΔF/F0 for GCaMP3 (Keller et al., 2012), etc.). By contrast, presentation of full-field drifting gratings resulted in a decrease of the GFP population signal (Figure 1B). We observed a similar decrease in GFP population signal on the presentation of an optogenetic stimulation light (637 nm, 10mW after the objective) directed at V1 with either the virtual reality turned on or in the dark (Figure 1C). This response was likely visually driven as the decrease was twice as strong in dark than when the virtual reality was on, in line with the stimulation light being more visually salient in dark. Visuomotor mismatches (pauses in the visual flow feedback during locomotion), resulted in an average increase of apparent GFP fluorescence (Figure 1D). By design, visuomotor mismatch only occurs during times of locomotion. Because apparent GFP fluorescence increases during locomotion, we estimated the increase expected by chance using random triggers during locomotion to compute the 95% confidence interval in Figures 1D, 1H, and 1L. GFP responses to mismatch were only briefly outside these 95% confidence intervals.

GFP responses in two-photon imaging of neurons in V1 and ACC.

(A) Average change in apparent GFP fluorescence in L2/3 neurons in V1 on locomotion onset. Mean (solid lines) and the bootstrap standard error (shading) are calculated as hierarchical bootstrap estimate for each time bin.

(B) As in A, but for grating onsets in L2/3 neurons in V1. Green shading marks the duration of the gratings.

(C) As in A, but for responses to optogenetic stimulation light in L2/3 neurons in V1, with VR on (light red) or in dark (dark red). Pink shading marks the duration of the light stimulus.

(D) As in A, but for visuomotor mismatch in L2/3 neurons in V1. Orange shading marks the duration of visuomotor mismatch. As mismatch events are defined to occur during times of locomotion, and locomotion itself drives GFP responses, we would expect to find an increase in these signals by chance at mismatch. To correct for this, we quantified the distribution of signal amplitude on random triggers during locomotion (95% confidence interval, gray shading).

(E) As in A, but for L5 neurons in V1.

(F) As in B, but for L5 neurons in V1.

(G) As in C, but for L5 neurons in V1.

(H) As in D, but for L5 neurons in V1.

(I) As in A, but for L2/3 neurons in ACC.

(J) As in B, but for L2/3 neurons in ACC.

(K) As in C, but for L2/3 neurons in ACC.

(L) As in D, but for L2/3 neurons in ACC.

To test whether stimulus triggered GFP responses depend on imaging depth and cortical area, we repeated these experiments in layer 5 (L5) of V1 and in L2/3 of ACC. In L5, we found that apparent fluorescence changes at locomotion onset were smaller than those observed in L2/3 (Figure 1E). As in L2/3, full-field drifting grating stimuli (Figure 1F) and optogenetic stimulation light (Figure 1G) both resulted in a significant decrease in apparent GFP fluorescence, while visuomotor mismatch responses were only barely above chance (Figure 1H). In L2/3 of ACC, locomotion onset resulted in a strong increase of apparent GFP fluorescence (Figure 1I), while we found only small grating responses (Figure 1J) and a positive response to optogenetic stimulation light (Figure 1K). We again found no evidence of visuomotor mismatch responses (Figure 1L). Thus, apparent GFP fluorescence changes can vary both as a function of recording depth and cortical area.

The observation that average population responses of GFP and calcium indicators are similar does not mean that the dynamic range of individual neurons is similar. When comparing the distribution of peak ΔF/F0 responses, it is evident that peak responses are much larger for calcium indicators (Figures 2A and 2B). This is still the case when comparing trial averaged responses (Figures 2C-2E), but the difference between GFP and calcium indicator response distributions is smaller, in particular for locomotion onsets (Figure 2C). The main driver for this effect is likely the highly variable stimulus triggered calcium responses of many neurons.

Peak responses of GCaMP6f were larger than those observed with GFP.

(A) Example GFP response traces (black) of three neurons with corresponding running speed traces (red).

(B) Peak responses of GCaMP6f (blue) were typically an order of magnitude larger than those observed with GFP (orange). Inset is a zoomed-in version of the same data.

(C) Histogram of trial averaged responses on locomotion onset measured with two-photon imaging of calcium indicator (blue) and GFP (orange). Dotted lines indicate the mean response of the distribution of locomotion onset response in calcium indicator (blue) and GFP (orange).

(D) As in C, but for grating onset.

(E) As in C, but for visuomotor mismatch.

Individual neurons showed significant GFP responses to different stimuli

Next, we tested whether GFP signals are strong enough to result in significant responses when looking at individual neurons. Raw GFP traces exhibited fluctuations reminiscent of calcium responses but tended to be of lower peak amplitude (Figure 2A). It is possible that small, correlated changes in GFP signal, when averaged over the population, result in a significant response indistinguishable from calcium signals reported with GCaMP but are negligible at the level of individual neurons. Thus, we quantified the fraction of neurons that are significantly responsive to different stimuli. Commensurate with the population averages (Figure 1), we found a surprisingly large fraction of neurons in V1, in both L2/3 (Figure 3A) and L5 (Figure 3B) responsive to locomotion onset and grating stimuli. In both locations, the fraction of neurons responsive to visuomotor mismatch was not different from chance. In ACC L2/3 (Figure 3C), a significant fraction of GFP labelled neurons was responsive to locomotion onset, while the fraction of neurons responsive to gratings and visuomotor mismatch was not different from chance. Thus, even at the single neuron level, hemodynamic influence on GFP remains measurable.

Fraction of neurons with significant GFP responses to different stimuli.

(A) The fraction of GFP expressing V1 L2/3 neurons responsive to locomotion, full-field grating, and visuomotor mismatch onset, quantified for all imaging sites. Each dot is an imaging site, jittered along the x-axis to make them visible. Whiskers mark the SEM. Dashed line indicates chance levels (p = 0.05). n.s.: not significant; *: p < 0.05; **: p < 0.01; ***: p < 0.001; see Table S1 for all statistical information.

(B) As in A, but for V1 L5 neurons.

(C) As in A, but for ACC L2/3 neurons.

Changes in GFP fluorescence correlated with blood vessel dilation

We speculated that the dominant change in GFP fluorescence is driven by hemodynamic occlusion. As blood vessels dilate and constrict, they influence the transmission of both excitation and emission light. One testable prediction of this hypothesis is that the cross section of blood vessels visible in a given field of view should correlate inversely with the apparent GFP fluorescence of surrounding cells. This makes the simplifying assumption that the cross section of surface blood vessels, which likely have the strongest contribution to occlusion, correlates with that of blood vessels in the imaging plane. To quantify the correlation between blood vessel cross section and apparent GFP fluorescence, we first estimated the cross section of selected blood vessels in the imaging plane (Figures 4A and 4B). Blood vessels in V1 dilated systematically, for example upon light stimulation (Figures 4A1 and 4B1). The estimation of blood vessel cross section worked well for high contrast boundaries but failed in many instances of low contrast boundaries due to noise in the boundary estimates in single imaging frames. A proxy for blood vessel cross section that does not rely on thresholding is the average fluorescence of a region of interest of fixed size and fully contained within the blood vessel (Figures 4A2 and 4B2). Comparing both metrics to the average apparent GFP fluorescence changes of the surrounding cells (Figures 4A3 and 4B3), we found that both blood vessel area and fluorescence explain approximately 80% of the variance of apparent GFP fluorescence changes (Figures 4A4 and 4B4) in these example data. Quantifying this for all data, we found that the fraction of variance explained was 50% or higher for most event triggered averages (Figure 4C) as well as across the entire recording duration (Figures 4D and S2). The variance explained tended to be lower in ACC than in V1; we suspect that this is caused by the superior sagittal sinus contributing more strongly to hemodynamic occlusion in ACC, and that the diameters of local blood vessels are less well correlated with that of this large blood vessel.

Correlation between blood vessel diameter and GFP responses.

(A) Example average fluorescence image from an imaging site in L2/3 of V1 under a two-photon microscope. The fluorescence signal is averaged over 22 trials of optogenetic stimulation light directed at V1 while the mouse was in the dark. Shown on the right is an example blood vessel before (upper panel) and after (lower panel) stimulation.

(A1) Average area of the example blood vessel shown in A (in blue box) on light stimulation. The area of the indicated blood vessel is extracted from the trial averaged two-photon image. Shading in pink indicates the optogenetic light presentation.

(A2) Average change in GFP signal from a ROI positioned within the blood vessel (shown in A in red). Mean (red) and SEM (shading) were calculated over light stimulation trials.

(A3) Average change in GFP signal from all neurons (268 neurons) simultaneously imaged in the same site. Mean (red) and SEM (shading) were calculated over light stimulation trials.

(A4) Variance in average GFP signal in this example L2/3 site in V1 explained by area of the example blood vessel and by the change in GFP signal from a ROI within the blood vessel.

(B) As in A, from an imaging site in L5 of V1.

(C) Percentage of variance in neuronal GFP signal to individual events explained by the change in GFP signal from blood vessel ROIs. Boxes show 25th and 75th percentile, central mark is the median, and the whiskers extend to the most extreme datapoints not considered outliers.

(D) Percentage of variance in neuronal GFP signal over the entire recording explained by blood vessel GFP signal per imaging location. Each datapoint is one imaging site. Boxes show 25th and 75th percentile, central mark is the median, and the whiskers extend to the most extreme datapoints not considered outliers.

GFP responses were visuomotor context sensitive and could not be explained by a linear combination of responses to constituent stimuli

Next, we investigated how stereotypical GFP responses are across different visuomotor conditions and cortical regions, and whether GFP responses can be explained by a linear combination of a locomotion driven component and a visually driven component. We found that in V1 L2/3, locomotion onset responses were similar in closed loop and open loop, but different in the dark (Figure 5A). During a closed loop locomotion onset, there is concurrent onset of visual flow with the locomotion onset. During open loop and dark locomotion onsets there is no concurrent onset of visual flow, and they only differ in the average visual input. The similarity between open and closed loop running onsets could be explained by a dominant locomotion related signal and a negligible visual onset response. If so, the smaller GFP responses in dark locomotion would need to be the consequence of the lower average visual input. This demonstrates that GFP responses, similar to neuronal calcium responses, can be non-linear combinations of component responses. This is perhaps not surprising, assuming local blood flow is primarily related to local neuronal activity. In L5 of V1, locomotion onset responses in open loop and dark conditions were comparable, while those in closed loop conditions had a delayed transient dip (Figure 5B). Thus, hemodynamic responses can exhibit a strong depth dependence. In ACC L2/3 neurons all three types of locomotion onsets resulted in increases of apparent fluorescence (Figure 5C). Thus, hemodynamic responses are difficult to predict from component signals (Figure S1), and do not generalize across depth or cortical areas. Finally, while there appears to be some correspondence to local neuronal activity in that locomotion onsets are more strongly modulated by visual context in V1 than in ACC, it is not immediately obvious how the GFP signals relate to responses measured with calcium indicators.

GFP responses at locomotion onset depended on visuomotor condition and cortical region.

(A) Average GFP response in L2/3 neurons in V1 on locomotion onset in closed loop (in red), in open loop (in blue), and in darkness (in grey). Here and in subsequent panels, bins with a significant difference (p < 0.01) are indicated by a black line above the plot (lines compared are marked on the left by pairs of colored horizontal bars); those with p > 0.01 are marked gray. Mean (solid lines) and the bootstrap standard error (shading) are calculated as hierarchical bootstrap estimate for each time bin.

(B) As in A, but for L5 neurons in V1.

(C) As in A, but for L2/3 neurons in ACC.

Locomotion increased correlation in GFP signals

Another metric frequently used in the analysis of two-photon data are correlation-based analyses. Locomotion, for example, has been shown to decorrelate the activity of excitatory neurons in cortex (Aydın et al., 2018; Dadarlat and Stryker, 2017; Erisken et al., 2014; Yogesh and Keller, 2023). Given the sizable fraction of neurons significantly responsive to locomotion, we speculated that correlations between neurons likely are influenced by hemodynamic responses. We tested this by quantifying the effect of locomotion on the pairwise correlations of GFP signals between individual neurons. We found that pairwise correlations were systematically increased during locomotion (Figure 6). This was true for neurons in V1 L2/3 (Figure 6A), V1 L5 (Figure 6B), and ACC L2/3 (Figure 6C). Thus, hemodynamic responses can have a strong influence on pairwise correlations, and in the case of locomotion, this effect is opposite to that observed with calcium indicators (Aydın et al., 2018; Dadarlat and Stryker, 2017; Erisken et al., 2014; Yogesh and Keller, 2023). This is consistent with the interpretation that hemodynamic changes on locomotion occur at a larger spatial scale than changes in neuronal activity patterns and thus tend to increase correlations between neurons.

Locomotion increased pairwise correlation of GFP signals between neurons.

(A) Average pairwise correlation in GFP signal of V1 L2/3 neurons while mice were stationary and while they were locomoting. Each dot is the mean pairwise correlation of one neuron to all other neurons in the same imaging site. Colors indicate data from different mice.

(B) As in A, but for V1 L5 neurons.

(C) As in A, but for ACC L2/3 neurons.

GFP responses in widefield imaging were similar in magnitude to those in two-photon imaging

In widefield calcium imaging, hemodynamic responses are better characterized and widely recognized as a confounding problem (Allen et al., 2017; Ma et al., 2016; Valley et al., 2020). To directly contrast hemodynamic widefield signals with those observed in two-photon imaging, we repeated our experiments by performing widefield imaging of GFP responses. We expressed GFP pan-neuronally across dorsal cortex using either a retro-orbital injection of AAV-PHP.eB-EF1α-eGFP, or transgenic mice that express GFP under a c-fos promoter (Table S2). As with two-photon imaging (Figure 1), and consistent with previous work (Allen et al., 2017; Valley et al., 2020), we found strong GFP responses across dorsal cortex (Figure 7). Locomotion and grating onsets resulted in GFP responses in both V1 (Figures 7A and 7B) and ACC (Figures 7D and 7E). During visuomotor mismatch, we found no significant response in either of these regions (Figures 7C and 7F). All these responses were greatly attenuated or absent when we imaged the cortex without expressing a fluorescent indicator (Figure S3), arguing in favor of hemodynamic occlusion of fluorescence from the genetically expressed indicators as the underlying cause for most of these responses in the GFP signal.

Signals in widefield fluorescence imaging of V1 and ACC in mice expressing GFP.

(A) Average change in signal from V1 on locomotion onset. Mean (solid lines) and the bootstrap standard error (shading) are calculated as hierarchical bootstrap estimate for each time bin.

(B) As in A, but for grating onset in V1. Grating duration were randomly selected between 4 s and 8 s (green shading).

(C) As in A, but on visuomotor mismatch in V1. Orange shading marks the duration of visuomotor mismatch. Gray shading marks the 95% confidence interval.

(D) As in A, but for change in signal from ACC on locomotion onset.

(E) As in B, but for change in signal from ACC on grating onset.

(F) As in C, but for change in signal from ACC on visuomotor mismatch.

GRAB sensors in cortex displayed similar responses to those recorded in GFP imaging

Finally, we compared the magnitude of hemodynamic responses to those recorded with the relatively low dynamic range GRAB sensors using both two-photon and widefield imaging. For this we used the GRAB-DA1m dopamine sensor (Sun et al., 2018), the GRAB-5HT1.0 serotonin sensor (Wan et al., 2021), the GRAB-ACh3.0 acetylcholine sensor (Jing et al., 2019), and the GRAB-NE1m norepinephrine sensor (Feng et al., 2019). We first imaged GRAB-DA1m, GRAB-5HT1.0, and GRAB-ACh3.0 using two-photon imaging in L2/3 of V1. To estimate hemodynamic responses from GRAB sensors, we compared responses of regions of interest (ROI) selected in neuropil and those selected in blood vessels (Figures 8A, 8E and 8I). We reasoned that the signal in neuropil regions is a combination of a true GRAB signal and hemodynamic occlusion, while the signal in a ROI selected inside of a blood vessel should be dominated by the blood vessel diameter. We found that the GRAB-DA1m response to locomotion and full-field grating onsets (Figure 8B and 8C) was similar to GFP responses in V1 L2/3 (Figure 1). There were responses to locomotion and grating onset in the GRAB-DA1m signal (Figure 8B and 8C). In both cases neuropil and blood vessel ROI responses were similar. Also, similar to the GFP responses, we found no evidence of a response to visuomotor mismatch in the GRAB-DA1m signal (Figure 8D). We observed similar responses when imaging GRAB-5HT1.0 in V1 (Figures 8F-8H). However, these responses were smaller in amplitude, likely driven by the overall dimmer fluorescence of the GRAB-5HT1.0 sensor. Thus, it is likely that both GRAB-DA1m and GRAB-5HT1.0 responses recorded with two-photon imaging are dominated by hemodynamic occlusion.

GRAB signals in V1 with two-photon imaging.

(A) Example two-photon image taken in V1 of mouse expressing GRAB-DA1m, with neuropil ROIs (in violet) and blood vessel ROIs (in red).

(B) Average change in GRAB-DA1m signal in V1 on locomotion onset in ROIs over neuropil (in black) and in ROIs in blood vessels (in red). Mean (solid lines) and the bootstrap standard error (shading) are calculated as hierarchical bootstrap estimate for each time bin.

(C) As in B, but for response to grating onset. Green shading marks the duration of the gratings.

(D) As in B, but for response to visuomotor mismatch. Orange shading marks the duration of visuomotor mismatch.

(E) Example two-photon image taken in V1 of mouse expressing GRAB-5HT1.0, with neuropil ROIs (in green) and blood vessel ROIs (in red).

(F) Average change in GRAB-5HT1.0 signal in V1 on locomotion onset in ROIs over neuropils (in black) and in ROIs in blood vessels (in red).

(G) As in F, but for response to grating onset.

(H) As in F, but for response to visuomotor mismatch.

(I) Example two-photon image of mouse expressing GRAB-ACh3.0 in V1, with neuropil ROIs (in green) and blood vessel ROIs (in red).

(J) Average change in GRAB-ACh3.0 fluorescence in V1 in response to locomotion onset in ROIs over neuropil (in black) and in ROIs over blood vessels (in red).

(K) As in J, but for response to grating onset.

(L) As in J, but for response to visuomotor mismatch.

A response that was distinct from GFP, GRAB-DA1m, and GRAB-5HT1.0 signals was the response in GRAB-ACh3.0 on locomotion onset (Figure 8J). Here we found a prominent increase in GRAB-ACh3.0 signal that was three-fold higher than either the GFP signal or the GRAB-ACh3.0 signals measured in blood vessel ROIs. This makes it more likely that the observed fluorescence changes are driven by a mixture of hemodynamic occlusion and GRAB-ACh3.0 responses. The GRAB-ACh3.0 response to grating onset (Figure 8K), however, was similar to GFP responses. And again, we found no response to visuomotor mismatch in GRAB-ACh3.0 (Figure 8L). To test whether the absence of response differences between GRAB-DA1m, GRAB-5HT1.0 and GFP signals was simply a result of imaging in V1, where both dopamine and serotonin release is weaker than in frontal areas of cortex (Berger et al., 1991; Hamada et al., 2023), we repeated these experiments in ACC. Also here, we found no evidence of GRAB responses that could not be explained by hemodynamic occlusion (Figure S4). A strong influence of hemodynamic signals was also apparent in widefield imaging of GRAB-NE1m. We found that the widefield GRAB-NE1m responses (Figure 9) were similar to GFP responses (Figure 7). Thus, in certain cases of low dynamic range sensors, one can readily measure responses, but these are not always easily distinguished from those driven by hemodynamic occlusion.

Signals of V1 and ACC in widefield imaging in mice expressing GRAB-NE1m.

(A) Average change in signal from V1 on locomotion onset. Mean (solid lines) and the bootstrap standard error (shading) are calculated as hierarchical bootstrap estimate for each time bin. Here and below, GFP response (in gray) from Figure 7 overlaid.

(B) As in A, but for grating onset in V1. Green shading marks the duration of the gratings.

(C) As in A, but for visuomotor mismatch in V1. Orange shading marks the duration of visuomotor mismatch. Gray shading marks the 95% confidence interval.

(D) As in A, but for change in signal from ACC on locomotion onset.

(E) As in B, but for change in signal from ACC on grating onset.

(F) As in C, but for change in signal from ACC on visuomotor mismatch.

Discussion

Changes in neuronal activity in the cortex are associated with hemodynamic changes through neurovascular coupling (Ruff et al., 2024) that are layer specific (Mächler et al., 2021). Since blood absorbs light, hemodynamic occlusion can affect fluorescence intensity measurements. This complicates the interpretation of signals measured with fluorescent activity indicators as blood flow varies on similar time scales as those of neuronal activity indicators. We quantified the magnitude of hemodynamic occlusion by imaging GFP and found the responses to be comparable to those recorded with commonly used calcium and neuromodulator sensors in population averages. We further found that these signals are heterogenous across the cortex, present at single neuron level, and non-linearly related to behavioral events. All this calls for greater caution in interpreting imaging data, particularly when the signal-to-noise ratio of the sensor is not substantially higher than the hemodynamic occlusion artifact.

Hemodynamic influence on fiber photometry (Zhang et al., 2022) and widefield imaging (Ma et al., 2016; Scott et al., 2018; Valley et al., 2020) are well documented, and there are correction methods published (Allen et al., 2017; Ma et al., 2016). But hemodynamic influence on two-photon imaging is relatively unexplored. Here we show that not only is this influence substantial, but in certain cases it is nearly indistinguishable from signals acquired with calcium or neuromodulator fluorescent sensors. Both the excitation and the emission photons need to pass through intervening vascularized tissue between the objective lens and the imaging plane deep in brain. Thus, changes in blood vessel diameter will influence both stimulation and emission light. Given that the absorption of light is wavelength dependent, it is not entirely trivial to estimate hemodynamic effects concurrently with two-photon imaging. There are likely two approaches: estimate the hemodynamic contribution in a separate set of experiments using GFP, or use a second imaging channel for concurrent isosbestic illumination of the sensor. For the calcium indicator GCaMP, isosbestic imaging has been shown to work in widefield imaging (Allen et al., 2017; Couto et al., 2021). However, imaging concurrently with two-photon imaging would require a second two-photon laser, and a way to de-multiplex or spectrally filter the two emission signals that are spectrally very close.

Based on both the correlation between blood vessel diameter and hemodynamic signals as well as the overall strength of the signals, we have here assumed that the primary contribution to the effects we measured is from hemodynamic occlusion. Previous work has shown that imaging neurons singly electroporated with a structural marker (Alexa Fluor 594) in rat visual cortex show a decrease in fluorescence on the presentation of visual stimuli when the neuron is present under an arteriole, but not a venule (Shen et al., 2012). Thus, we suspect the primary contributor to hemodynamic occlusion are alterations in arteriolar diameter.

The similarity in response of many of the GRAB sensors to the GFP signal is a cause for concern and calls for careful distinction between responses driven by the sensor and those resulting from hemodynamic occlusion (Ocana-Santero et al., 2024). In the case of neuromodulator sensors, this problem is further complicated by the fact that norepinephrine and acetylcholine also directly influence the diameter of arterioles. With improvement in the signal-to-noise ratio of these sensors these problems will be reduced. However, given that even for very high dynamic range sensors like GCaMP, the population average responses of hemodynamic occlusion are comparable in magnitude to the sensor signals, it is unlikely that the problem will disappear anytime soon.

Methods

Key Resources Table

Mice

We used a total of 35 C57BL/6 mice, 4 fosGFP mice, 6 Tlx3-Cre mice, and 23 ChAT-IRES-Cre mice. Both male and female mice, 6 - 16 weeks old at the start of the experiment, were used. See Table S2 for details of mouse inclusion for different figures. Between experiments, mice were group-housed in a vivarium (light/dark cycle: 12/12 hours). All animal procedures were approved by and carried out in accordance with the guidelines laid by the Veterinary Department of the Canton of Basel-Stadt, Switzerland.

Surgery

For all surgical procedures, mice were anesthetized with a mixture of fentanyl (0.05 mg/kg; Actavis), midazolam (5.0 mg/kg; Dormicum, Roche), and medetomidine (0.5 mg/kg; Domitor, Orion) injected intraperitoneally. Analgesics were applied perioperatively (2% lidocaine gel, meloxicam 5 mg/kg) and postoperatively (buprenorphine 0.1 mg/kg, meloxicam 5 mg/kg). Eyes were covered with ophthalmic gel (Virbac Schweiz AG). Depending on the experiment, we either implanted a cranial window to perform two-photon imaging or used crystal skull (or clear skull preparation in case of GRAB-NE1m imaging) for widefield imaging. Cranial windows were implanted over V1 and ACC as previously described (Keller et al., 2012; Leinweber et al., 2014). Briefly, using a dental drill, a 4 mm craniotomy was made over the right V1, centered 2.5 mm lateral and 0.5 mm anterior to lambda. A second craniotomy was made over right ACC, centered at midline, 0.5 mm anterior to bregma. After injection of an AAV vector carrying the reporter (see Table S2 for details of virus), the exposed cortex was sealed with a 3 mm or 4 mm circular glass coverslip and glued in place using gel superglue (Ultra Gel, Pattex). The remaining exposed surface of the skull was covered with Histoacryl (B. Braun), and a titanium head bar was fixed to the skull using dental cement (Paladur, Heraeus Kulzer). For widefield experiments, we injected an AAV vector with PHP.eB capsid retro-orbitally (6 μl per eye of at least 1013 GC/ml) to drive expression throughout cortex, or imaged GFP expressed in a fosGFP mice, or imaged without any fluorophore. For crystal skull surgery, we surgically removed the skull plate overlying the dorsal cortex and superglued a crystal skull coverslip over the craniotomy. For clear skull preparation, the skull was cleared with a three-component polymer (C&B Metabond, Parkell), and the crystal skull coverslip was directly attached to the skull. An epifluorescence image was taken to mark reference points on cortical surface. As with 4mm cranial window implantation, a titanium head bar was fixed to the skull using dental cement. After surgery, anesthesia was antagonized by a mixture of flumazenil (0.5 mg/kg; Anexate, Roche) and atipamezole (2.5 mg/kg; Antisedan, Orion Pharma) injected intraperitoneally. Imaging commenced earliest 2 weeks after head bar implantation or 3 weeks after retro-orbital AAV injection.

Virtual reality environment

The virtual reality setup is based on the design of Dombeck and colleagues (Dombeck et al., 2007). Briefly, mice were head-fixed and free to run on an air-supported spherical treadmill. The rotation of the ball was restricted around the vertical axis with a pin. The virtual reality environment was projected onto a toroidal screen covering approximately 240 degrees horizontally and 100 degrees vertically of the mouse’s visual field, using a projector (Samsung SP-F10M) synchronized to the resonant scanner of the two-photon microscope. The virtual environment consisted of an infinite corridor with walls patterned with vertical sinusoidal gratings with a spatial frequency of approximately 0.04 cycles per degree (Leinweber et al., 2014). In closed loop sessions, the locomotion of the mouse was coupled to movement along a virtual tunnel. In open loop sessions, we uncoupled the two and replayed the visual flow from a preceding closed loop session. In grating sessions, we presented full-field drifting gratings (0°, 45°, 90°, 270°, moving in either direction) in a pseudo-random sequence. Grating stimuli were presented for between 1 s and 8 s depending on the experiment. In the inter-stimulus interval, mice were shown a gray screen with average luminance matched to that of the grating stimuli. For optogenetic light stimulation, we used 1 s pulses (10 mW after the objective) of a red laser (637 nm) directed at visual cortex through a cranial window.

Two-photon imaging

Two-photon calcium imaging was performed using custom-built microscopes (Leinweber et al. 2014). The illumination source was a tunable femtosecond laser (Insight, Spectra Physics or Chameleon, Coherent) tuned to 930 nm. Emission light was band-pass filtered using a 525/50 filter for GCaMP and a 607/70 filter for tdTomato/mCherry (Semrock) and detected using a GaAsP photomultiplier (H7422, Hamamatsu). Photomultiplier signals were amplified (DHPCA-100, Femto), digitized (NI5772, National Instruments) at 800 MHz, and band-pass filtered at 80 MHz using a digital Fourier-transform filter implemented in custom-written software on an FPGA (NI5772, National Instruments). The scanning system of the microscopes was based on a 12 kHz resonant scanner (Cambridge Technology). Images were acquired at a resolution of 750 x 400 pixels (60 Hz frame rate), and a piezo-electric linear actuator (P-726, Physik Instrumente) was used to move the objective (Nikon 16x, 0.8 NA) in steps of 15 µm between frames to acquire images at 4 different depths. This resulted in an effective frame rate of 15 Hz. The field of view was 375 µm x 300 µm.

Widefield imaging

Widefield imaging experiments were conducted on a custom-build macroscope with commercially available objectives mounted face-to-face (Nikon 85 mm/f1.8 sample side, Nikon 50 mm/f1.4 sensor side). A 470 nm LED (Thorlabs) powered by a custom-build LED driver was used to excite GFP through an excitation filter (SP490, Thorlabs) reflected off a dichroic mirror (LP490, Thorlabs) placed parfocal to the objectives. The fluorescence was collected through a 525/50 emission filter on a sCMOS camera (PCO edge 4.2). LED illumination was adjusted with a collimator (Thorlabs SM2F32-A) to homogenously illuminate cortical surface through the cranial window. An Arduino board (Arduino Mega 2560) was used to synchronize LED onset with frame trigger signal of the camera. The duty cycle of the 470 nm LED was 90%. Images were acquired at 50 Hz or 100 Hz effective frame rate. Raw images were cropped on the sensor and data was stored to disk with custom-written LabVIEW (National Instruments) software, resulting in an effective pixel size of 60 μm2 at a resolution of 1108 pixels x 1220 pixels (1.35 MP).

Extraction of neuronal activity

Calcium imaging data were processed as previously described (Keller et al., 2012) and all data analysis was done in MATLAB (MathWorks). Briefly, raw images were full-frame registered to correct for lateral brain motion. All data with visible z-motion were excluded. Raw fluorescence traces were corrected for slow drift in fluorescence using an 8th-percentile filtering with a 66 s (or 1000 frames) window (Dombeck et al., 2007). ΔF/F0 traces were calculated as mean fluorescence in a selected region of every imaging frame, subtracted and normalized by the median fluorescence of the trace. ROIs were placed relative to readily identifiable anatomical landmarks, resulting in two 20 pixels x 20 pixels ROIs per hemisphere. We calculated ΔF/F0 traces as for two-photon imaging.

Data analysis

All data analysis was done using custom scripts written in MATLAB (MathWorks). To quantify the average population response traces, we first calculated the average event-triggered fluorescence trace for each ROI. The responses of all ROIs were then averaged and baseline-subtracted.

Locomotion onset was defined as running speed crossing a threshold of 0.25 cm/s for at least 1 s, while having been below the threshold during the preceding 1 s. The same criteria were used to define visual flow onsets in the open loop condition using visual flow speed. Visuomotor mismatch responses were probed by presenting brief 1 s full-field visual flow halts in the closed loop condition. For a visuomotor mismatch event to be included in analysis, mice had to be locomoting uninterrupted above threshold (0.25 cm/s) from -0.5 s to +1 s after the event onset. Additionally, for a ROI to be included for analysis of the response to a particular event, it had to have at least 3 onsets to the event. The GFP response was baseline subtracted using a -0.5 s to 0 s window relative to onset. The same was -1 s to -0.5 s in case of locomotion onset to account for preparatory activity.

In Figures 2C-2E, to compare GFP and GCaMP responses, we trial averaged the response of individual neurons and used the mean response over a time-window of 0 s to +2.0 s relative to locomotion or visuomotor mismatch onset, with a baseline subtraction window of -1 s to -0.5 s. For grating responses, we used the mean of the trial averaged response over +0.5 s to +3.0 s relative to stimulus onset, with a baseline subtraction window of -0.5 s to 0 s.

In Figure 3, for each neuron, we averaged the response from +0.5 s to +1.5 s relative to onset for individual locomotion onset and visuomotor mismatch trials and tested if the mean of this distribution is significantly different from 0 using a t-test with a chance threshold of 5% . In a similar analysis, the response window for grating responsive neurons was set at +0.5 s to +2.5 s to account for the 2 s long grating stimuli.

In Figure 4, the blood vessel diameter and the average GFP signal from both blood vessel ROIs and neuropil ROIs were smoothed with a 0.5 s moving average and the variance explained was computed on the -2.0 s to +6.0 s window relative to stimulus onset. In Figure 4C, data points were drawn as outliers if they were larger than 75th percentile + 1.5*(75th percentile - 25th percentile) or smaller than 25th percentile - 1.5*(75th percentile - 25th percentile) of the distribution and were omitted from the figure.

In Figures 7 and S3, due to insufficient triggers, we relaxed the locomotion threshold for mismatch to 0.12 cm/s, and in Figure S3, we relaxed the sitting window before locomotion onset to -0.5 s to 0 s.

Statistical Analysis

All statistical information for the tests performed in the manuscript is provided in Table S1. Unless stated otherwise, the shading indicates the error in mean estimation to within 1 standard deviation. For analysis where the experimental unit was neurons (or ROIs), we used hierarchical bootstrap (Saravanan et al., 2020) for statistical testing due to the nested nature (neurons (or ROIs) and mice) of the data. Briefly, we trial averaged the data for the respective event per neuron (or ROI), and first resampled the data (with replacement) at the level of imaging sites, and then, from the selected sites, resampled for neurons. We then computed the mean of this bootstrap sample and repeated this N times to generate a bootstrap distribution of the mean estimate. For all statistical testing the number of bootstrap samples (N) was 10 000, for plotting bootstrap mean and standard error response curves it was 1000. The bootstrap standard error is the 68% confidence interval (1 SD, 15.8th percentile to 84.2nd percentile) in the bootstrap distribution of the mean.

Supplementary information

Supplementary tables

Statistical information on all analysis.

Number of mice in different experimental groups.

Supplementary figures

GFP response in V1 L2/3 on locomotion onset in closed loop was not a linear sum of component responses. Related to Figure 1.

(A) Average change in GFP signal from L2/3 in V1 in response to visual flow onset in open loop during stationary periods. Mean (solid lines) and the bootstrap standard error (shading) are calculated as hierarchical bootstrap estimate for each time bin.

(B) As in A, but locomotion onset in dark.

(C) As in A, but for locomotion onset in closed loop.

The variance of neuronal GFP signal explained by blood vessel GFP signal as a function of smoothing window. Related to Figure 4D.

Black arrow indicates the smoothing window used in Figure 4D.

Signals in widefield fluorescence imaging of V1 and ACC in mice not expressing a fluorophore. Related to Figure 7.

(A) Average change in signal from V1 on locomotion onset. Mean (solid lines) and the bootstrap standard error (shading) are calculated as hierarchical bootstrap estimate for each time bin, in mice not expressing a fluorophore.

(B) As in A, but on grating onset in V1. Grating duration were randomly selected between 4 s and 8 s (green shading).

(C) As in A, but on visuomotor mismatch in V1. Orange shading indicates the duration of visuomotor mismatch.

(D) As in A, but for change in signal from ACC on locomotion onset.

(E) As in B, but for change in signal from ACC on grating onset.

(F) As in C, but for change in signal from ACC on visuomotor mismatch.

GRAB signals in ACC recorded with two-photon imaging. Related to Figure 8.

(A) Average change in GRAB-DA1m signal in ACC on locomotion onset in ROIs over neuropil (in black) and in ROIs over blood vessels (in red). Mean (solid lines) and the bootstrap standard error (shading) are calculated as hierarchical bootstrap estimate for each time bin.

(B) As in A, but for response to full-field grating onset. Green shading marks the duration of the gratings.

(C) As in A, but for response to visuomotor mismatch.

(E) Average change in GRAB-5HT1.0 signal in ACC on locomotion onset in ROIs over neuropil (in black) and in ROIs over blood vessels (in red).

(F) As in G, but for response to grating onset.

(G) As in G, but for response to visuomotor mismatch.

Acknowledgements

We thank all the members of the Keller lab for discussion and support. This project has received funding from the Swiss National Science Foundation (GBK), the Novartis Research Foundation (GBK), and the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 865617) (GBK).

Additional information

Author contributions

BY designed the experiments. BY performed the two-photon imaging experiments, RJ performed the widefield imaging of GRAB-NE1m experiments, and RJ and MH performed the widefield imaging of GFP and with no fluorophore experiments. BY analyzed the data. BY and GK wrote the manuscript.

Declaration of interests

The authors declare no competing financial interests.