Figures and data

Setup and longitudinal protocols.
a, Setup for mesoscale calcium imaging of the mouse dorsal cortex during head-fixed spontaneous behaviour. Straight lines indicate the excitation and emission light for calcium imaging. Dashed lines indicate the light used for hemodynamic correction of the calcium signal. An example view from the behavioural camera with the ROI used to compute the motion energy is shown. Mouse image from Scidraw.io (10.5281/zenodo.3926135). b, Longitudinal imaging protocols. The top panel shows the short-term protocol, with sessions spanning days after BE. The bottom panel shows the long-term protocol, with sessions spanning weeks. c, Example data from two sessions in the same mouse from the long-term protocol. The first row shows the hemodynamic-corrected calcium signal (ΔF/F) from the left V1. The second row shows the continuous wavelet transform (CWT) of the signal (cropped to the window illustrated in the first row) within the 0.1–4 Hz band. The third row displays the maximum power over time extracted from the CWT. The last row shows the motion energy, normalised between 0 and 1. Behavioural segmentation into quiescence (orange), locomotion (green), and state transitions (vertical lines), used in the analysis, is overlaid across all rows.

Inversion in the relationship between movements and visual cortex activity.
Scatter plots of the motion energy versus maximum power in left V1 (V1-L) from two sessions of the same mouse: baseline and 3 weeks after BE. Each dot is a data point from the timeseries of the example session. They are colour-coded by behavioural state. Data points that are not associated with a behavioural state have been labelled as unclassified. Magenta lines show linear regression fits, with corresponding Spearman correlation coefficients. b Spearman correlations between the motion energy and maximum power across cortical regions and time. P matrices (P) indicate regions with significant effects of time in a linear mixed-effects ANOVA, FDR-adjusted across regions (p < 0.05). The colour bar indicates log10(p). Baseline matrices (B) show the correlation coefficients averaged across mice and sessions. Post-BE matrices show the difference from baseline. The black outline indicates time points that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). c Spearman correlation between the motion energy and maximum power in V1. Thin lines represent individual mouse data. Diamonds mark significant time points relative to baseline (p < 0.05, post hoc FDR-adjusted). (b,c) See Table S1 for details about the statistics. See Figure S1 for the number of mice per time point.

Sequential and overlapping windows of behaviour-defined plasticity.
a Maximum power during quiescence across cortical regions and time. P matrices (P) indicate regions with significant effects of time in a linear mixed-effects ANOVA, FDR-adjusted across regions (p < 0.05). The colour bar indicates log10(p). Baseline matrices (B) show the maximum power averaged across mice and sessions. Post-BE matrices show the difference from baseline. The black outline indicates time points and regions that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). b, Frequency power spectrum of V1 activity during quiescence, shown as the difference with baseline. The black outline indicates time points and frequencies that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). c, Same as a, but for locomotion. d, Maximum power over time during quiescence and locomotion. Thin lines represent individual mouse data. Diamonds mark significant time points with differences between states (p < 0.05, post hoc FDR-adjusted). (a–d) See Table S1 for details about the statistics. See Figure S1 for the number of mice at each time point.

V1 activity at the onset and offset of locomotion.
Mouse averaged ΔF/F0 response in V1 time locked on the locomotion onset and offset at one baseline and every time point after BE. The last row shows the motion energy time-locked on the transitions from the baseline session. The shaded areas represent the SEM.

Movement initiation suppresses posterior cortical activity after BE.
a, Average ΔF/F0 within a 1s window following locomotion onset across cortical regions and time. P matrices (P) indicate regions with significant effects of time in a linear mixed-effects ANOVA, FDR-adjusted across regions (p < 0.05). The colour bar indicates log10(p). Baseline matrices (B) show the ΔF/F0 averaged across mice and sessions. Post-BE matrices show the difference from baseline. The black outline indicates time points and regions that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). b, V1 activity following locomotion onset is shown as the difference with baseline. The black curve indicates the time from transition with maximum reduction in activity. The black outline indicates protocol and transition time points that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). c, Same as a but for micro-movements. d, Same as b but for micro-movements. (a–d) See Table S1 for details about the statistics. See Figure S6 for the number of mice at each time point.

Rapid increase in visual cortical activity following the cessation of locomotion after BE.
a Average ΔF/F0 within a 1s window following locomotion offset across cortical regions and time. P matrices (P) indicate regions with significant effects of time in a linear mixed-effects ANOVA, FDR-adjusted across regions (p < 0.05). The colour bar indicates log10(p). Baseline matrices (B) show the ΔF/F0 averaged across mice and sessions. Post-BE matrices show the difference from baseline. The black outline indicates time points and regions that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). Rapid loss of visual cortex functional connectivity after BE. b V1 activity following locomotion offset is shown as the difference with baseline. The black curve indicates the time from transition with maximum increase in activity. The black outline indicates protocol and transition time points that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). c Maximum V1 activity within a 3s window following locomotion offset. Thin lines represent individual mouse data. Diamonds mark indicates a significant difference from baseline (p < 0.05, post-hoc FDR-adjusted). (a–c) See Table S1 for details about the statistics. See Figure S6 for the number of mice at each time point.

Reorganisation of the quiescent cortical network.
a, Functional connectivity matrices calculated on the calcium signal (ΔF/F0) during quiescence using the Pearson correlation coefficient corrected with the Fisher z-transformation (z(R)). In the P matrices, only p values < 0.05 (linear mixed-effects model ANOVA, FDR-adjusted across pairs) are shown with a log10-scaled colour bar. The baseline matrices are the average correlation between mice and baseline sessions. The matrices from time points after BE show the difference from baseline, with only connections with a significant time effect shown. b, Network similarity. Thin lines represent individual mouse data. Diamonds mark significant time points relative to baseline (p < 0.05, post hoc FDR-adjusted). c, Homotopic correlations across cortical regions and time. P matrices (P) indicate regions with significant effects of time in a linear mixed-effects ANOVA, FDR-adjusted across regions (p < 0.05). The colour bar indicates log10(p). Baseline matrices (B) show the correlations averaged across mice and sessions. Post-BE matrices show the difference from baseline. The black outline indicates time points and regions that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). d, Same as b but for the V1 intra-hemispheric correlations. e, Same as b but for the average of V1 intra-hemispheric correlations. (a–e) See Table S1 for details about the statistics. See Figure S1 for the number of mice at each time point.

Reorganisation of the locomotion cortical network.
a, Functional connectivity matrices calculated on the calcium signal (ΔF/F0) during locomotion using the Pearson correlation coefficient corrected with the Fisher z-transformation (z(R)). In the P matrices, only p values < 0.05 (linear mixed-effects model ANOVA, FDR-adjusted across pairs) are shown with a log10-scaled colour bar. The baseline matrices are the average correlation between mice and baseline sessions. The matrices from time points after BE show the difference from baseline, with only connections with a significant time effect shown. b, Network similarity. Thin lines represent individual mouse data. Diamonds mark significant time points relative to baseline (p < 0.05, post hoc FDR-adjusted). c, Homotopic correlations across cortical regions and time. P matrices (P) indicate regions with significant effects of time in a linear mixed-effects ANOVA, FDR-adjusted across regions (p < 0.05). The colour bar indicates log10(p). Baseline matrices (B) show the correlations averaged across mice and sessions. Post-BE matrices show the difference from baseline. The black outline indicates time points and regions that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). d, Same as b but for the V1 intra-hemispheric correlations. e, same as b but for the average of V1 intra-hemispheric correlations. (a–e) See Table S1 for details about the statistics. See Figure S1 for the number of mice at each time point.

Summary of main findings.

Number of mice in each state.
a Number of mice in each state in both longitudinal protocols. As every mouse had at least one awake session per time point, the “awake” line represents the maximum number of mice at each time point. For locomotion and quiescence, the number of mice was equal to or inferior to the maximum (awake). Indeed, some mice had no quiescence and/or locomotion that entered the classification criteria. For a given mouse, this could also vary over time. b Number of mice in each state for each cortical region in the short-term protocol. Since regions were excluded based on the pixel intensity and implant quality (See Methods, Supplementary Fig. 5), the N for each region and behaviour is not consistent over time. Here, for each behavioural state, the heatmap shows the number of mice per region and time point. c Same as b, but for the long-term protocol.

V1 power spectrums over time (related to
Fig. 3). a Power spectrum over time of the V1 activity during quiescence, shown in log10 power. b Same as a but for locomotion. c Frequency power spectrum of V1 activity during locomotion, shown as the difference with baseline. The black outline indicates time points and frequencies that are significantly different from baseline (p < 0.05, post hoc FDR-adjusted). See Table S1 for details about the statistics. See Figure S1 for the number of mice included at each time point.

Behaviour over time.
a Total behavioural state duration in a 20-minute session. b Number of behavioural state epochs. c Motion energy during locomotion. d Motion energy during quiescence. (a-d) Thin lines represent individual mouse data. Diamonds mark significant time points relative to baseline (p < 0.05, post hoc FDR-adjusted). See Table S1 for details about the statistics. See Figure S1 for the number of mice included at each time point.

HL activity at the onset and offset of locomotion (related to
Fig. 4). a Mouse averaged ΔF/F0 response in HL and motion energy time locked on the locomotion onset and offset at one baseline and every time point after BE. The shaded areas represent the SEM.

Related to
Fig. 5. a Mouse averaged ΔF/F0 response in HL and motion energy time locked on micro-movements at one baseline and every time point after BE. The shaded areas represent the SEM. b Average ΔF/F0 within a 1s window following micro-movements, normalised to the pre-transition period. Diamonds mark significant time points with differences between states (p < 0.05, post hoc FDR-adjusted). c, Average motion energy within a 1s window following micro-movements. Diamonds mark significant time points relative to baseline (p < 0.05, post hoc FDR-adjusted). (b,c) Thin lines represent individual mouse data. See Table S1 for details about the statistics. See Figure S6 for the number of mice included at each time point.

Number of mice in each state transition.
a Number of mice per transition in both longitudinal protocols. The number of mice was equal to or less than awake in Supplementary Figure 1. b Number of mice in each transition for each cortical region in the short-term protocol. Since regions were excluded based on the pixel intensity and implant quality (See Methods, Supplementary Fig. 5), the N for each region and behaviour was not consistent over time. Here, for each behavioural state, the heatmap shows the number of mice per region and time point. c Same as b, but for the long-term protocol.

Cortical network reorganisation during spontaneous behaviour.
a Functional connectivity matrices calculated on the calcium signal (ΔF/F0) during spontaneous behaviour using the Pearson correlation coefficient corrected with the Fisher z-transformation (z(R)). In the P matrices, only p values < 0.05 (linear mixed-effects model ANOVA, FDR-adjusted across pairs) are shown with a log10-scaled colour bar. The baseline matrices are the average correlation between mice and baseline sessions. The matrices from time points after BE show the difference from baseline, with only connections with a significant time effect shown. b Diagram of a connectivity matrix. In a hemisphere, regions are arranged in order according to their anteroposterior position. c Network similarity. Thin lines represent individual mouse data. Diamonds mark significant time points relative to baseline (p < 0.05, post hoc FDR-adjusted). (a–c) See Table S1 for details about the statistics. See Figure S1 for the number of mice at each time point.

Chronic imaging window.
a Imaging window viewed from the calcium channel over time from an example mouse. b Images from the green channel (green reflectance) showing the dorsal cortex seen through the chronic imaging window at the last session of each mouse. The atlas and the cortical mask are overlaid on it. In the short-term protocol, the cortical mask has been drawn once per mouse, on a reference session during baseline. c Same as b, but for the long-term protocol. The cortical mask has been drawn for each session of each mouse due to implant degradation over time. (a-c) Above each image, the corresponding time point is indicated. Scale bar is 1mm.