a, Two-photon imaging was used to sample somatic calcium signals from a complete population of L2/3 neurons within a 285×285×119 μm3 volume. Imaging was carried out at 7 μm depth increments. Neurons were labeled with the calcium indicator dye OGB-1 AM (green) and the astrocyte marker SR101 (red). b, Example traces of calcium signals from four different cells in the imaged volume while presenting six trials of grating stimuli drifting in eight different directions. c, All orientation selective cells in the volume were color-coded according to preferred orientation and plotted as spheres. d, Signal correlations were computed from average responses to natural movies. Red lines represent strongly correlated neuronal pairs (signal correlation > 0.2). e and f, After imaging visually evoked calcium signals, a detailed image stack was obtained in vivo. The brain was sliced coronally and another stack of the same tissue was obtained in vitro (a single optical plane is shown in f). Affine transformation was used to align the in vivo to the in vitro stack, allowing precise matching of OGB-1-filled cells in the two stacks. g and h, Close-ups of the regions outlined with dashed lines in e and f, respectively.