a, Setup of the in vivo microscopy. Awake mice with cranial windows over the barrel cortex are head-fixed and allowed to move on a foam ball. Whisker stimulator (arrow) is used for brushing whiskers to evoke neural activity in the barrel cortex. b–g, Imaging in the barrel cortex. b, Hydrazide injection in Thy1-GCaMP6s mice enables simultaneous imaging of neural activity (green) and arteriolar dilation (magenta). Two-photon imaging of arterioles and neural activity before (left) and after (right) whisker stimulation. Hashes indicate the baseline diameter at time = 0 s. c, Time course of change in arteriolar dilation (magenta) and GCaMP6s fluorescence (green). Orange bar signifies the period of whisker stimulation. d, Two-photon imaging of arterioles (magenta) and capillary blood flow (blue). After intravenous injection of quantum dots, the plasma is bright whereas the red blood cells are dark. e, High magnification of a capillary outlined by the red box in d. Minimizing the image size increases the temporal resolution to about 610 Hz or 1.6 ms per frame. f, Kymographs of capillary blood flow during baseline (left) and whisker stimulation (right). Kymographs were generated from the parallel line scan (red line) of the capillary blood flow in e. g, Time course of change in red blood cell velocity. h, Time course of change in arteriolar dilation in the barrel cortex (black, n = 78 arterioles, 3 mice) and in the retrosplenial cortex (red, n = 54 arterioles, 3 mice). i, Maximum percentage change in arteriolar dilation upon whisker stimulus in these two brain regions upon whisker stimulus. The orange bar signifies the period of whisker stimulation. Data are mean ± s.e.m.; nested unpaired, two-tailed t-test for i. Source Data