Abstract¶
Background & Rationale¶
Figure 1:Distributed predictive-processing hypotheses motivate multimodal recordings. A, A visual sequence establishes an expectation (blue), whereas an unexpected oddball produces a prediction-error signal (red). Predictions and errors may be expressed through reciprocal brain-wide pathways, within local cortical populations, and across the dendritic and somatic compartments of individual neurons. B, To sample these nested scales within one standardized project, animals progressed from surgery through intrinsic-signal-imaging mapping and habituation before recording with mesoscope two-photon imaging, Neuropixels electrophysiology, or SLAP2 dendritic imaging. C, Five cohort timelines show eight outlined habituation and training sessions followed by filled neural-recording sessions. Neuropixels and mesoscope sampled motor- and sequence-habituated cohorts in opposite context orders. Neuropixels sampled every context once, whereas mesoscope repeated each context twice; SLAP2 sampled the motor-habituated cohort only.
The challenge of predictive processing research¶
Predictive processing theories propose that the brain continuously generates predictions about incoming sensory signals and updates its internal models when those predictions are violated. These prediction errors are thought to drive perception, learning, and behavior. While this framework has gained considerable theoretical support, significant conflicts persist in the experimental literature regarding the neural mechanisms that implement predictive computations.
Relationship to the companion review¶
This data release follows up a community review paper which synthesizes the theoretical motivations, identifies the key convergences and divergences in the predictive processing literature, and details the experimental hypotheses that this dataset was designed to test. Specifically, the dataset allows testing of two overarching alternative hypotheses: (H0) that different types of prediction errors involve fundamentally distinct neural mechanisms with specialized circuits for each type, or (H1) that a common computational principle underlies all mismatch responses, with apparent differences reflecting implementation variations.
What gap this dataset fills¶
A recent (May 6, 2026) database search on PubMed using the Boolean search: “predictive processing” OR “predictive coding”, returned more than 3,000 peer-reviewed publications (3,166). A thorough meta-analysis of such a large amount of scientific literature is arguably beyond the capability of any individual scientist. Recently, a group of more than 60 experts in the field thus aimed to collectively review this research corpus Aizenbud et al., 2026. A main finding of this collective effort was that the concept of predictive processing has given rise to multiple, loosely overlapping research fields that differ both in research methodology as well as experimental paradigms. That is, experimental studies on predictive processing range in scope from measurements of single neurons to full brain studies, giving rise to computational models that range from single synapses to large neuronal networks. And, at the same time, experimental studies on predictive processing use a large variety of different stimuli, giving rise to a variety of computational models that support some but not other paradigms. As a consequence, research on predictive processing has grown fragmented both methodologically and conceptually. This fragmentation produced a multitude of gaps in the research landscape that collectively impede coherent assessment of the current state of the art of predictive processing as a whole.
Our dataset was designed to fill these gaps by creating a bridge across both these dimensions (methods and stimuli) in an attempt to unify these divergent approaches. The aim is rigorous evaluation and study of predictive processing across experimental paradigms and neuroscientific methodologies. More specifically, as discussed below, we employed 4 of the most commonly used stimulus designs across 2 of the most commonly used techniques (electrophysiology and neuroimaging). On top of that, we added single vesicle glutamate imaging (SLAP2) to expand spatial coverage from multiple brain areas down to singular synaptic spines, or from multi-area computations down to single neuron computations. Each of these methodological modalities were performed in vivo using the same standardized experimental paradigm and stimuli.
Cross-context comparability¶
Existing studies of prediction errors typically employ only one class of mismatch stimulus (e.g., orientation oddball or visuomotor mismatch) in isolation, making it impossible to determine whether the observed neural responses reflect a general prediction error mechanism or a stimulus-specific computation. Our experimental design presents four distinct types of prediction violations (standard oddball, sensorimotor mismatch, temporal sequence mismatch, and duration mismatch) enabling direct comparison of mismatched responses across animals.
Large-scale, multi-modal population recordings¶
Previous datasets are typically limited to a single recording modality, preventing comparison of signals at different spatial and temporal scales. Our dataset combines Neuropixels electrophysiology (providing single-unit resolution across many brain regions simultaneously), two-photon mesoscope imaging (providing cell-type-specific calcium signals across VISp and VISlm, two visual areas in the mouse visual cortex), and SLAP2 imaging (providing subcellular dendritic recording in in the center of VISp). This multi-modal approach allows researchers to address questions about predictive processing at scales ranging from subcellular compartments to brain-wide networks.
Experimental design¶
Two cohorts design¶
To investigate whether prior experience with a specific predictive context influences neural responses to prediction violations, animals were divided into two cohorts that differed in their habituation experience and the order in which experimental sessions were presented. Both cohorts underwent all four mismatch session types, but the session experienced first (and for which animals had extensive prior habituation) differed between cohorts. This design enables within-animal comparison of mismatch responses across contexts, while the between-cohort comparison reveals how learned expectations from habituation shape these responses Aizenbud et al., 2026.
The motor cohort was habituated in a closed-loop visuomotor environment in which locomotion on a running disc controlled the phase of a vertical drifting visual grating stimulus that mimicked optic flow. During habituation (days 6–10, with session durations increasing from 8 to 48 min) and full-length training sessions (>1 h), animals experienced continuous closed-loop optic flow without any mismatch events. Experimental sessions where neuronal activity was recorded were then conducted in the following fixed order:
Sensorimotor mismatch,
Standard oddball
Sequence mismatch
Duration mismatch.
The sequence cohort was habituated to passively view repeating sequences of drifting gratings (A–B–C–D–grey) without any mismatch events. During habituation (days 6–10, durations 8–48 min) and full-length training sessions (>1 h), animals viewed these sequences while freely running on the disc, which had no effect on the visual stimulus. Experimental sessions where neuronal activity was recorded were then conducted in the following fixed order:
Sequence mismatch
Duration mismatch
Standard oddball
Sensorimotor mismatch.
In both cohorts, the session that matched the habituation context was presented first, ensuring maximal learned expectation for the primary mismatch type. The remaining three sessions were presented in a counterbalanced order across cohorts. Each session was run in immediate succession: once for Neuropixels electrophysiology and twice for mesoscope two-photon calcium imaging, resulting in four or eight total recording sessions per animal. Given a limited throughput, experiments with the SLAP2 platform focused on the motor cohort. Each platform was used in a way that leverage their respective strengths: Experiments using the Mesoscope modality aimed to target the same exact population of neurons across all sessions types twice for a total of 8 cell-matched sessions; experiments using the Neuropixels modality were new probe insertions each day and aimed to record from the same areas (but not the same units) across all 4 types exactly once; experiments on the SLAP2 modality aimed to record the same neuron across all 4 sessions types exactly once. Across all modalities, those goals were met with pass/failure rates that are shared below. This cross-modality allocation is summarized in Figure 1C. QC-passing unit yields across the four Neuropixels recording days are summarized in Supplementary Figure 2.
Four predictive contexts
The four distinct session contexts each targeted a different aspect of predictive processing. For all 4 contexts, the stimuli table containing both recurring and deviant trials were created at the onset of each session. The resulting tables were then subsequently shuffled so that the mouse could not predict the exact occurrence of deviants (pseudo-random). The order of stimuli blocks (deviant vs control blocks) were maintained across all sessions.
The shared within-session architecture and context-specific stimulus selection are summarized in Figure 2.
Figure 2:Within-session architecture for cross-context comparison. In the Static view, A shows the common session sequence: a standard control precedes each context block and is repeated immediately afterward, followed by shared randomized, duration, open-loop, receptive-field, and zebra-movie blocks. B details the four contexts and the control and system-identification stimuli used to measure context-induced changes in response properties. The Interactive view mirrors panel A: select one of the four contexts from the vertical selector above the Context block or select any shared control or system-identification block directly. It reconstructs contiguous rows from the pinned generated stimulus tables in their source pseudo-randomized order, with the source trial number shown for each frame. The Movie block plays an excerpt of the canonical zebra stimulus, and receptive-field mapping uses the stated 120° × 95° angular projection. Sources: pinned example tables, generator, Bonsai workflow, and public NWB intervals for electrophysiology and mesoscope.
The mismatch repeat count and session length were informed by the five published visual oddball paradigms compared in Supplementary Table 1. Those studies reported 10--144 required oddball repeats and total session durations ranging from 6 min to 2 h. We therefore set each 26-min context block to 1.35 mismatch events per minute for each of four deviant types (5.4/min combined), targeting approximately 35 repeats per deviant type and 140 mismatch events per context block. This placed per-deviant sampling within the published range while keeping the complete shared block sequence to approximately 71 min and applying the same event rate across all four predictive contexts.
Session type 1: Standard oddball.¶
Full-field sinusoidal drifting gratings were presented in a classical oddball paradigm. The standard stimulus (0° orientation, 0.04 cycles per degree, 2 Hz temporal frequency, 100% contrast) was presented with high probability, with each trial consisting of a 343 ms stimulus presentation followed by a 343 ms grey inter-stimulus interval (686 ms total trial duration). Deviant stimuli occurred randomly at a combined rate of 5.4 per minute (1.35/min per type) and included: orientation deviants at 45° and 90°, a halt deviant (temporal frequency set to 0, producing a stationary grating), and an omission deviant (contrast set to 0, producing a blank screen).
Session type 2 — Sensorimotor mismatch.¶
Optic flow was coupled to the animal’s locomotion on the running disc, creating a closed-loop visuomotor environment. A full-field sinusoidal grating (0° orientation, 0.04 cpd) was displayed with its phase updated at 30 Hz based on wheel rotation. The coupling gain was set such that the visual flow was consistent with that experienced by a freely moving mouse. Mismatch events were introduced by transiently decoupling visual flow from locomotion for 343 ms. Mismatch types (each at 1.35/min) included: motor halt (temporal frequency set to 0, freezing grating motion despite continued locomotion), motor omission (contrast set to 0, removing the grating entirely), and motor orientation changes (grating orientation shifted to 45° or 90° while drifting at 2 Hz independent of the wheel). A minimum interval of 2 s separated consecutive mismatch events, with a 5 s buffer at the start and end of the block.
Session type 3 — Sequence mismatch.¶
Animals were presented with repeating five-element sequences of drifting gratings. Each sequence consisted of four oriented gratings (90°–45°–0°–45°) followed by a grey inter-sequence interval with each element presented for 250 ms, yielding a total sequence duration of 1.25 s. All gratings were full-field (0.04 cpd, 2 Hz temporal frequency, 100% contrast). Mismatch events were introduced by substituting the third element (normally 0°) of a sequence at a combined rate of 5.4 mismatch sequences per minute. Mismatch types included: orientation substitution to 45° (producing a repeated element where a change was expected), orientation substitution to 90° (introducing a novel orientation), halt (stationary grating), and omission (blank screen at the substitution position).
Session type 4 — Duration/temporal mismatch.¶
Full-field sinusoidal drifting gratings (0° orientation, 0.04 cpd, 2 Hz temporal frequency, 100% contrast) were presented with a standard trial structure of 343 ms stimulus followed by a 343 ms delay (686 ms total). Temporal prediction violations were introduced by altering the inter-stimulus delay while keeping the stimulus duration constant. Deviant delays included 150 ms (shorter than expected), 500 ms, and 1000 ms (longer than expected), each occurring at 1.35/min. Omission deviants (contrast = 0) were also included at 1.35/min.
Shared session design¶
All four session types shared an identical set of control blocks presented before and after the main mismatch block, enabling cross-session normalization and quality assessment. Each session comprised the following blocks in order:
Standard control block (6.4 min): 14 grating orientations (spaced every 22.5° from 0° to 315°) plus omission and halt trials, each repeated multiple times and presented in shuffled order. Each trial used the standard 343 ms stimulus + 343 ms delay structure (0.04 cpd, 2 Hz, 100% contrast, full-field). This block provides orientation tuning curves and adaptation-free baselines.
Main mismatch block (26 min): The session-specific mismatch paradigm (standard oddball, sensorimotor, sequence, or duration mismatch, as described above).
Standard control block (6.4 min): A repeat of the first control block, enabling assessment of response stability over the session.
Sequential control block (4.7 min): The same 14 orientations plus omissions and halts as in the standard control block, but presented with 250 ms duration (matching the temporal structure of the sequence mismatch paradigm) and shuffled randomly without sequential structure. This serves as a non-sequential baseline for the sequence mismatch session.
Jitter (duration) control block (6.4 min): Gratings (0° orientation, standard parameters) presented with seven different inter-stimulus delays (150, 343, 500, 750, 1000, 1500, and 914 ms), each repeated uniformly across the block, plus omission trials. This provides a matched-stimulus baseline for the duration mismatch session, where all delays occur with equal probability.
Open-loop prerecorded block (6.4 min): A shared pre-recorded wheel-derived phase trajectories (sampled at 30 Hz from previous running sessions) drove the grating phase in open loop, replicating naturalistic visual flow patterns without actual closed-loop coupling. Motor mismatch events (orientation changes, halts, and omissions, each at 1.35/min) were injected into this playback, providing a sensorimotor mismatch control condition where the animal’s locomotion does not match the visual flow.
Natural movie block (10 min): A naturalistic “zebra noise” movie (120° × 95° visual field, 30 fps, 300 s duration, presented twice) was displayed Skriabine et al., 2026. This stimulus serves as a shared reference for cross-session and cross-modality comparison, and provides a rich stimulus for characterizing neural response properties.
Receptive field mapping block (5 min): A small drifting grating patch (20° diameter, 0.08 cpd, 4 Hz temporal frequency, 80% contrast) was presented at 81 positions on a 9 × 9 grid spanning ±40° of visual space in 10° steps. Three orientations (0°, 45°, 90°) were tested at each position with 5 repeats, using 250 ms presentations. This block enables estimation of spatial receptive fields for individual neurons.
Multimodal recording hardware¶
Figure 3:Multimodal recording hardware. Rows compare Neuropixels electrophysiology, mesoscope two-photon calcium imaging, and SLAP2 dendritic imaging. Columns show each rig geometry, the corresponding head-fixed mouse platform, and the brain-targeting strategy. Neuropixels uses six acute trajectories spanning cortical and subcortical structures; mesoscope uses eight chronic imaging planes across VISp and VISlm; and SLAP2 samples proximal and apical dendritic compartments in a layer II/III pyramidal neuron. The figure is reconstructed from nine native-resolution images extracted directly from the editable PowerPoint source.
Methods¶
Show complete Methods
Experimental animals¶
All animal procedures were approved by the Institutional Animal Care and Use Committee (IACUC) at the Allen Institute under protocol 2427 and conducted in accordance with NIH guidelines. Following surgery (see below), all mice were single-housed and maintained on a reverse 12-hour light cycle in a shared facility with room temperatures between 68º and 72ºF and humidity between 30 and 70%. All experiments were performed during the dark cycle. All mice in these experiments were given ad libitum access to food (regular or doxycycline diets) and water.
To systematically collect physiological data, we used standardized data collection and processing pipelines that were previously introduced de Vries et al., 2020Groblewski et al., 2020Durand et al., 2023Bennett et al., 2024Siegle et al., 2021. The data collection workflow progressed from surgical headpost implantation and craniotomy to retinotopic mapping of cortical areas using intrinsic signal imaging, in vivo recording of neuronal activity using various modalities (Neuropixels, Mesoscope two photon imaging, SLAP2 dendritic two-photon imaging), brain fixation and brain histology (see Figure 1). We describe each one of those steps in the dedicated sections below. As part of this workflow, all mice were trained on one of two possible cohorts: A motor cohort and a sequence cohort. Details of each cohort is described in the behavioral training section below. Both behavioral cohorts were recorded with the Neuropixels and Mesoscope recording modality. Only the motor cohort was used for SLAP2 experiments. Each modality (Neuropixels, Mesoscope, SLAP2) was recorded with separate mice as they had different, modality-specific brain implants.
Mesoscopic two-photon calcium imaging experimental animals¶
For experiments involving calcium imaging of GCaMP8s positive cells, male and female transgenic mice (n=14) with pan-neuronal cortical expression of GCaMP8s were used. Snap25-IRES-Cre Harris et al., 2014 was bred in-house and crossed with a GCaMP8s reporter line (Oi4), both of which are maintained on a C57BL/6J background. Snap25-IRES-Cre;Oi4 breeding sets consisted of heterozygous Snap25-IRES-Cre mice (JAX stock #023525) crossed with heterozygous or homozygous TIGRE2-RiboL1-jGCaMP8s-IRES-tTA2 (aka Oi4) mice (JAX stock #039267) Daigle et al., 2018Zhang et al., 2023. Experimental animals were heterozygous for both transgenes (full genotype Snap25-IRES2-Cre/wt;Oi4(TIT2L-jGCaMP8s-RiboL1-WPRE-ICL-IRES-tTA2-WPRE)/wt). Experimental mice show pan-neuronal expression patterns of GCaMP8s in Snap25-expressing cell populations. All mice (including breeders) were maintained on a 200 mg/kg rodent doxycycline diet (Bio-Serv; Flemington, NJ) to suppress tTA2 activity (and subsequent TRE2 promoter-driven expression) during development. Breeding cages were continuously maintained on a doxycycline diet. At weaning (~p20) mice with correct genotype were transferred to cages with standard chow for the remainder of the experiment (PicoLab 5L0D; Lab Diet, Richmod, IN). Despite limiting GCaMP8s expression during development with doxycycline the mice exhibited a sex-dependent reduction in survival rates at older age; at p200 males had a 72% survival rate while females had a 61% rate, n=123). We were unable to identify a clear, single cause for this reduced survival rate.
Neuropixels electrophysiology experimental animals¶
For experiments involving opto-tagging of inhibitory cells, male and female transgenic mice (n=17) expressing ChR2 in Cre-defined cell populations were used. Sst-IRES-Cre mice were bred in-house and crossed with an Ai32 channel rhodopsin reporter line, both maintained on a C57BL/6J background. Sst-IRES-Cre;Ai32 breeding sets consisted of heterozygous Sst-IRES-Cre mice (JAX stock #028864) crossed with homozygous Ai32(RCL-ChR2(H134R)_EYFP) mice (JAX stock #024109) Madisen et al., 2012Taniguchi et al., 2011. Experimental mice were heterozygous for both transgenes (full genotype Sst-IRES-Cre/wt;Ai32(RCL-ChR2(H134R)_EYFP)/wt). Cre+ cells from Ai32 lines are highly photosensitive, due to expression of Channelrhodopsin-2 Zhang et al., 2006.
SLAP2 experimental animals¶
For experiments involving simultaneous glutamate and calcium imaging, male and female wild-type C57BL/6J mice from JAX laboratory injected with Cre-dependent hSyn.FLEX.iGluSnFR4f.NGR and CAG.FLEX.RCaMP3 (or jRGECO1a) AAVs (serotype PHP.eB) were used. Sparse labeling was achieved via low titers (6E+8 vg/mL) of CaMKII-Cre virus. For experiments involving dendritic voltage imaging, male and female wild-type C57BL/6J mice from JAX laboratory injected with Cre dependent ASAP7 virus were used.
Surgery & cranial window procedure: two-photon calcium imaging experiments¶
A subset of mice received a headpost and cranial window surgery as previously described Groblewski et al., 2020de Vries et al., 2020. Headpost and cranial window surgery was performed on healthy male and female transgenic mice (p54-p80) weighing no less than 14 grams at time of surgery. Pre-operative injections of dexamethasone (3-4.2 mg/kg, S.C.) and ceftriaxone (100-125 mg/kg, S.C.) were administered at 1h before surgery. Additionally, carprofen was administered for pain management (5-10 mg/kg, S.C.), and atropine was administered to suppress bronchial secretions and regulate heart rhythms (0.02-0.05 mg/kg, S.C.). Mice were initially anesthetized with 2-4% isoflurane and placed in a stereotaxic frame (Model# 1900, KOPF; Tujunga, CA), and isoflurane levels were maintained at 1.0-2.0% for surgery. An incision was made to remove skin, and the exposed skull was levelled with respect to pitch (bregma-lambda level), roll and yaw. The stereotax was zeroed at lambda using a custom headframe holder equipped with a stylus affixed to a clamp-plate. The stylus was then replaced with the headframe to center the headframe well at 2.8 mm lateral and 1.3 mm anterior to lambda. The headframe was affixed to the skull with white dental cement (C&B Metabond; Parkell; Edgewood, NY) and once dried, the mouse was placed in a custom clamp to position the skull at a rotated angle of 23° such that the visual cortex was horizontal to facilitate creation of the craniotomy. A circular piece of skull 5 mm in diameter was removed, and a durotomy was performed. A glass coverslip (cut from a single piece of glass to obtain a “stacked” appearance that consisted of a 5 mm diameter “core” and 7 mm diameter “flange”), was cemented in place with Vetbond (3M; St. Paul, MN). Dental cement was then applied around the cranial window inside the well to secure the glass window, and subsequently covered with black tempura paint to reduce glare during imaging. The mouse was given 1.0-1.5mL Lactated Ringers Solution (LRS) to help recover from the surgery and replace lost fluids. Post-surgical brain health was documented using a custom photo-documentation system and animals were assessed one, two, and seven days following surgery for overall health (bright, alert and responsive), cranial window clarity and brain health.
Surgery & cranial window procedure: Neuropixels experiments¶
A subset of the mice received the SHIELD surgical procedure, which has previously been described Bennett et al., 2024. The SHIELD procedure was performed on healthy male and female transgenic mice (p53-p139) weighing no less than 14 grams at time of surgery. Pre-operative injections of dexamethasone (3-4.2 mg/kg, S.C.) and ceftriaxone (100-125 mg/kg, S.C.) were administered 1 h before surgery to reduce swelling and postoperative pain. Additionally, carprofen (5-10 mg/kg, S.C.) was administered for pain management, and atropine (0.02-0.05 mg/kg, S.C.) was administered to suppress bronchial secretions and regulate heart rhythms. Mice were initially anesthetized with 2-4% isoflurane and placed in a stereotaxic frame (Model# 1900, KOPF; Tujunga, CA). Isoflurane levels were maintained at 1.0-2.0%, and body temperature was maintained at 37.5°C for the duration of the surgery. An incision was made on the dorsal surface of the skull, and skin was removed in a teardrop shape, exposing the rostral rhinal vein between the eyes, the dorsal surface of the parietal and occipital skull plates, and stopping where the neck muscle begins to attach to the back of the skull. Next, the periosteum was removed from the skull surface to improve adhesion of the cement to the skull and prevent future scabbing and infection. Starting posterior of the left eye, angled forceps were used to separate cheek muscle from the skull, as well as connective tissue and muscle above the left ear. The cheek muscle was then pulled away from the skull and is stretched out so that it makes a seal with the left lateral portion of the well. The exposed skin (and any exposed soft tissue such as the cheek muscle) was then sealed with Vetbond, and the exposed skull was leveled with respect to pitch, roll, and yaw. Once the skull was leveled, bregma was identified using the custom bregma stylus. Without moving the stereotaxic arm in X or Y, the stylus was replaced with a custom “tracer” that provides a guide for marking the craniotomy with respect to bregma. A #11 scalpel blade (or forceps) was used to etch a faint line in the skull around the tracer, which was then replaced with a shallow trench by lightly drilling without breaking through the skull (NeoBurr EF4). After etching was complete, the tracer was replaced with the headframe, which was then lowered in Z to make contact with the skull. Next, dental cement (C&B Metabond, Parkell) was used to attach the headframe to the skull. Once the cement hardened, the headframe was clamped into a custom frame, and the craniotomy and durotomy were performed. After sterilization, a custom implant was then lowered into the craniotomy. To provide a surface that can be glued to the skull, a flange on the implant extends beyond the cranial window and sits directly on the bone, where it was sealed with Vetbond and attached to the skull Once dry, the vetbond was covered with metabond to further secure the implant to the skull. The inner part of the implant sits on the brain surface. Any areas of exposed skull were then covered with cement. Any white cement on the inside of the well was coated with a layer of black tempura paint to reduce glare during ISI imaging. The mouse was given 1.0-1.5mL Lactated Ringers Solution (LRS) to help recover from the surgery and replace lost fluids. After removing the mouse from anesthesia, but prior to it waking up, a photo-documentation image was acquired. Finally, a removable plastic cap was placed over the well to protect the coated implant from cage debris, and the mouse was returned to its home cage for recovery. Over the following 7-14 days, mice were monitored regularly for overall health, cranial window clarity, and brain health.
Surgery & cranial window procedure: SLAP2 experiments¶
A subset of mice received the SLAP2 Visual Cortex laser level procedure. The SLAP2 Visual Cortex laser level procedure was performed on healthy male and female transgenic mice (p53-p139) weighing no less than 14 grams at time of surgery. This is a variation on the Visual Cortex surgery used for the mesoscope experiments. To achieve single cell resolution the optimal angle for the SLAP2 microscope is as close to perpendicular to the craniotomy coverslip as possible. To facilitate this the headframe was attached after the coverslip was secured. This allowed the headframe to be installed on a consistent plane relative to the coverslip, ensuring proper interfacing between the craniotomy and SLAP2 microscope objective. Pre-operative injections of dexamethasone (3-4.2 mg/kg, S.C.) and ceftriaxone (100-125 mg/kg, S.C.) were administered 1 hour before surgery to reduce swelling and postoperative pain and protect against infection. Additionally, carprofen (5-10 mg/kg, S.C.) was administered for pain management, and atropine (0.02-0.05 mg/kg, S.C.) was administered to suppress bronchial secretions and regulate heart rhythms. Mice were initially anesthetized with 4% isoflurane and placed in a stereotaxic frame (Model# 1900, KOPF; Tujunga, CA). Isoflurane levels were maintained at 1.0-2.0%, and body temperature was maintained at 37.5°C for the duration of the surgery. An incision was made on the dorsal surface of the skull. Skin was removed in a teardrop shape; exposing the rostral rhinal vein between the eyes, the dorsal surface of the parietal and occipital skull plates and stopping where the neck muscle begins to attach to the back of the skull. Next, the periosteum was removed from the skull surface to improve adhesion of the cement to the skull and prevent future scabbing and infection. Starting posterior to the left eye, angled forceps were used to separate cheek muscle from the skull, as well as connective tissue and muscle above the left ear. The cheek muscle was then pulled away from the skull and stretched out so that it makes a seal with the left lateral portion of the well. The exposed skin, and any exposed soft tissue such as the cheek muscle, was sealed with Vetbond (3M; St. Paul, MN). The 5mm craniotomy “tracer” provided a guide for marking the craniotomy and was centered at 2.8 mm lateral and 1.3 mm anterior to lambda. Forceps were used to etch a faint line in the skull around the tracer. Using the drill (NeoBurr EF4), without breaking through the skull, the etch was then replaced by a shallow trench. The mouse was rotated clockwise approximately 23 degrees to create a level surface to drill on and help angle the coverslip to accurately interface perpendicularly with the SLAP2 microscope. A well was created with a silicone polymer (Body Double Fast; Smooth-On; East Texas, PA) large enough to encompass the craniotomy and bregma. Craniotomy and durotomy were then performed. The mouse was rotated back 23 degrees counterclockwise for virus injection. A Nanoject III (Drummond; Broomall, PA) was then zeroed at bregma, and virus was injected with a beveled pipette at 3.1 mm lateral, 3.1 mm posterior to and at 3.1 mm lateral, 3.9 mm posterior to bregma, at depths of 0.3 mm and 0.6 mm below surface of the cortex for each point. The mouse was rotated back clockwise approximately 23 degrees to return the craniotomy to an approximately leveled plane relative to pitch, roll, and yaw. A glass coverslip (cut from a single piece of glass to obtain a “stacked” appearance that consisted of a 5 mm diameter “core” and 7 mm diameter “flange”), was lowered into the craniotomy. The 2mm flange was cemented in place with Vetbond. A custom in-house laser leveling tool was used to level the coverslip so that it was perpendicular to the stereotaxic arm. The mouse skull was turned back 23 degrees counterclockwise, and pitch was raised 6 degrees to keep the coverslip in a parallel plane relative to the headframe. This allowed for proper interfacing of the glass coverslip and the SLAP2 microscope when the mouse was head fixed in the headframe. Using the stereotaxic arm, a headframe was lowered onto the skull and secured in place with clear dental cement (C&B Metabond; Parkell; Edgewood, NY), covering all remaining exposed skull. Black tempura paint was applied on top of the clear cement outside the headframe to reduce light leaks. The mouse was given 1.0-1.5mL Lactated Ringers Solution (LRS) to help recover from the surgery and replace lost fluids. After removing the mouse from anesthesia, prior to it waking up, post-surgical brain health was documented using a custom photo-documentation system. Animals were assessed on days one, two, and seven following surgeries for overall health (bright, alert and responsive), cranial window clarity and brain health.
Intrinsic signal imaging / retinotopic mapping¶
Intrinsic signal imaging (ISI) measures the hemodynamic response of the cortex to visual stimulation across the full field of view. This retinotopic mapping represents the spatial relationship between the visual field and cortical locations within each visual area. For both Neuropixels and Mesoscope two-photon imaging experiments, retinotopic maps were used to delineate functionally defined visual area boundaries and to guide targeting of in vivo two-photon calcium imaging to retinotopically defined locations in primary and secondary visual areas.
Animal preparation¶
For every ISI imaging session, mice were lightly anesthetized with 1–1.4% isoflurane delivered via a SomnoSuite system (model 715; Kent Scientific, CT, USA) at a flow rate of 100 mL/min, supplemented with ~95% O₂ (Pureline OC4000; Scivena Scientific, OR, USA). Lubricating eye ointment (Lacri-Lube; Refresh) was applied to maintain corneal hydration and clarity during anesthesia. Mice were positioned on a lab jack and head-fixed such that the cranial window was normal to the imaging axis. The head frame and clamping mechanism ensured consistent positioning of the eye relative to the stimulus monitor across experiments.
Image acquisition system¶
To map retinotopic organization and standardize data acquisition, a custom ISI system coupled to visual stimulation was used. The cortical surface was illuminated with a ring of independently controlled LEDs, including green (peak λ = 527 nm, FWHM = 50 nm; Cree Inc., C503B-GCN-CY0C0791) and red (peak λ = 635 nm, FWHM = 20 nm; Avago Technologies, HLMP-EG08-Y2000) wavelengths mounted on the objective. A tandem lens configuration (Nikon Nikkor 105 mm f/2.8 rear lens and Nikon Nikkor 35 mm f/1.4 front lens) provided 3.0× magnification (M = 105/35). The back focal plane of the front lens was positioned adjacent and coplanar to the cranial window (working distance: 46.5 mm). A bandpass filter (Semrock FF01-630/92 nm) was used to preferentially transmit longer-wavelength reflectance signals while minimizing contamination from the stimulus monitor and ambient light.
Image acquisition and illumination were controlled via custom Python software. Images were acquired using an Andor Zyla 5.5 10-tap sCMOS camera at 40 Hz, with frame timing governed by the camera’s 40 MHz hardware clock. Image acquisition and stimulus presentation were synchronized via hardware triggering from a National Instruments digital I/O board. Raw images (2560 × 2160 pixels, 16-bit) were spatially (4×4) and temporally (4×) binned to yield 640 × 640 pixel frames at 10 Hz with 32-bit dynamic range and an effective pixel size of 10 µm.
Intrinsic imaging visual stimulus¶
The lambda–bregma axis of the skull was oriented at a 30° pitch relative to horizontal, corresponding to an eye position approximately 60° lateral to the midline and 20° above the horizon Oommen & Stahl, 2008. A 24″ monitor was positioned 10 cm from the right eye to maximize visual field coverage. The monitor was rotated 30° relative to the dorsoventral axis and tilted 70° relative to the horizon to maintain perpendicularity to the optic axis.
The visual stimulus consisted of a drifting bar containing a contrast-reversing checkerboard pattern on a gray background. The bar swept across the four cardinal directions at 0.1 Hz, with 10 repetitions per direction Kalatsky & Stryker, 2003. The bar measured 20° × 155°, with individual checker squares of 25°. Stimuli were spatially warped to approximate a spherical visual field projection on a flat display Marshel et al., 2011.
Image acquisition and processing¶
A high-resolution image of the cortical vasculature was first acquired under green illumination to serve as a fiducial reference. The imaging plane was then defocused 500–1500 µm below the surface to capture intrinsic signals. Up to 10 ISI time series were collected per experiment.
Time series were preprocessed by removing the time-averaged pixel intensity (DC component) to improve signal-to-noise ratio. A discrete Fourier transform (DFT) was computed at the stimulus frequency. Phase maps were generated from the phase angle of the DFT and used to map visual field position onto cortical coordinates. Sign maps were derived by computing the sine of the angle between the gradients of the altitude and azimuth phase maps. Final sign maps were averaged across at least three time series (minimum of 30 sweeps per direction).
Automated sign map segmentation and annotation¶
For each experiment, visual field sign maps were segmented into distinct visual areas using an automated algorithm (adapted from Garrett et al., 2014). Segmentation was based on three criteria: (1) each area contains a uniform visual field sign, (2) each area represents a unique (non-redundant) portion of visual space, and (3) adjacent areas with the same sign exhibit redundant visual field representations.
Eccentricity and target map generation¶
Eccentricity maps were computed relative to the center of visual space (0° azimuth, 0° altitude). When the eye is properly aligned, this point corresponds approximately to the anatomical center of V1. The eccentricity at the V1 centroid was used as a quality control metric to identify experiments with significant eye misalignment (>15°).
To define target regions for two-photon imaging, eccentricity maps were thresholded to include locations within 10° of the V1 center. These targeting maps were overlaid onto vasculature images to provide fiducial landmarks for aligning imaging fields across sessions and ensuring retinotopic consistency.
ISI quality control¶
Quality control of ISI-derived maps consisted of four steps:
Brain surface and vasculature images were inspected before and after acquisition for clarity, focus, and cranial window positioning.
Individual trials were evaluated for sufficient visual coverage, continuity of phase maps, localization of amplitude maps, and expected sign map organization. Only trials meeting these criteria were included (minimum of three trials).
Automated segmentation was required to identify at least six visual areas (VISp, VISlm, VISrl, VISal, VISam, VISpm).
Final maps were assessed for visual field coverage (35–60° altitude, 60–100° azimuth), minimal bias (<10° range imbalance), alignment of the retinotopic center with the V1 centroid, and minimum V1 area (>2.8 mm²).
Behavioral training¶
Mice were trained in individual sound-attenuating enclosures arranged in clusters. Each enclosure was arranged similarly to that of the mesoscope two-photon microscope, SLAP2 two-photon imaging microscope and the Neuropixels rigs. A 24” LCD monitor was positioned 15 cm from the mouse’s right eye, with the sagittal axis of the head parallel to the screen. A registered headframe clamp was attached to a behavior stage equipped with kinematic mounts to ensure repeatable placement of the stage in the enclosure. Each stage consisted of a fixed-position headframe clamp and adjustable running wheel. Enclosures were equipped with a camera coupled with IR illumination to monitor mouse activity. Those videos were recorded but kept temporarily on disk.
Animals received a 2-week training procedure following a previously published head-fixation habituation protocol de Vries et al., 2020.
Habituation to handling and head-fixation was performed for five days: On days 1-2 mice were removed from the home cage and gently handled for 1-2 min. On days 3-5 mice were removed from the home cage and handled for 1-2 min, then head-fixed by securing the headframe in the behavior stage clamping mechanism. The stage was then placed in the lit behavior enclosure for 5-10 min.
Passive behavior training was then performed to habituate mice to extended periods of head-fixation and expose the mice to visual stimuli. On days 6-10 mice were removed from the home cage and handled for 1-2 min. Mice were then head-fixed to the behavior stage and the stage was placed in the behavior enclosure. A set of full-screen stimuli was displayed for increasing periods. Visual stimuli were displayed for increasing durations of 8, 18, 28, 38, and 48 min on days 6 through 10, respectively.
The habituation protocol included two cohorts of mice. (1) The sequence cohort passively viewed a repeating sequence of four drifting gratings (90°–45°–0°–45°) followed by a grey inter-sequence interval, without any mismatch events. Each element was presented for 250 ms, and gratings were full-field (0.04 cpd, 2 Hz temporal frequency, 100% contrast). Animals were free to walk and rotate the disc beneath their body; however, disc rotation had no effect on the stimuli presented on the screen. This established a learned expectation for the sequential structure. (2) The motor cohort was habituated in a closed-loop paradigm in which locomotion on the running disc controlled the phase of a full-field sinusoidal grating (0° orientation, 0.04 cpd) via a rotary encoder. This configuration approximated natural visual flow, such that forward locomotion produced corresponding backward grating motion consistent with that experienced by a freely moving mouse. No mismatch events were presented during any habituation sessions in either cohort. The full-length habituation sessions additionally included control blocks (standard control, sequential control, jitter control, open-loop prerecorded, natural movie, and receptive field mapping) identical to those used in the experimental sessions, further habituating the animals to the full session structure.
Visual stimulation¶
All visual stimuli were generated using BonVision Lopes et al., 2021, an open-source visual environment package running within the Bonsai reactive programming framework Lopes et al., 2015. For behavior training, Neuropixels recordings and mesoscope imaging, stimuli were rendered at 60 Hz and displayed on a gamma-calibrated ASUS PA248Q LCD monitor (1920 × 1200 pixels, 55.7 cm wide, 60 Hz refresh rate) positioned 15 cm from the animal’s right eye (see Figure 1). A spherical warping correction (BonVision SphereMapping) was applied to all stimuli to compensate for the close viewing distance and flat display geometry, ensuring that apparent size, speed, and spatial frequency were constant across the visual field as seen from the mouse’s perspective. The monitor subtended 120° × 95° of visual space. Mean luminance was 50 cd/m². Stimulus timing was synchronized to neural recordings via a photodiode placed on a sync square region of the monitor that alternated between black and white every 60 frames, and via digital synchronization pulses sent to a National Instruments digital board. The full stimulus code, Bonsai workflow, and parameter files are available on the project’s GitHub repository (https://
For each session, a stimulus table (CSV file) was generated programmatically by a Python script (generate_experiment_csv.py) using a session-specific random seed derived from the session UUID and timestamp, ensuring unique trial sequences across sessions while maintaining reproducibility. This CSV table specified all trial parameters (orientation, spatial frequency, temporal frequency, contrast, duration, delay, position, phase, trial type, and block membership) and was read by the Bonsai workflow (generic_oddball.bonsai) to drive stimulus presentation in sequence.
In the sensorimotor mismatch context, the phase of the drifting grating was coupled to the angular position of the running disc via a rotary encoder. The wheel-to-visual coupling was computed as: phase (radians) = 2π × R × θ / tan(1/f × π/180), where R is the wheel radius-to-screen ratio (0.36), θ is the wheel angle in degrees, and f is the spatial frequency (0.04 cpd). This coupling was calibrated so that the resulting visual flow approximated the optic flow a freely moving mouse would experience during forward locomotion.
Stimuli parameters¶
All drifting grating stimuli shared the following base parameters unless otherwise specified: spatial frequency 0.04 cpd, temporal frequency 2 Hz, 100% contrast, sinusoidal luminance profile, full-field extent (360° diameter with spherical correction). For the standard oddball, sequence mismatch, and duration mismatch sessions, gratings drifted at a fixed temporal frequency of 2 Hz. For the sensorimotor mismatch session, the grating phase was updated at 30 Hz (every other video frame) based on wheel rotation, with temporal frequency set to 0 in the stimulus table (wheel-controlled mode). Oddball/mismatch events occurred at a rate of 1.35 per minute per deviant type (5.4/min total across four deviant types) in all session types. The stimulus parameters for each session type and shared control blocks are detailed in the Experimental design section above.
Neuronal recording modalities¶
Neuropixels extracellular electrophysiology.¶
Habituation to the Neuropixels rigs.¶
Prior to the first recording, mice were habituated to the Neuropixels rigs every day for a week. These sessions were similar to the recording session in length but did not include oddballs. There were 2 cohorts of mice, one exposed to motor stimuli and the other to the sequence stimuli (see stimuli description).
Implant design for recordings¶
The implant was designed as stated in the surgery section and was described previously Bennett et al., 2024. Briefly, we created a CAD file with holes strategically placed above the areas of interest for our study (see Supplementary Figure 1). Some hole coordinates have been previously validated to allow targeting of areas such as the center of VISp, and other hole coordinates were derived from publications, such as VISa Lyamzin & Benucci, 2019. Hole positions were adjusted using Pinpoint Birman et al., 2023. Note that the placement of the implant on the brain can vary slightly due to mouse-to-mouse variability and surgical precision. The coordinates of holes were referenced from bregma; their diameters and intended target areas are represented in Supplementary Figure 1.
SORTA-Clear plug removal and agarose application¶
To prepare the brain for recording, the SORTA-Clear coating over the implant is removed and replaced with a temporary layer of Kwik-Cast (World Precision Instruments). The mouse is anesthetized with isoflurane (5% induction, 1-2% maintenance, 100% O2) and eyes protected with ocular lubricant (I-DROP, VetPLUS). Body temperature is maintained at 37.5°C (TC-1000 temperature controller, CWE, Incorporated). The well is cleaned of any debris using ethanol swabs. Then, the inside of the well surrounding the SORTA-Clear plug is painted with white Metabond to improve visibility during probe insertion. Once the Metabond is dry, the well is flooded with enough ACSF to completely submerge the SORTA-Clear sheet, which is then removed with small forceps, starting at the anterior or posterior end of the sheet and peeling gently to remove it in one piece. Once the SORTA-Clear sheet is completely detached from the implant, the edges of implant holes are tested with small forceps to ensure all holes are free of SORTA-clear or debris. ACSF is removed from the well using Sugi spears (Kettenbach) and the well is filled with Kwik-Cast. Once the Kwik-Cast is fully dry, a plastic protective cap is secured on the well to protect against debris and the mice are returned to their home cage. This preparation is generally performed Fridays for recordings on Mondays to avoid using isoflurane on the day of experiment.
Head fixation.¶
On the day of recording, the mouse is removed from its home cage and clamped to the running wheel on the experimental rig. Wheel height is adjusted as needed for each mouse. Once head-fixed, the protective well cap and Kwik-Cast layer are removed. The ground wire is tucked into the side of the well and any excess debris cleaned using a Sugi spear or cotton tipped applicator. Approximately 0.2ml of agarose (4%: 0.4 g of BioRad Low Melt and 0.4 g of Sigma agarose high electroendosmosis in 20.2 ml ACSF Durand et al., 2023 is applied in a smooth layer over the entire implant surface and ground wire. After popping any large bubbles, the agarose is allowed to set for ∼10 seconds. To prevent the agarose from drying out during the experiment, a layer of silicon oil is applied over exposed agarose with a toothpick. At the end of the experiment, the agar is removed and replaced with Kwik-Cast.
The 3D-printed protective cone was then lowered to prevent the mouse’s tail from striking the probes. An infrared dichroic mirror was placed in front of the right eye to allow the eye-tracking camera to operate without interference from the visual stimulus.
Grounding.¶
A 32 AWG silver wire (A-M Systems) is epoxied to the headframe during the implant surgery and served as the ground connection. The wire is pre-soldered to a gold pin embedded in the headframe well, which mates with a second gold pin on the protective cone. This second gold pin is connected to both the behavior stage and the probe ground. Prior to the experiment, the brain-to-probe ground path is checked using a multimeter. The reference connection on the Neuropixels probes is permanently soldered to ground using a silver wire, and all recordings are made using the tip reference configuration. The headstage grounds (which are contiguous with the Neuropixels probe grounds) are connected with 36 AWG copper wire (Phoenix Wire). All probes are connected in parallel to animal ground.
Neuropixels probes¶
All neural recordings were carried out with Neuropixels 1.0 probes Jun et al., 2017, as previously described Siegle et al., 2021Durand et al., 2023. The 384 electrodes closest to the tip are used, providing a maximum of 3.84 mm of tissue coverage. The signals from each recording site are split in hardware into a spike band (30 kHz sampling rate, 500 Hz highpass filter) and a Local Field Potential (LFP) band (2.5 kHz sampling rate, 1000 Hz lowpass filter). Our goal was to insert six probes into the same mouse’s brain on each of 4 consecutive days. To distinguish the paths of these different penetrations, we use two dyes, CM-DiI (1 mM in ethanol; ThermoFisher Product #V22888) on day 1 and 2 and CM-DiD (1mM in ethanol; AAT Bioquest catalogue number 22060) on day 3 and 4. The probes are coated with dye before recordings by immersing them at least 3mm into a well filled with dye. Each probe are dipped five times to ensure adequate coating.
Neuropixels probe insertion¶
Our custom experimental rig can insert up to six Neuropixels probes simultaneously (see Figure 3). Each probe is mounted on a separate 3-axis micromanipulator with a 15 mm travel range (New Scale Technologies, Victor, NY). Probes are driven to their target holes and lowered to the surface of the brain while the experimentalist monitores a camera feed to avoid vasculature and watches real-time signals on the OpenEphys GUI to identify activity indicative of the brain surface. If the probe need adjustment when attempting to insert (e.g. to avoid vessels), the probe are completely retracted out of the silicon oil to prevent probe bending. Once all probes reach the brain surface, each probe is zeroed and set to insert 3100 μm deep at 200 μm/min and then retracted 100 μm to their final depths to reduce tissue compression and subsequent electrode zdrift relative to the brain. Once all probes reach their final depth, the probes are allowed to settle for ∼30 minutes, and a photo documentation of the inserted probes is captured. Sometimes a probe can not be inserted into its assigned hole, failures are generally due to dura regrowth. Overall, we achieved a penetration success of 5.8 probes per session.
Data acquisition and synchronization.¶
Neuropixels data is acquired at 30 kHz (spike band) and 2.5 kHz (LFP band) using the Open Ephys GUI Siegle et al., 2017. Gain settings of 500× and 250× are used for the spike band and LFP band, respectively. Probes are connected to a PXIe card inside a National Instruments chassis.
Videos of the eye, body and face are acquired at 60 Hz. The angular velocity of the running wheel is recorded at the time of each stimulus frame, at approximately 60 Hz. Synchronization signals for each frame are acquired by a dedicated computer with a National Instruments card acquiring digital inputs at 100 kHz, which is considered the master clock. A 32-bit digital ‘barcode’ is sent with an Arduino Uno (SparkFun DEV-11021) every 30 s to synchronize all devices with the neural data. Each Neuropixels probe has an independent sample rate between 29,999.90 Hz and 30,000.31 Hz, making it necessary to align the samples offline to achieve precise synchronization. The synchronization procedure uses the first matching barcode between each probe and the master clock to determine the clock offset, and the last matching barcode to determine the clock scaling factor.
To synchronize the visual stimulus to the master clock, a silicon photodiode (PDA36A, Thorlabs) was placed on the stimulus monitor above a “sync square” that alternated between black and white every 60 frames.
Stimulus Monitor¶
We lower a black curtain over the front of the rig, placing the mouse in complete darkness except for the visual stimulus monitor. Visual stimuli are generated using custom scripts based on PsychoPy9 and are displayed using an ASUS PA248Q LCD monitor, with 1,920 × 1,200 pixels (55.7 cm wide, 60 Hz refresh rate). Stimuli are presented monocularly, and the monitor is positioned 15 cm from the right eye of the mouse and spans 120° × 95° of visual space before stimulus warping. Each monitor is gamma corrected and has a mean luminance of 50 cd m−2. To account for the close viewing angle of the mouse, a spherical warping is applied to all stimuli to ensure that the apparent size, speed and spatial frequency were constant across the monitor as seen from the mouse’s perspective.
Probe removal and cleaning¶
After each experiment, the probes are retracted from the brain at a rate of ~3000μm/min and the mouse is removed from head fixation and returned to its home cage. If another recording session is to occur the same day, the probes are then immersed in a well of freshly made 1% Tergazyme mixed with agarose for 5 minutes to remove excess residue, followed by immersion in 1% Tergazyme for 30 minutes, immersion in Milli-Q water for 25 minutes, and dipped in 100% isopropyl alcohol for 1 minute. After the last recording session of the day, the probes are immersed in a well of freshly made 1% Tergazyme for ~12 hours.
Quality Control for Neuropixels recording sessions¶
Possible QC failure can come from these cases: white foam buildup on the edge of the eye covering the pupil, software failures compromising critical data streams, visual stimulus synchronizing failure, cortical bleeding or compromised brain health resulting in low unit activity and/or atypical visual responses, gap in data acquisition and discovery of purulent material over right hemisphere during ex-vivo imaging. Out of a total of 56 sessions, 12 are excluded for eye foam.
Optotagging protocol¶
At the end of every experiment, an optotagging protocol is run during which the cortical surface is stimulated with blue light. In Sst-IRES-Cre/wt;Ai32(RCL-ChR2(H134R)_EYFP)/wt mice, this protocol allowes us to identify putative Sst+ cortical interneurons by an increase in spiking activity time-locked to laser stimulation (and consequent ChR2 activation). Blue light is delivered by a 473 nm laser (Laser Quantum, model Ciel or Cobolt model 06-MLD). The light source is coupled to a 400 μm diameter fiber optic cable (Thorlabs) or bifurcated fiber bundle (Thorlabs, BFYL4LF01), with the tip(s) positioned such that blue light illuminates the entire cranial window. Two types of stimuli at 3 different light levels are randomly interleaved: a 10 ms pulse, and a 1s raised cosine ramp. For the pulse stimulus, a 0.5 ms ramp is applied at the beginning and end of the pulse. Stimuli are presented at intervals of 1.5 s plus a uniformly distributed delay between 0 and 0.5 s.
Clearing with life canvas¶
We use published protocols to perform the tissue sample preparation steps for clearing a whole mouse brain. Briefly, the brain is perfused and fixed in 4% paraformaldehyde in order to prepare it for light sheet microscopy. In a timeline of two weeks, the brain will be stripped of lipids Myers & Toglia, 2023 and rendered transparent in an index matching solution Myers & Toglia, 2023, allowing for viewing the morphology of anatomical brain structures. Then the brain is embedded in agarose for imaging Myers & Toglia, 2023. This protocol collection is ideal for experiments where high quality clearing is desired for imaging finer cell structures that are located deep in the brain, or when it is necessary to preserve endogenous fluorescence.
Imaging of cleared brains for Neuropixels probe trajectory¶
Agarose blocks containing cleared mouse brains were fixed to the sample arm of a light sheet microscope (LifeCanvas Technologies) and submerged into an immersion oil bath matching the refractive index for the clearing technique described above (Cargille Laboratories). Specimens were oriented such that the light sheet and focal plane aligned to the transverse anatomical plane with the superior surface closest to the imaging objective and the excitation light entering from either the left or right hemisphere, determined relative to the sagittal mid-plane. Data was collected using a 4X 0.20 NA objective, modified to 3.6X for oil immersion, stepped axially to produce voxels 2.0 x 1.8 x 1.8 𝞵m^3 in (z, y, x).
Raw data was then packaged with relevant metadata, uploaded to cloud storage, and used to create derived data, including contiguous image volumes for each channel, transform fields mapping to/from the Allen CCFv3, and neuroglancer viewer links for visualizing results.
Two-photon mesoscope calcium imaging¶
Multi-plane calcium imaging was performed using a dual-beam mesoscope (Multiscope), enabling simultaneous imaging of two planes and effectively doubling imaging throughput (Orlova, Tsyboulski, Najafi et al., 2020). The system builds on the 2P-RAM platform (Sofroniew et al., 2016) with a compact optomechanical add-on that introduces a second excitation beam and simplifies alignment.
The dual-beam configuration consists of: (1) a delay line to split the excitation beam and temporally offset one beam by half the laser pulse period; (2) a secondary z-scanner to independently position each beam along the axial (z) dimension; and (3) a custom demultiplexing unit. Temporal encoding of the excitation beams enables separation of fluorescence signals based on photon arrival time at the detector. Laser excitation was provided by a Coherent Axon laser operating at 910 nm.
The system was controlled using customized ScanImage software (Vidrio Technologies) in conjunction with an in-house workflow sequencing engine (WSE; see below). Emitted fluorescence was detected with a single photomultiplier tube (PMT), and signals from the two imaging planes were separated using a custom analog demultiplexing circuit (Orlova et al., 2020). Demultiplexing was achieved by multiplying the PMT signal with two complementary square waveforms corresponding to the temporal windows of each excitation beam.
The integration window (6.25 ns; half the laser pulse period) does not fully capture the fluorescence decay, resulting in partial signal bleed-through between channels (~10% inter-plane crosstalk). This residual crosstalk was reduced using an independent component analysis (ICA)-based demixing algorithm (see below). National Instruments data acquisition hardware (PXI chassis, PXIe-6363 boards) was used for system control and data acquisition.
To coordinate hardware and software components, a workflow sequencing engine (WSE) was developed in Python. The WSE uses a distributed messaging interface to communicate with ScanImage, the stimulus presentation computer, synchronization hardware, and behavioral monitoring systems (body and eye tracking). The WSE also integrates user-guided steps: when manual intervention is required (e.g., hardware adjustments), the system prompts the operator and records task completion. Upon completion of each experiment, the WSE aggregates all data streams and automatically initiates transfer to a centralized data repository.
Habituation to Mesoscope rig¶
Prior to the first imaging session, mice were habituated to the imaging rig under head fixation for 30 minutes. Habituation sessions were conducted under the same ambient conditions as experimental recordings (dim red light, imaging environment) but without visual stimulus presentation. These sessions allowed animals to acclimate to head fixation, the rotating disk, and the experimental setup prior to data collection.
During habituation, the mesoscope objective was aligned to be as close as possible to perpendicular to the cranial window to optimize imaging quality. Alignment was verified using an infrared (IR) viewer by directing the excitation beam onto the cranial window and confirming that the reflected signal returned to the objective. Stage coordinates (X, Y, R1 & R2 - objective rotation) were recorded to facilitate consistent field-of-view positioning and cell matching across subsequent imaging sessions.
Mesoscope imaging data collection¶
All experimental setup was performed under dim red illumination to preserve the reversed light–dark cycle; imaging was conducted in darkness. Mice were head-fixed on a freely rotating disk, allowing voluntary locomotion. During imaging, the mouse eye was positioned 15 cm from the display. The screen center was located 118.6 mm lateral, 86.2 mm anterior, and 31.6 mm dorsal relative to the right eye, aligning the display normal to the average gaze axis.
The disk surface was covered with removable foam (Super-Resilient Foam, McMaster) to reduce motion-related artifacts. Water-based ultrasonic gel was used as the immersion medium to minimize evaporation and leakage during imaging.
On the first imaging day, ISI-derived targeting maps generated for each animal were used to identify regions of interest (ROIs) in VISp and VISl. Target locations were verified by registering the ISI-derived targeting map, overlaid on a reference image of the cortical surface vasculature, to live epifluorescence images acquired under blue light illumination. Alignment was performed using superficial vascular landmarks (e.g., vessel branching patterns and intersections) across the 5 mm cranial window, enabling accurate localization of regions of interest and consistent targeting across imaging sessions.
Following this alignment, the cranial window was visualized under two-photon (2P) imaging. The live 2P surface image was compared to the ISI-targeting map and vasculature reference to define ROIs for each recording site (400 × 400 µm field of view; 512 × 512 pixels). For each ROI, a 2P reference image of the cortical surface was acquired.
Imaging planes were then positioned relative to the cortical surface at depths corresponding to cortical layers I (~0–100 µm), II/III (~100–300 µm), IV (~300–400 µm), and V (~400–500 µm), with exact depths adjusted based on cortical landmarks and image features. A reference image was acquired at each imaging plane to support subsequent field-of-view alignment and subsequent session cell matching.
After acquisition of reference images at the cortical surface and imaging depths, a z-stack centered on the imaging plane (±30 µm, 0.75 µm step size) was collected to assess cortical structure and estimate axial motion (see Quality Control, Z-axis stability). At the end of the first recording session, a widefield epifluorescence image of the cranial window is also acquired. This image is used for aligning and targeting the same field of views for successive imaging sessions.
For subsequent imaging sessions, previously defined imaging fields were re-identified using a stepwise alignment procedure to reproduce the field of view and imaging depth established during the initial imaging session.
The mesoscope objective was first returned to the reference tilt (R1 and R2) and stage coordinates (x and y) established during habituation, providing an initial estimate of the imaging location.
A live epifluorescence image of the cranial window was acquired and aligned to the reference epifluorescence image from the initial imaging session using superficial vascular landmarks to recover the targeted cortical regions.
A two-photon image of the cortical surface was then acquired and matched to the corresponding surface reference image from the initial imaging session to refine field-of-view alignment.
Finally, the imaging plane was adjusted in the x-, y-, and z-axes until cellular features and other anatomical landmarks matched those in the reference images acquired at the target imaging depth, enabling reliable field-of-view and cell matching across imaging sessions.
Imaging parameters¶
After stabilizing the imaging plane, PMT gain and laser power were adjusted to maximize signal-to-noise ratio and dynamic range while limiting saturation (<1000 saturated pixels per frame). A predefined power lookup table guided parameter selection. Signal intensity between planes was balanced by adjusting beam power while monitoring pixel intensity histograms.
Laser power was selected from the depth-dependent lookup ranges.
Mesoscope laser power lookup ranges by imaging depth.
| Depth from surface (µm) | Minimum power (mW) | Maximum power (mW) |
|---|---|---|
| 0-50 | 0 | 30 |
| 50-100 | 25 | 50 |
| 100-150 | 50 | 80 |
| 150-200 | 70 | 100 |
| 200-250 | 90 | 125 |
| 250-300 | 110 | 170 |
| 300-350 | 150 | 180 |
| 350-400 | 160 | 190 |
| 400-450 | 200 | 240 |
| 450-500 | 200 | 240 |
| 500-550 | 200 | 240 |
| 550-600 | 200 | 240 |
Two-photon imaging data (512 × 512 pixels; 11 Hz per plane for multi-plane acquisitions), eye tracking (30 Hz), and behavioral video (30 Hz) were recorded simultaneously and continuously monitored. Recording sessions were approximately 60 minutes in duration, with total imaging sessions lasting up to 75 minutes including setup and calibration. Sessions were terminated early if animals exhibited signs of stress (e.g., excessive periocular secretion, abnormal posture) or if data quality was compromised by technical issues, including loss of synchronization between data streams, photomultiplier tube (PMT) signal instability, or dropped imaging frames.
A total of 15 mice were allocated for the 2-photon workflow. The Sequence & Motor cohorts each consists of 5 completed data sets with each mouse undergoing 8 imaging sessions. Additional sessions were acquired as needed to replace datasets that failed quality control. 5 mice were removed from the workflow due to health-related issues.
Quality control for two-photon calcium imaging¶
Quality control metrics were evaluated after each session. Sessions failing any criterion were repeated.
Image saturation: Initial frames were inspected to ensure fewer than 1000 saturated pixels and adequate use of the detector dynamic range.
Photobleaching: Baseline fluorescence at the beginning and end of the session was compared; sessions with >20% signal loss were excluded.
Targeting accuracy: Imaging locations were registered to ISI-derived maps to confirm correct visual area targeting.
Z-axis stability: Mean images from the first and last 5 minutes were compared to a post hoc z-stack (±30 µm, 0.75 µm steps) to estimate drift. Sessions with >10 µm drift were excluded.
Animal well-being: Behavioral videos were reviewed for signs of stress (e.g., excessive secretion, orbital tightening, abnormal posture). Animals exhibiting sustained stress responses were removed from the experiment.
Temporal synchronization: Alignment across all recorded data streams was verified.
System integrity: Data streams were assessed for hardware or software failures affecting data quality.
Motion artifacts: Residual motion was evaluated after motion correction.
Interictal activity: Full-field fluorescence traces (first 10,000 frames) were analyzed for abnormal transient events. Sessions with potential interictal activity were manually reviewed and excluded if necessary Steinmetz et al., 2017.
Metrics used for each criteria are available on the AWS S3 bucket in a qc.json file
SLAP2 dendritic imaging.¶
Dual-color imaging of synaptic glutamate and somatic calcium in single neurons was performed using SLAP2. SLAP2 allows for simultaneous measurement of arbitrarily-shaped ROIs across two imaging planes. Citation needed: add the SLAP2 methods paper when available. We recorded from Layer 2/3 pyramidal neurons in the visual cortex. We imaged from soma and several peri-somatic dendritic segments in one plane, and imaged several apical dendritic segments on the second plane, typically achieving recordings of >100 synapses at >200 Hz each. Imaging was motion stabilized by using SLAP2’s image-based online motion correction.
Acquisition of reference stacks and ROI selection¶
Prior to functional imaging, structural reference stacks were acquired for motion correction and ROI definition. For each imaging plane, a z-stack consisting of 21 optical sections spaced 1 um apart was collected, averaging 35--45 repeated acquisitions per section . One reference stack was centered on the soma and proximal dendrites, whereas the second stack was centered on apical dendritic regions.
Reference stacks were aligned during the imaging session and used to define imaging ROIs. ROIs were drawn manually encompassing dendritic segments containing visually identifiable spines and algorithmically refined to exclude dark background pixels. Restricting ROIs to dendritic shafts and spines reduces the number of imaged pixels and increases sampling rate.
The reference stacks were also used for online motion correction during functional imaging. Lateral (x-y) displacements were estimated by registering incoming data to the reference volumes and were used to update the DMD illumination patterns in real time. Axial (z) motion was compensated independently using a remote-focusing system, allowing ROIs to remain aligned to the targeted neuronal structures throughout the recording session.
Data processing¶
Neuropixels extracellular electrophysiology.¶
Raw data was processed using the AIND ephys pipeline Allen Institute for Neural Dynamics, 2026 on the Code Ocean platform. In brief, the pipeline is implemented in Nextflow DSL2 and each probe was processed in parallel with the following steps:
Preprocessing: including phase shift, highpass filter, bad channel detection and removal, common median reference
Spike Sorting with Kilosort version 4
Postprocessing: computing additional extensions (e.g., waveforms, spike amplitudes, PCA scores) and quality metrics
Curation: applying quality-metric based thresholding and UnitRefine pre-trained classifiers Jain et al., 2025
Visualization and QC: generation of plots for quality control of raw and spike sorted data
For more details, please refer to Buccino et al., 2026
Identification of brain areas associated with Neuropixels nodes¶
After brains are processed in the imaging pipeline, neuroglancer (https://
Electrophysiology features recorded from neural probes are aligned with anatomical landmarks based on the Allen Mouse Brain Common Coordinate Framework (CCFv3) Wang et al., 2020. For this, we use the IBL ephys alignment GUI (https://
Two-photon mesoscope calcium imaging.¶
Raw two-photon calcium imaging data were processed using the AIND planar optical physiology pipeline (aind-pophys-pipeline v11 and v13; https://
Data conversion: For multiplane mesoscope data acquired with the dual-beam configuration, interleaved TIFF files were de-interleaved into individual imaging planes and stored as separate HDF5 timeseries using the aind-pophys-converter-capsule (https://
github .com /AllenNeuralDynamics /aind -pophys -converter -capsule). Motion correction: Non-rigid (piecewise rigid) motion correction was performed on each plane using Suite2p Pachitariu et al., 2016 (https://
github .com /MouseLand /suite2p), implemented in the aind-ophys-motion-correction capsule (https:// github .com /AllenNeuralDynamics /aind -ophys -motion -correction). Default parameters included a maximum registration shift of 10% of the field of view (maxregshift = 0.1), Gaussian spatial smoothing with σ = 1.15 pixels, a maximum non-rigid shift of 5 pixels per block (maxregshiftNR = 5), and a signal-to-noise threshold of 1.2 for block smoothing (snr_thresh = 1.2). Frames were processed in batches of 500. Decrosstalk: Because the dual-beam mesoscope acquires pairs of imaging planes with temporally offset excitation beams that are separated by analog demultiplexing, the incomplete capture of fluorescence decay within the 6.25 ns integration window produces approximately 10% inter-plane signal crosstalk. To correct this residual bleed-through, paired planes were identified from session metadata using the aind-ophys-group-planes capsule (https://
github .com /AllenNeuralDynamics /aind -ophys -group -planes), and an independent component analysis (ICA)-based demixing algorithm was applied to the motion-corrected plane pairs using the aind-ophys-decrosstalk-roi-images capsule (https:// github .com /AllenNeuralDynamics /aind -ophys -decrosstalk -roi -images). Cell segmentation and trace extraction: Regions of interest (ROIs) corresponding to individual neurons were detected using a cell detection algorithm, implemented in the aind-ophys-extraction capsule (https://
github .com /AllenNeuralDynamics /aind -ophys -extraction). The default configuration used Suite2p’s sparse detection mode (init = sparsery) with automatic diameter estimation (diameter = 0), a cell probability threshold of 0.0 (cellprob_threshold = 0.0), threshold scaling of 1, and a maximum overlap of 75% between ROIs (max_overlap = 0.75). For each detected ROI, a raw fluorescence trace was computed by averaging pixel intensities within the ROI footprint. Neuropil contamination was estimated from a surrounding annular region and subtracted using a neuropil correction coefficient determined by minimizing the mutual information between the corrected trace and the neuropil signal. Suite2p’s built-in classifier was used to provide an initial cell/non-cell classification for each ROI.
ROI classification: Following extraction, a GPU-accelerated ROI classification step was applied to each imaging plane using a pre-trained classifier (aind-ophys-classifier capsule). The classifier, trained using the ROICaT framework (Region Of Interest Classification and Tracking; https://
github .com /richiehakim /ROICaT), categorized each detected ROI as a cell or non-cell based on learned spatial features. The classification results were stored in a separate classification.h5 file for each plane and used to label ROIs in the final NWB output. ΔF/F computation: Baseline-corrected fluorescence traces (ΔF/F) were computed from the neuropil-corrected traces using the aind-ophys-dff capsule (https://
github .com /AllenNeuralDynamics /aind -ophys -dff). The algorithm proceeded as follows: (1) the noise standard deviation σ was estimated using the median absolute deviation (MAD) method; (2) an initial baseline b was estimated; (3) active frames were identified as outliers exceeding b + 3σ and masked; (4) the baseline fluorescence F₀ was obtained by median-filtering the trace over a 60 s sliding window using only inactive frames, with interpolation across masked segments; (5) ΔF/F was computed as (F − F₀) / F₀. A short window of 3.333 s was used for local noise estimation, and the inactive percentile was set to 10. Event detection: Deconvolved neural events were extracted from the ΔF/F traces using the OASIS algorithm Friedrich et al., 2017; (https://
github .com /j -friedrich /OASIS), implemented in the aind-ophys-oasis-event-detection capsule (https:// github .com /AllenNeuralDynamics /aind -ophys -oasis -event -detection). OASIS performs nonnegative deconvolution of calcium fluorescence traces to infer the underlying spike-related activity, modeling the calcium dynamics as an autoregressive process with an exponential decay kernel. The decay time constant, baseline, and sparsity penalty (Lagrange multiplier for the noise constraint) were automatically estimated from the data’s autocovariance. The outputs include the inferred deconvolved activity (event rates), the denoised fluorescence trace, and the estimated model parameters for each ROI.
SLAP2 dendritic imaging.¶
Post-hoc motion correction¶
Images were generated with an 80 Hz query timebase, and aligned using a custom algorithm (MultiRoiRegistration; AllenNeuralDynamics/GIAnT-MATLAB (2026)), as conventional motion correction algorithms are unstable when correcting motion in thin strip fields of view (Pnevmatikakis & Giovannucci, 2017). Our algorithm was implemented in MATLAB. In brief, the algorithm first initializes a template by using NoRMCorre (Pnevmatikakis & Giovannucci, 2017) to align 42 evenly-spaced frames throughout a trial. Each frame is then aligned against the template by finding the X and Y displacement that yields the maximum cross-correlation among imaged pixels. The pixel values and template values are square root transformed as variance stabilizing technique. Subpixel shifts are determined by fitting a 2-dimensional quadratic to the cross-correlation function around the maximum. With the displacement estimate, a motion corrected frame is generated by linear interpolation, weighted by the freshness of each contributing observation. The motion corrected frame is then averaged into the template to dynamically update it as frames become aligned.
Source extraction¶
Source extraction was performed with a custom algorithm (SILo; AllenNeuralDynamics/GIAnT-MATLAB (2026)), implemented in MATLAB. This algorithm takes advantage of the fact that glutamate release events are spatiotemporally sparse. Specifically, we take inspiration from superresolution localization microscopy methods (Lelek et al., 2021; Chen et al., 2025) to precisely identify source locations despite the reduced effective resolution produced by the integration over pixels. We model a single event as having a spatiotemporal profile of a small Gaussian dot (standard deviation of 1.33 pixels) modulated over time by a decaying exponential of a time constant matched to the glutamate indicator (for iGluSnFR4f we use a decay constant of ms). We perform event detection by convolving this shape with the movie to identify local maxima in space and time (i.e., a 3D matched filter). These events are weighted by their intensity in the filtered movie and aggregated into a summary image, which we term the activity image. The activity image shows localized densities around active sources. We then identify the centroids of these densities by fitting each to a symmetric Gaussian to establish the location of each synapse. As a final step, we use the established source locations as the initialization for constrained non-negative matrix factorization to fine tune the spatial profiles and extract their corresponding time traces.
NWB data packaging¶
Eye tracking¶
At different points in each modality’s respective pipelines, eye tracking information is extracted from the raw behavior videos. A standardized capsule, aind-capsule-eye-tracking (https://
Synchronized Stimulus Table Generation - Ephys¶
The alignment of stimulus information to the electrophysiology recording is done using the legacy version of the aind-metadata-mapper (https://
Frame times are extracted from the sync file using two digital lines: the vsync line (stim_vsync), whose falling edges mark nominal monitor frame boundaries, and the photodiode line (stim_photodiode), which records the output of a photodiode affixed to the stimulus monitor that toggles state every 60 frames. Because the photodiode signal reflects actual light output, it captures true frame timing including irregular refresh intervals that the vsync signal does not. The alignment procedure detects all photodiode transitions, trims pulses outside the vsync range, corrects for missing or spurious edges, and then allocates individual frame timestamps within each 60-frame photodiode interval using a trimmed-mean estimate of frame duration. Clock counter rollovers are detected and corrected by adding 2^32 offsets where negative intervals appear. The result is a one-dimensional array of frame times in seconds on the sync clock, one entry per monitor frame, with sub-millisecond precision.
To map stimulus parameters onto these frame times, each stimulus block’s display sequence is converted from seconds to global frame indices using the monitor frame rate and pre-blank duration recorded in the pickle file. The stimulus-local sweep frame indices are then shifted into the global frame domain by apply_display_sequence(). Finally, convert_frames_to_seconds() indexes into the photodiode-corrected frame time array to assign each sweep a start time and stop time in sync-clock seconds. The output is a single stimulus table (saved as a CSV) in which each row corresponds to one stimulus sweep, with columns for start time, stop time, start frame, end frame, stimulus name, and all associated stimulus parameters. Gaps between stimulus blocks are filled with rows labeled as spontaneous activity.
Synchronized Stimulus Table Generation - Mesoscope¶
The mesoscope alignment uses the same, aind-metadata-mapper (https://
Rather than using the photodiode to reconstruct per-frame timing, the mesoscope pipeline takes the falling edges of the vsync line as the base frame times directly. The photodiode is instead used to measure the delay between when the computer issues a vsync signal and when the monitor actually displays the frame. This is done by extract_frame_times_with_delay(), which detects a characteristic three-pulse photodiode pattern marking stimulus onset and offset, then computes, for each photodiode transition in between, the difference between the photodiode rising edge and the nearest vsync falling edge. The median of these per-pulse delays — typically around 35.6 ms — is added uniformly to all vsync-derived frame times. If the measurement is unreliable (standard deviation exceeding 2 ms, or missing data), a hardcoded fallback delay of 0.0356 seconds is applied instead.
Once delay-corrected frame times are established, the mapping from stimulus sweeps to seconds proceeds identically to the ephys case: display sequences are converted to global frame indices, local sweep frames are remapped into the global domain, and frame indices are converted to seconds by lookup in the frame time array. The mesoscope pipeline produces two output tables. The primary table uses the delay-corrected frame times and is appropriate for analyses correlating neural calcium signals with stimulus events, since both the imaging and the stimulus share the same monitor display latency. The secondary table uses raw vsync times without the delay correction, which is useful for analyses tied to hardware trigger signals. Both tables have the same columnar structure: one row per sweep, with start time, stop time, frame indices, stimulus name, and stimulus parameters.
Mesoscope 2-Photon Imaging NWB Packaging Pipeline¶
All processed data were packaged into Neurodata Without Borders (NWB) format Rübel et al., 2022. NWB packaging was performed as an integrated step of the 2-Photon processing pipeline (mentioned above) which produced NWBs in the Zarr format containing the processed 2-Photon data.
A secondary pipeline, also run in nextflow DSL2 on the CodeOcean platform (https://
Converting the Pophys processing pipeline’s Zarr NWB to an h5py NWB using a capsule NWB-Zarr-HDMF-Conversion (https://
github .com /AllenNeuralDynamics /NWB -Zarr -HDMF -Conversion) Generating a synchronized stimulus table that is time-aligned to the recorded ophys timing. Described above under “Synchronized Stimulus Table Generation - Mesoscope” This is then split into several intervals tables based on the type of stimulus shown and packaged into a copy of the ophys NWB.
Processing the behavior videos of the eye into eye tracked output. Described above in “Eye Tracking”
Aligning the eye tracking output to the recorded synchronized timing and packaging it into a copy of the ophys NWB, using a capsule aind-eye-tracking-nwb (https://
github .com /AllenNeuralDynamics /aind -eye -tracking -nwb) Aligning the running speed traces to the recorded synchronized timing and packaging it into a copy of the ophys NWB, using a capsule aind-running-speed-nwb (https://
github .com /AllenNeuralDynamics /aind -running -speed -nwb) Generating a new data description.json that references the input data, and includes the name of the newly generated data. Aggregating processing.json output from the eye tracking processing and the stim table generation into a new processing.json. Copying the remaining inputted metadata jsons (including procedures.json, quality_control.json, rig.json, session.json, subject.json)
Finally, merging the resulting NWBs; the stimulus table NWB, the running speed NWB, and the eye tracking NWB, into one complete NWB using aind-nwb-utils (https://
github .com /AllenNeuralDynamics /aind -nwb -utils) The NWBs were then uploaded to their dandiset using the DANDI command line interface (https://
github .com /dandi /dandi -cli)
Neuropixels Ephys NWB Packaging Pipeline¶
The processed data were also packaged into an NWB file during their respective processing pipeline mentioned above. This pipeline included two capsules which were run in sequence, appending processed ecephys information to a base subject NWB. They were aind-ecephys-nwb (https://
A secondary pipeline, also run on the CodeOcean platform, took the output spike sorted NWB and the raw synchronization and behavior data to produce a complete NWB. This was done by appending data to the NWB in a sequence of processing capsules. This included;
Converting the Spike sorting processing pipeline’s Zarr NWB to an h5py NWB using a capsule NWB-Zarr-HDMF-Conversion (https://
github .com /AllenNeuralDynamics /NWB -Zarr -HDMF -Conversion) Using a synchronized stimulus table that is time-aligned to the recorded ecephys timing, this was generated prior to CodeOcean upload performed on Allen Institute rig computers. This process is described above under “Synchronized Stimulus Table Generation - Ephys” This table is then split into several intervals tables based on the type of stimulus shown and packaged into the NWB
Processing the behavior videos of the eye into eye tracked output. Described above in “Eye Tracking”.
Aligning the eye tracking output to the recorded synchronized timing and packaging it into the NWB, using a capsule called aind-eye-tracking-nwb (https://
github .com /AllenNeuralDynamics /aind -eye -tracking -nwb) Aligning the running speed traces to the recorded synchronized timing and packaging it into the NWB, using a capsule called aind-running-speed-nwb (https://
github .com /AllenNeuralDynamics /aind -running -speed -nwb) The NWBs were then uploaded to their dandiset using the DANDI command line interface (https://
github .com /dandi /dandi -cli)
Data records¶
Data tables¶
Animal and session coverage, recording context, and quality-control status are summarized in Figure 4.
Figure 4:Recording-session inventory and quality-control summary across modalities. The Interactive view provides searchable, filterable tables for 39 mice and 164 manuscript session records, with expandable animal metadata and CSV export. The Static view summarizes the complete worksheet inputs used by the supplied modality plots. A, Neuropixels uses 62 worksheet rows to populate four canonical context slots for each of 16 mice; red hatching denotes a missing or failed session, and a star denotes one failed probe. B, Mesoscope shows all 92 chronological worksheet rows from 10 mice; red hatching denotes a failed session. C, SLAP2 shows the 28 P3 worksheet rows from 8 mice; colored borders and hatching denote partially failed motion correction, stress, sleep, or an acquisition that stopped halfway. Across panels, indigo, teal, brown, and gold denote sensorimotor, standard oddball, sequence, and duration sessions, respectively. Mice are ordered by cohort; where both are present, whitespace separates the motor-first and sequence-first groups defined in Figure 1C. Repeated and aborted worksheet rows are retained in the Static view, so its rows do not map one-to-one to the 164-record Interactive inventory.
Table 1 - List of experimental animals per modality | |||||
|---|---|---|---|---|---|
| Recording modality | Rig(s) | Mouse line / preparation | Virus / indicator | Mice (M/F) | Mouse IDs |
| Two-photon mesoscope (calcium) | MESO1, MESO2 | Snap25-IRES2-Cre;Oi4(jGCaMP8s) | Transgenic pan-neuronal jGCaMP8s (calcium); no virus | 10 (8M / 2F) | 10 mouse IDs832700, 837568, 839909, 842971, 843000, 843001, 845342, 846289, 850399, 853137 |
| Neuropixels (electrophysiology) | NP1 | Sst-IRES-Cre;Ai32(ChR2-EYFP) | Transgenic ChR2-EYFP in SST+ interneurons for opto-tagging; no virus | 16 (8M / 8F) | 16 mouse IDs820454, 820459, 830794, 830795, 830846, 830847, 830848, 830849, 830851, 830852, 832691, 834686, 834687, 834691, 848387, 848390 |
| SLAP2 dendritic imaging (glutamate + calcium) | SLAP2 | C57BL/6J (wt) + AAV, sparse CaMKII-Cre | AAV: iGluSnFR4f (glutamate) + RCaMP3 or jRGECO1a (calcium) | 8 (6M / 2F) | 8 mouse IDs776270, 794237, 796630, 801381, 803496, 828408, 828409, 829704 |
| SLAP2 dendritic imaging (voltage) | SLAP2 | C57BL/6J (wt) + AAV, sparse CaMKII-Cre | AAV: ASAP7 (voltage) + HaloTag | 4 (4M / 0F) | 4 mouse IDs841191, 845207, 851452, 851453 |
Table 2 - List of sessions | ||||
|---|---|---|---|---|
| Recording modality | Context | N sessions | N mice | Session IDs |
| Two-photon mesoscope | Standard oddball | 18 | 7 | 18 sessions832700_2026-01-30, 832700_2026-01-31, 837568_2026-02-20, 837568_2026-02-23, 837568_2026-03-05, 837568_2026-03-06, 839909_2026-02-27, 839909_2026-03-05, 843000_2026-03-17, 843000_2026-03-18, 843001_2026-03-19, 843001_2026-03-21, 843001_2026-03-25, 843001_2026-04-11, 845342_2026-03-27, 845342_2026-03-30, 846289_2026-04-15, 846289_2026-04-16 |
| Two-photon mesoscope | Sensorimotor | 17 | 7 | 17 sessions832700_2026-01-24, 832700_2026-01-29, 837568_2026-02-24, 837568_2026-02-26, 837568_2026-03-09, 839909_2026-02-20, 839909_2026-02-26, 843000_2026-03-19, 843000_2026-03-20, 843001_2026-03-11, 843001_2026-03-12, 843001_2026-03-18, 843001_2026-04-16, 845342_2026-03-25, 845342_2026-03-26, 846289_2026-04-10, 846289_2026-04-13 |
| Two-photon mesoscope | Sequence | 16 | 8 | 16 sessions832700_2026-02-06, 832700_2026-02-07, 837568_2026-02-13, 837568_2026-02-16, 839909_2026-03-06, 839909_2026-03-19, 842971_2026-04-18, 842971_2026-04-22, 843000_2026-03-03, 843000_2026-03-04, 843001_2026-04-01, 843001_2026-04-02, 845342_2026-03-31, 845342_2026-04-01, 846289_2026-04-20, 846289_2026-04-21 |
| Two-photon mesoscope | Duration | 16 | 8 | 16 sessions832700_2026-02-12, 832700_2026-02-13, 837568_2026-02-17, 837568_2026-02-19, 839909_2026-03-20, 839909_2026-04-22, 842971_2026-04-23, 842971_2026-04-24, 843000_2026-03-10, 843000_2026-03-11, 843001_2026-04-03, 843001_2026-04-09, 845342_2026-04-02, 845342_2026-04-03, 846289_2026-04-23, 846289_2026-04-27 |
| Neuropixels | Standard oddball | 14 | 14 | 14 sessions820454_2025-11-05, 830794_2026-01-27, 830795_2026-02-24, 830846_2026-03-11, 830847_2026-03-11, 830848_2026-03-04, 830849_2026-03-06, 830851_2026-03-17, 830852_2026-02-24, 834686_2026-03-25, 834687_2026-03-18, 834691_2026-02-17, 848387_2026-05-05, 848390_2026-05-05 |
| Neuropixels | Sensorimotor | 16 | 16 | 16 sessions820454_2025-11-04, 820459_2025-11-10, 830794_2026-01-26, 830795_2026-02-23, 830846_2026-03-12, 830847_2026-03-12, 830848_2026-03-05, 830849_2026-03-07, 830851_2026-03-16, 830852_2026-02-23, 832691_2026-03-26, 834686_2026-03-26, 834687_2026-03-19, 834691_2026-02-16, 848387_2026-05-04, 848390_2026-05-04 |
| Neuropixels | Sequence | 15 | 15 | 15 sessions820454_2025-11-06, 820459_2025-11-12, 830794_2026-01-28, 830795_2026-02-25, 830846_2026-03-09, 830847_2026-03-09, 830848_2026-03-02, 830849_2026-03-04, 830851_2026-03-18, 830852_2026-02-25, 832691_2026-03-23, 834686_2026-03-23, 834687_2026-03-16, 848387_2026-05-06, 848390_2026-05-06 |
| Neuropixels | Duration | 14 | 14 | 14 sessions820454_2025-11-07, 830794_2026-01-29, 830795_2026-02-26, 830846_2026-03-10, 830847_2026-03-10, 830848_2026-03-03, 830849_2026-03-05, 830851_2026-03-19, 830852_2026-02-26, 832691_2026-03-24, 834686_2026-03-24, 834687_2026-03-17, 848387_2026-05-07, 848390_2026-05-07 |
| SLAP2 dendritic imaging (glutamate + calcium) | Standard oddball | 16 | 8 | 16 sessions776270_2025-07-02, 794237_2025-04-03, 794237_2025-04-24, 794237_2025-05-08, 796630_2025-08-25, 796630_2025-08-28, 796630_2025-09-26, 796630_2025-10-01, 801381_2025-05-29, 801381_2025-06-05, 801381_2025-09-26, 801381_2025-10-02, 803496_2025-07-02, 828408_2025-11-18, 828409_2025-11-19, 829704_2025-12-11 |
| SLAP2 dendritic imaging (glutamate + calcium) | Sensorimotor | 3 | 3 | 3 sessions828408_2025-11-13, 828409_2025-11-11, 829704_2025-12-10 |
| SLAP2 dendritic imaging (glutamate + calcium) | Sequence | 3 | 3 | 3 sessions828408_2025-11-19, 828409_2025-11-20, 829704_2025-12-16 |
| SLAP2 dendritic imaging (glutamate + calcium) | Duration | 3 | 3 | 3 sessions828408_2025-11-20, 828409_2025-11-21, 829704_2025-12-18 |
| SLAP2 dendritic imaging (voltage) | Other/pilot | 13 | 4 | 13 sessions841191_2026-05-07, 841191_2026-05-08, 841191_2026-05-12, 841191_2026-05-13, 845207_2026-02-27, 845207_2026-04-06, 845207_2026-04-09, 845207_2026-05-08, 845207_2026-05-13, 851452_2026-05-05, 851453_2026-06-04, 851453_2026-06-10, 851453_2026-06-11 |
NWB file contents¶
All data from this project are packaged as Neurodata Without Borders (NWB) files and deposited on the DANDI Archive. Neuropixels electrophysiology sessions are available at DANDI:001637, and mesoscope two-photon imaging sessions at DANDI:001768. Use the tabs below as a map from a scientific question to the corresponding NWB object and PyNWB entry point. Object names can differ slightly among sessions; the paths shown here reflect representative files in these Dandisets.
Shared across modalities: session context, behavior, and stimulus timing use the same acquisition clock, making these objects the starting point for aligned analyses.
| Question | NWB contents | Representative PyNWB entry point |
|---|---|---|
| When and from which animal was the session recorded? | Root session metadata and /general/subject contain the session ID and datetime, institution, subject ID, species, age, sex, and genotype. | nwbfile.session_id, nwbfile.session_start_time, nwbfile.subject |
| What stimulus was shown at each time? | /intervals/*_presentations contains one TimeIntervals table per block. Rows include start_time, stop_time, and stimulus parameters such as orientation, spatial and temporal frequency, contrast, position, phase, and trial type. | nwbfile.intervals[table_name].to_dataframe() |
| When was no stimulus presented? | /intervals/spontaneous_presentations marks gaps between stimulus blocks. | nwbfile.intervals["spontaneous_presentations"] |
| Was the animal moving? | /processing/running contains synchronized wheel rotation and computed running speed. | nwbfile.processing["running"]["running_speed"] |
| Was the animal looking at the display? | When available, /processing/eye_tracking contains pupil, corneal-reflection, and eye ellipse fits plus likely-blink intervals. | nwbfile.processing["eye_tracking"] |
Neuropixels NWB files (DANDI:001637): connect spike-sorted units to their probes, anatomical positions, quality metrics, and local field potentials.
| Question | NWB contents | Representative PyNWB entry point |
|---|---|---|
| Which units were isolated, and do they pass quality control? | /units contains firing rate, ISI violations, presence ratio, amplitude cutoff, SNR, d-prime, isolation distance, silhouette score, sliding refractory-period violations, and a default QC flag. | nwbfile.units.to_dataframe() |
| When did a unit spike, and what was its waveform? | Ragged spike_times plus mean and standard-deviation waveforms are columns of /units. | nwbfile.units["spike_times"][unit_row] |
| Where was each unit recorded? | Unit rows identify the probe and electrode and include estimated 3D coordinates. /general/extracellular_ephys/electrodes describes every channel, probe group, and shank-relative position. | nwbfile.electrodes.to_dataframe() |
| Which probes were used? | /general/devices registers up to six Neuropixels probes and their serial numbers. | nwbfile.devices |
| What was the local population signal? | /processing/ecephys/LFP contains downsampled local field potential per probe (96 channels at approximately 2,500 Hz). | nwbfile.processing["ecephys"]["LFP"] |
Mesoscope NWB files (DANDI:001768): organize optical physiology by imaging plane so ROIs, traces, events, and summary images remain connected.
| Question | NWB contents | Representative PyNWB entry point |
|---|---|---|
| Where and how was each plane imaged? | /general/optophysiology describes eight simultaneous VISp and VISl planes, including excitation wavelength, imaging rate, grid spacing, indicator, cortical location, and field-of-view origin. The mesoscope is registered under /general/devices. | nwbfile.imaging_planes, nwbfile.devices |
| Which pixels belong to each ROI? | /processing/<plane>/image_segmentation contains 512 × 512 px ROI masks with dendrite probability scores. | nwbfile.processing[plane]["image_segmentation"] |
| How does fluorescence change over time? | Each plane contains raw, neuropil, neuropil-corrected, and ΔF/F time series. | nwbfile.processing[plane]["dff_timeseries"] |
| Where are inferred neural events? | Each plane’s event_timeseries stores deconvolved event traces. | nwbfile.processing[plane]["event_timeseries"] |
| What does the field of view look like? | Each plane’s images interface contains average projection, maximum projection, and segmentation-mask summary images. | nwbfile.processing[plane]["images"] |
NWB files can be streamed directly from DANDI without downloading the complete asset; see the data access code example below. The OpenScope Databook provides companion analysis notebooks for selecting sessions and working with the electrophysiology, imaging, and behavioral objects introduced here.
Data validation¶
Raw data across recording modalities¶
Representative native acquisition formats and source-backed excerpts are shown in Figure 5.
Figure 5:Representative raw-data excerpts from one public session per recording modality,
shown to introduce the native acquisition formats. The Interactive view
supports source selection, contrast adjustment, and microscopy playback. The
microscopy contrast control applies black-referenced display gain. The
Static view arranges all available recordings as overlapping raw-image cards
without playback controls:
A, all six Neuropixels probe heatmaps stacked with CCF anatomy; B, all
eight mesoscope plane stills in two four-card stacks spanning VISp and VISl; and
C, two merged SLAP2 plane previews spanning two VISp depths (one per DMD),
with iGluSnFR4f shown in green and RCaMP3 in red.
Covered cards retain exposed labels and raw-image strips to convey the complete
acquisition scale. Static mesoscope stills are independently stretched to their
1st–99.5th max-channel percentiles. Each SLAP2 preview merges the two channels,
independently scaled to their 1st–99.5th sampled-pixel percentiles, from a
single aligned source frame without temporal averaging, then applies a
hue-preserving gamma of 0.55 for display. Neuropixels views contain
100 ms of calibrated, unaveraged 30-kHz voltage from 96 regularly spaced
contacts in the raw AP acquisition stream supplied to spike sorting; the
adjacent CCF column and horizontal boundaries identify each contact’s annotated
structure or cortical layer. The displayed AP samples are not median-corrected,
so common-mode fluctuations across contacts remain visible as vertical stripes.
Mesoscope views are unprocessed 512 × 512 ScanImage channel frames. SLAP2 views
map native sparse detector samples onto acquisition-plan superpixels, reduce the
1280 × 800 acquisition-coordinate raster by 2×, and encode the resulting
640 × 400 lossless WebP frames. A dim structural reference is used only outside
sampled dendritic pixels. Microscopy
playback uses elapsed time within each four-second excerpt. Selectors report CCF
structures and layers for each probe; area, layer, and depth for each mesoscope
plane; and indicator plus remote-focus depth below pia (91 µm for DMD1 and
123.75 µm for DMD2) for each SLAP2 field. Microscopy intensity is pseudocolored
and contrast-scaled independently for display. Source sessions are Neuropixels
ecephys
Units extraction¶
Figure 6:Draft plan for unit extraction and signal-to-noise analysis across recording modalities.
Neuropixels recordings¶
signal-to-noise
Stability across one session
Quality control
To support repeated targeting while avoiding blood vessels, each probe’s entry point was shifted slightly from its position on the previous day. Across 60 unit-bearing sessions from 16 mice, mean QC-passing unit yield per recorded probe declined from 100% of the day-1 baseline to 80.9% on day 4 (Supplementary Figure 2).
Mesoscope two photon imaging¶
GROUP 1
Motion correction across planes in one session and many sessions.
GROUP 2
ROI extraction quality
DFF signal quality (stability of baseline, calcium kernel)
GROUP 2.2
Event extraction quality (firing rate, the SNR of events, calcium kernel …)
GROUP3
Cell matching across sessions 2P,Cell stability across sessions.
TOOLS ACROSS
SLAP imaging¶
signal-to-noise
Quality control
Bleaching
Receptive field analysis across modalities¶
Figure 7:Draft plan for basic stimulus characterization across recording modalities.
Behavioral data analysis across modalities¶
For sessions with camera acquisition, the release includes continuous raw behavioral videos together with synchronized running-wheel signals, processed eye-tracking outputs, and stimulus-presentation intervals. Depending on the recording platform, the available views include body or behavior, face, eye, and nose cameras. The synchronized multimodal examples in Figure 8 show these streams alongside the wheel signal and current stimulus state. Existing NWB products provide wheel rotation and running speed, plus pupil, corneal-reflection, and eye-ellipse fits with likely-blink flags. The underlying videos remain available so investigators can derive additional behavioral measurements while preserving alignment to the stimulus and neural or imaging data.
These synchronized videos are therefore open to more sophisticated reanalysis, including markerless pose and keypoint tracking with DeepLabCut, SLEAP, Lightning Pose, or other computer-vision methods. Potential derived features include facial and body motion energy, posture, grooming, locomotor state, pupil dynamics, and trial-resolved behavioral responses. Camera frames are tied to the acquisition clock through 100-kHz exposure or readout edges for Neuropixels and mesoscope sessions and per-frame Harp timestamps for SLAP2, allowing newly derived features to be registered to wheel, stimulus, electrophysiology, and imaging signals.
Figure 8:Synchronized behavior and running across recording modalities. A–C, Camera
views and complete-session running profiles from representative Neuropixels
(A), mesoscope (B), and SLAP2 (C) sessions. Each row pairs all
available camera views with the running profile from the same mouse and source
session. Neuropixels and mesoscope stills retain the common 8-second synchronized
excerpt selection; the SLAP2 stills are sampled at 600 seconds from the
full-session profile source. Five-second profile means share one time axis and
are shown over measured standard, context, standard-repeat, sequence, jitter,
open-loop, natural-movie, and receptive-field block boundaries using the Figure
2 block colors. D, Mean forward running speed in each protocol block for
Neuropixels, mesoscope, and SLAP2, compared on one shared cm/s axis. Each point is
one mouse after averaging its available complete sessions, and each bar is the
mean across mice for its modality; legend values report included mice. The
Interactive view provides synchronized camera playback, running signals,
and reconstructed stimulus state for the selected modality. Metrics use
50 ms bins, and negative velocity is set to zero before summarization. SLAP2 encoder values
are converted to cm/s using the pinned
acquisition convention of 8192 counts/revolution, an 8.255 cm disc radius, and a
2/3 effective running radius. Each static camera image is
independently illuminated using its 1st–99th luminance percentiles and a bounded
gamma that maps median luminance to 35%, with exact parameters retained in
provenance. Behavior-camera video is
range-streamed from the public
aind-open-data S3 bucket. For Neuropixels and mesoscope sessions, NWB running
speed and stimulus rows share the sync-file clock with 100-kHz camera
exposure/readout edges; reported dropped frames are removed before mapping
hardware frame indices to MP4 presentation time. SLAP2 camera frames use
per-frame Harp timestamps on the acquisition clock. Camera and source selectors
expose the underlying public data without bundling multi-gigabyte videos into
the publication.
Stimulus-evoked responses: oddball across modalities¶
Stability across the session for all modalities ?
Orientation tuning plots?
Figure 9:Placeholder for standard oddball responses across recording modalities.
Usage Notes¶
Data access code example¶
The following Python example streams an HDF5 NWB file directly from DANDI using
HTTP range requests, without first downloading the complete file. Install the
required packages with python -m pip install dandi h5py pynwb remfile. Set
DANDISET_ID to 001637 for Neuropixels data or 001768 for mesoscope data;
for reproducible analyses, replace draft and the automatically selected asset
with a published version and explicit asset path.
import h5py
import remfile
from dandi.dandiapi import DandiAPIClient
from pynwb import NWBHDF5IO
DANDISET_ID = "001637" # Use "001768" for mesoscope data.
DANDISET_VERSION = "draft"
with DandiAPIClient() as client:
dandiset = client.get_dandiset(DANDISET_ID, version_id=DANDISET_VERSION)
asset = next(
asset for asset in dandiset.get_assets() if asset.path.endswith(".nwb")
)
download_url = asset.get_content_url(follow_redirects=1, strip_query=True)
remote_file = remfile.File(download_url)
h5_file = h5py.File(remote_file, mode="r")
with NWBHDF5IO(file=h5_file, mode="r", load_namespaces=True) as io:
nwbfile = io.read()
table_name = next(iter(nwbfile.intervals))
intervals = nwbfile.intervals[table_name].to_dataframe()
print(f"Streaming: {asset.path}")
print(f"Session: {nwbfile.session_id}")
print(f"Intervals table: {table_name}")
print(intervals.head())
remote_file.close()The OpenScope Databook provides additional notebooks for downloading files, selecting sessions, and working with electrophysiology, imaging, and behavioral data.
Limitations¶
Data analysis plan¶
Our review Aizenbud et al., 2026 highlighted the presence of mismatch responses throughout the cortical network, spanning multiple areas and cellular populations, including excitatory neurons and inhibitory subtypes. These responses involve dynamic contributions from both dendritic and somatic compartments. Consequently, our analysis must disentangle these relative contributions within a tightly integrated network, across multiple types of mismatches.
A key assumption in our analysis is that different types of mismatches may recruit distinct relative contributions from computational primitives. To test this assumption, we must measure the precise dynamic properties of individual compartments across neuronal types, areas and layers. Our goal is to compare the relative timing and strength of predictive responses, complemented by decoding analyses to extract instantaneous prediction strengths emerging across the network. Neuropixels recordings will enable decoding with millisecond precision, such that the first occurrences of mismatch encoding across circuit components (brain regions, cortical layers, neuronal subtypes, and neuronal compartments) can be identified, while imaging experiments will provide denser recordings to measure the broader impact of these predictions on the overall network.
Modeling these responses will be a key integrative effort, facilitating the unification of multi-modal and multi-species datasets. First, analytical metrics derived from real physiological data can be designed and iteratively refined using simulated neuronal activity from cortical models, where the ground truth is known. Second, modeling will enable the multi-modal integration of these datasets by leveraging the relative strengths of various techniques to constrain model parameters. Simulated models will vary in complexity to evaluate our ability to disentangle mechanisms such as adaptation, E/I balance, and other underlying processes.
The analysis can be organized to address three main scientific hypotheses: I) whether mismatch responses are “additive”, “subtractive”, or “multiplicative” in nature; II) whether mismatch responses contain detailed, temporally specific predictions or expectations about the stimulus ensemble; III) whether there exists a common neural mechanism underlying different kinds of mismatch responses. Here, we provide further details about the data analysis and hypothesis testing that this experiment makes possible.
Throughout all hypotheses, we will leverage a shared set of metrics computed on all datasets. Encoding metrics should include measures used to evaluate deterministic models, like linear and logistic regressions, such as accuracy, mean square error, and the coefficient of determination R2, or for probabilistic models such as generalized linear models (GLMs). Decoding metrics should include measures from pattern clustering and/or classification, for e.g., Mahalanobis distance, confusion matrix (categorical variables) or F1 score, mutual information, or bit rate/latency (for BCIs). In addition, analysis of response distribution across anatomical location and cell types will be used to test all hypotheses.
I. What kind of information is encoded by mismatch responses?¶
A. Multiplicative novelty: Stimulus-specific enhancement for novel / unpredicted stimuli
B. Additive novelty: A generalized “alert” signal that encodes novelty per se
C. Subtractive novelty: The difference between the expected vs. actual stimulus
D. No effect: In particular, this empirical outcome could constitute a form of rejection of the hypothesis that predictive computation was involved in the experimental conditions tested
Analysis #1: For each neuron and each mismatch stimulus, construct either the event-triggered average (ETA; for Ca++ imaging data) or peri-stimulus time histogram (PSTH; for Neuropixel data):¶
Significant mismatch responses will be determined in each neuron by comparing activity evoked by a given mismatch stimulus to that same stimulus when it appears during the appropriate control setting. For session 1, this will be a comparison to the spaced randomized control. For session 2, this will be a comparison to the open loop pre-recorded sequence. For session 3, this will be a comparison to the contiguous randomized sequence control. For session 4, this will be the response to a time interval presented as an oddball to the same time interval in random order.
The significance of mismatch responses will be rigorously tested using bootstrap resampling, to avoid making the assumption of normal statistics for each neuron (which is often a poor assumption). Neurons with p < 0.01 will be considered “mismatch” neurons.
Assuming that mismatches occur at random times on an interval [ITImin, ITImax], then the ETA from t = –ITImin to t = 0 serves as a baseline response.
Absolute response measure: integrated neural activity over a time window shifted by a standard latency (~50-100 ms).
Relative response measure: integrated neural activity minus baseline activity (use a longer time window for baseline for better SNR, but then scale the integral to compare to the activity at t > 0).
Analysis #2: Compare the mismatch response in the novel vs. control conditions:¶
A. Make a scatter plot of responses in the two conditions and carry out a linear fit. Here are possible interpretations of this analysis, keeping in mind that the data may exhibit combinations of these outcomes:
multiplicative novelty coding = slope of linear fit > 1
additive novelty coding = offset of linear fit > 0
subtractive novelty coding = slope of linear fit is not statistically different from zero (or extensive deviation for a subset of neurons)
no effect = neurons on the identity line
Analysis #3: Compare responses to different mismatch stimuli in the novel condition (for Sessions 1 and 2):¶
Calculate the relative response to the four different mismatch stimuli
If neurons encode subtractive novelty, then the following will be true:
R(downward, 90° shift) > R(45° shift), because this is a bigger change in orientation
R(halt) < R(90°) and R(45°), because the halt involves a smaller change in velocity
Other possibilities: i) make some index that captures this relationship for individual neurons, ii) calculate the fraction of neurons fulfilling these conditions and compare them to a shuffle test, iii) assess the effects of depth and subregion on fraction of neurons showing mismatch responses, and compare between types (different sessions).
Analysis #4: Calculate decoding performance / information encoded for mismatch stimuli and novelty per se:¶
What fraction of neurons encode significant info about novelty per se?
a large fraction indicates a major, distributed encoding of novelty per se
What fraction of neurons encode significant info about individual mismatch stimuli?
a large fraction indicates a major, distributed encoding of the identity of novel stimuli
Calculate decoding performance vs. N neurons, extrapolate to large N:
extrapolation → ~1 indicates strong encoding (expected for individual stimuli, but unclear for novelty per se)
Compare decoding performance of novelty per se vs. performance for individual stimuli:
similar performance indicates a strong encoding of novelty per se
lower performance for novelty indicates a weak or secondary encoding of novelty
Scatter plot of info encoded for novelty vs. individual stimuli:
high correlation indicates a joint encoding of novelty and stimulus identity
low correlation indicates a separate encoding of novelty and stimulus identity.
II. Distinguish between two categories of prediction made by neurons:¶
A. Detailed predictions about the identity of the upcoming stimulus
B. Deviation of stimulus probability from the expected stimulus ensemble, often described in the literature as “adaptation”. This empirical outcome could be interpreted as a form of refutation of the hypothesis that predictive computation was involved in the experimental conditions tested.
Analysis #1: Compare the response to the same mismatch stimulus in all three conditions for the sensorimotor mismatch (session 2):¶
Is the mismatch response > for closed loop vs. open loop
YES indicates that the neuron encodes a detailed prediction (as only the closed loop condition allows a detailed prediction)
Is the mismatch response > control vs. open loop
YES indicates that the neuron encodes deviation from the expected ensemble (as a blank is differs more from the mismatch grating than the vertically oriented grating present in the closed loop condition)
Analysis #2: Calculate decoding performance / info encoded for individual mismatch stimuli vs. for novelty per se.¶
Use population decoder to identify the occurrence of an individual mismatch stimulus (target) versus all the other neural activity; start with a linear decoder (support vector machine):
this quantifies the fidelity for encoding the identity of each of 4 mismatch stimuli
In a complementary fashion, calculate the mutual information each neuron represents about an individual mismatch stimulus versus all other neural activity
Similarly, calculate decoding performance and information for a comparison of neural activity during any mismatch stimulus vs all other neural activity;
this quantifies the fidelity for encoding stimulus novelty per se
If significantly more information is encoded in the closed loop condition vs. open loop
YES indicates encodes of a detailed prediction
If significantly more information is encoded in the control condition vs. open loop
YES indicates encoding of a deviation from the expected ensemble
Analysis #3: Emergence of Prediction Signals in Single Neurons and Neural Populations¶
When new, arbitrary correlations are created by the experimenter, the brain must, in principle, learn these new correlations. This can be demonstrated by showing several kinds of changes in neural responses to the same stimuli over time. These changes may occur within a single recording session, which is often interpreted as a form of adaptation, or across recording sessions, which is typically interpreted as learning.
Key Hypothesis Tests:
Predictive coding vs. static tuning: Do individual neurons or neural populations show changes in their response to the same oddball stimuli?
YES indicates evidence of predictive computation
NO indicates evidence of static or previously learned tuning to stimuli
“Predictive” Activity: Do neurons or populations of neurons exhibit activity that systematically depends on what the upcoming stimulus is (as can be demonstrated by changing stimulus contingencies)?
YES suggests that the neural activity was in part encoding the identity of the upcoming stimulus
NO indicates that the neural activity encodes the identity of the current stimulus
“Pattern completion” activity: Do neurons or populations of neurons exhibit activity during stimulus omission that depends systematically on the preceding stimulus?
YES indicates a form of predictive computation, in which predictions are embodied, in part, by specific neural activity driven by events that predict an upcoming stimulus (rather than by the stimulus itself)
NO indicates that a response to the omission itself
Latent component dynamics: Do identified latent variables exhibit systematic changes over trials?
YES indicates evidence of predictive computation revealed only at the population level
Neural dimensionality reduction: Does the manifold structure of mismatch responses shift toward a more compact, lower-dimensional space with repeated exposure?
YES indicates a structure of predictive computation that is consistent with theories about efficient coding and/or maximization of coding capacity
Conjunctive vs. disentangled representation: Does the visualized geometric structure of population activity embedded in a 3D space; e.g., using unsupervised UMAP (Uniform Manifold Approximation and Projection), show distinct, possibly orthogonal, trajectories that could reveal disentangled coding schemes for different signals (e.g., for stimulus evoked responses vs. prediction errors)?
YES indicates that the population neural code can simultaneously represent information about the stimulus as well as its predictive context
Single Neuron Analysis: Determine whether individual neurons exhibit changes in their responses with repeated oddball presentations, indicative of learning.
Trial-by-Trial Response Analysis: Measure the amplitude and timing of neuronal responses to each oddball stimulus across trials.
Model Fitting: Apply exponential or linear decay models to these responses to measure trends over time.
Statistical Validation: Use bootstrap resampling to evaluate the significance of observed changes.
Time Points for Analysis: Pre-Oddball Baseline Period: A period before the oddball onset (e.g., -200 ms to stimulus onset at 0 ms) to establish baseline activity levels. Oddball Response Window: A post stimulus onset interval (e.g., 0 to 300 ms) capturing the immediate neuronal response to the oddball stimulus.
Population Latent Analysis: Identify latent patterns within neural populations that correspond to predictions and prediction error signals.
Tensor Component Analysis (TCA): Decompose multi-dimensional neural data to uncover components with trial-dependent dynamics.
Time Points for Analysis: Pre-Oddball Baseline: A period before oddball onset (e.g., -200 ms to stimulus onset at 0 ms) to establish baseline population activity levels. Oddball Response Window: The duration of the oddball stimulus presentation (e.g., 0 to 300 ms) capturing immediate population responses to the oddball stimulus. Post-Oddball Period: A post stimulus offset interval (e.g., 300 ms to 600 ms) to monitor any sustained or delayed responses. Inter-Trial Intervals: Periods between oddball trials to evaluate baseline stability and potential anticipatory activity.
Cross-Day Analysis: Monitor the activity of individual neurons or neural populations over time to identify changes in prediction error signaling and learning processes.
III. Mismatch responses across different types of predictions¶
These experiments test mismatch responses resulting from different kinds of predictions: i) repetition vs. oddball (session 1), sensorimotor mismatch (session 2), and temporal sequence prediction (session 3 and 4). Are there different circuit mechanisms for these four kinds of prediction?
In particular, sensorimotor prediction requires a corollary discharge of the motor command, so it requires feedback from outside V1. While there is evidence for feedback from higher-level cortex for oddball responses, reduced oddball responses seem to remain after blocking this feedback. Temporal sequence prediction could, in principle, be carried out by recurrent neural circuits within V1, but it is likely that feedback from higher cortex could enhance or extend these predictions.
Importantly, if the outlined paradigms show the same essential distribution of feature-based mismatch responses across areas and layers, then this would argue against the hypothesis for distinct mechanisms.
Analysis #1: Map the locations of neurons showing significant mismatch responses using two-photon imaging and neuropixels recordings.¶
For spatial analyses, we will focus on the firing rate (using a deconvolution approach for Ca++ imaging) averaged over all timepoints (e.g., 0 to 275 ms) for each trial. For each cohort, we will map the density of mismatch neurons as a function of region, layer, and cell-type. We will compare the percentage of mismatch responses (over all responsive neurons; each mouse as one observation) using a mixed ANOVA with paradigm (paradigm 1, 2, or 3) as a between subjects variable and region and layer as within subjects variables. Sex and mouse age will be covariates. We will carry out a separate analysis for each method (two-photon vs neuropixel) and cell-type (two-photon imaging of PYRs and interneurons subtypes).
Using PSTHs, compute the variability (standard deviation) of spike times relative to stimulus onset, as well as peak latency; compare to different models and across experimental conditions.
Use dimensionality reduction techniques (principal components analysis (PCA), t-distributed stochastic neighbor embedding (t-SNE), UMAP, etc.) to visualize population activity across units and identify functional clusters.
Characterize how different coding subspaces are oriented relative to each other in neural state space by computing the joint angles Rule et al., 2020.
Another approach would be to examine how much the coding direction of one variable aligns with the direction of another variable.
Analysis #2: Compare responses for the *same* neurons between sensorimotor (session 2) and temporal sequence (session 3) mismatches.¶
Is the mismatch response stronger for sensorimotor than temporal sequence prediction?
YES suggests different neural circuits for these two kinds of prediction
NO suggests common circuitry may explain data
Make a scatter plot of mismatch response in sensorimotor vs. temporal sequence prediction
data scattering all over the plane suggests different neural circuits for these two kinds of prediction
data falling near a line suggests that additional circuitry for sensorimotor prediction “feeds into” common circuits
Are there more examples of ‘pure mismatch responses’ (i.e. no baseline activity) in sensorimotor prediction vs. others
YES suggests different neural circuits for these different kinds of prediction
Analysis #3: Compare responses for the *same* neurons between the oddball (session 1) and sequence (session 3) mismatches.¶
For comparing magnitudes of mismatch responses, the average firing rate for each neuron showing a significant mismatch response will be averaged over trials, and then layers and regions. We will compare these values using a mixed ANOVA with paradigm (session 1, 2, 3 or 4) as a between-subjects variable and region and layer as within-subjects variables.
Is the mismatch response stronger for repetition than temporal sequence prediction?
YES suggests different neural circuits for these two kinds of prediction
NO suggests common circuitry may explain data
Make a scatter plot of mismatch response in oddball vs. temporal sequence prediction
data scattering all over the plane suggests different neural circuits for these two kinds of prediction
data falling near a line suggests that additional circuitry for oddball prediction “feeds into” common circuits
Analysis #4: Analysis of recording from inhibitory interneurons.¶
Are inhibitory neurons more strongly activated in session 2?
YES suggests that there is feedback from higher cortical areas
Is inhibitory activity stronger in closed loop vs. open loop (session 2)?
YES inhibitory activity may reflect a sensory prediction
Similar analyses for sessions 1 and 3
Analysis #5: Temporal Mismatch Analysis (session 4).¶
Test whether baseline activity and/or visual evoked responses under control conditions are different than for temporally deviant visual stimuli
YES indicates neurons encode specific temporal predictions about the time of occurrence of stimuli
Assess how distinct classes of interneurons contribute to predictive timing by examining their responses to temporally based mismatches when the stimulus duration deviates from the control condition
Analysis #6: Test various prediction models across session types.¶
Quantify learning effects as a function of region and layer. Measure the response amplitude before and after repeated presentations of the same stimulus within a recording session.
Analyze changes in neural responses within a recording session (e.g., occurring over periods of seconds to minutes) to detect patterns likely to reflect short-term memory processes. Compute autocorrelations and cross-correlations across spike trains.
Train deep learning models using self-supervised learning (e.g., to predict future activity from past activity) to extract latent feature representations of the neural data. Analyze the accuracy of stimulus decoders trained on the representations extracted from different areas and using different temporal windows.
Analyze changes in neural activity patterns across learning days to detect patterns likely to reflect longer-term experience-dependent plasticity processes.
Use information theory criteria and cross-validation techniques to compare the goodness-of-fit of different models. Validate models using separate test datasets, including ones obtained from different laboratories.
Conclusion¶
Supplementary figures¶

Supplementary Figure 1. Neuropixels implant geometry and planned probe trajectories. A, Six trajectories (A-F) through the Allen Mouse Brain Common Coordinate Framework. B, Atlas structures intersected by each trajectory. C, Anteroposterior and mediolateral coordinates relative to bregma with implant-hole diameters D1 and D2. D, Top view of the implant with labeled probe-access holes.
Supplementary Figure 2. Neuropixels unit yield across recording days. Individual lines show 60 sessions from 16 mice; the bold line shows the daily mean, and n is the number of sessions represented on each day. Units passed all three quality-control thresholds (ISI-violations ratio < 0.5, presence ratio > 0.8, and amplitude cutoff < 0.1). QC-passing units were divided by the number of recorded probes and normalized to each mouse’s day-1 value. Mean yield declined from 100% on day 1 to 80.9% on day 4. Values were derived from the public draft of Dandiset 001637 retrieved July 30, 2026.
Supplementary Figure 3. Recorded Neuropixels trajectories in the Allen Mouse Brain Common Coordinate Framework (CCF) 2017. The Interactive view renders all CCF-localized insertions within a semi-transparent whole-brain surface and supports mouse, probe-port, camera-orientation, and brain-opacity controls. Selecting a trajectory shows its session, localized shank length, source NWB, and contiguous CCF area profile from the dorsal shank end to the tip. Line color denotes the nominal probe port (A-F). In the Static view, A, an oblique projection shows the trajectories across the depth-shaded Allen CCF whole-brain surface; B, a dorsal projection shows their anteroposterior and mediolateral distribution. Both panels use a semi-transparent brain surface, anatomical direction markers, and calibrated 2 mm scale bars. Electrode coordinates and area annotations come from the public draft of Dandiset 001637; the brain surface is a 100-micrometer mesh derived from the Allen CCF 2017 25-micrometer annotation volume. In total, 332 probe trajectories from 57 sessions and 16 mice had finite CCF coordinates. Three of the 60 source sessions are excluded because their NWB electrode tables lack x, y, and z coordinates.
Supplementary Text 1: Published oddball paradigms and sampling ranges¶
Supplementary Table 1 compares five published visual oddball paradigms with respect to stimulus design, timing, sample size, recording method, statistical test, habituation, and sampling.
Supplementary Table 1. Compare one paradigm parameter across all studies or inspect the complete profile of one study. Search filters the visible records in either view, and CSV export contains exactly the displayed subset.
The paradigms span visuomotor decoupling and local or global deviations in visual sequences. Three studies used two-photon calcium imaging, one used local field potentials, and one used Neuropixels recordings.
Reported oddball probabilities ranged from 0.07 to 0.20, the reported number of oddball repeats required ranged from 10 to 144, and session durations ranged from 6 minutes to 2 hours. This comparison informed the mismatch repeat count and session duration used in the present dataset; differences in stimuli, response definitions, and significance tests should be considered when comparing responsive-neuron fractions across studies.
Glossary¶
Terms and abbreviations
Abbreviations indicate the relevant modality:
meso = mesoscopic 2-photon Ca2+-imaging
ephys = electro-physiology (neurophysiology) using Neuropixels probes
ophys = optical-physiology using any in vivo fluorescence imaging technique
slap2 = SLAP2 glutamate vesicle imaging
ROI (slap2): Region of interest: a localized candidate location of a synaptic spine.
(Single) Unit (ephys): A candidate for an isolated single neuron.
Receptive Field (meso/ephys/slap2): A region of sensory (here: visual) space where an isolated stimulus evokes a neuronal response (either increases or decreases neuronal activity).
Orientation Tuning (meso/ephys/slap2): The selective response of visual neurons to edges or bars at particular angles.
NWB: Neurodata Without Borders. Standardized file format specification that stores neuronal physiology data. Used to store data for all modalities in this work.
DANDI: The DANDI Archive (Distributed Archives for Neurophysiology Data Integration) is a public repository supported by the US BRAIN Initiative. It allows scientists to store, publish, and access cellular neurophysiology data, such as electrophysiology, optical physiology, and behavioral time-series.
- Aizenbud, I., Audette, N., Auksztulewicz, R., Basiński, K., Bastos, A. M., Berry, M., Canales-Johnson, A., Choi, H., Clopath, C., Cohen, U., Costa, R. P., De Filippo, R., Doronin, R., Durand, S., Errington, S. P., Gavornik, J. P., Gillon, C. J., Granier, A., Hamm, J. P., … Xiong, Y. S. (2026). Neural mechanisms of predictive processing: A collaborative community experiment through the OpenScope program. https://arxiv.org/abs/2504.09614v2
- Skriabine, S., Shinn, M., Picard, S., Harris, K. D., & Carandini, M. (2026). Mapping the visual cortex with Zebra noise and wavelets. Journal of Vision, 26(1), 1. 10.1167/jov.26.1.1
- de Vries, S. E. J., Lecoq, J. A., Buice, M. A., Groblewski, P. A., Ocker, G. K., Oliver, M., Feng, D., Cain, N., Ledochowitsch, P., Millman, D., Roll, K., Garrett, M., Keenan, T., Kuan, L., Mihalas, S., Olsen, S., Thompson, C., Wakeman, W., Waters, J., … Koch, C. (2020). A large-scale standardized physiological survey reveals functional organization of the mouse visual cortex. Nature Neuroscience, 23(1), 138–151. 10.1038/s41593-019-0550-9
- Groblewski, P. A., Sullivan, D., Lecoq, J., de Vries, S. E. J., Caldejon, S., L’Heureux, Q., Keenan, T., Roll, K., Slaughterback, C., Williford, A., & Farrell, C. (2020). A standardized head-fixation system for performing large-scale, in vivo physiological recordings in mice. Journal of Neuroscience Methods, 346, 108922. 10.1016/j.jneumeth.2020.108922
- Durand, S., Heller, G. R., Ramirez, T. K., Luviano, J. A., Williford, A., Sullivan, D. T., Cahoon, A. J., Farrell, C., Groblewski, P. A., Bennett, C., Siegle, J. H., & Olsen, S. R. (2023). Acute head-fixed recordings in awake mice with multiple Neuropixels probes. Nature Protocols, 18(2), 424–457. 10.1038/s41596-022-00768-6
- Bennett, C., Ouellette, B., Ramirez, T. K., Cahoon, A., Cabasco, H., Browning, Y., Lakunina, A., Lynch, G. F., McBride, E. G., Belski, H., Gillis, R., Grasso, C., Howard, R., Johnson, T., Loeffler, H., Smith, H., Sullivan, D., Williford, A., Caldejon, S., … Olsen, S. R. (2024). SHIELD: Skull-shaped hemispheric implants enabling large-scale electrophysiology datasets in the mouse brain. Neuron, 112(17), 2869-2885.e8. 10.1016/j.neuron.2024.06.015
- Siegle, J. H., Jia, X., Durand, S., Gale, S., Bennett, C., Graddis, N., Heller, G., Ramirez, T. K., Choi, H., Luviano, J. A., Groblewski, P. A., Ahmed, R., Arkhipov, A., Bernard, A., Billeh, Y. N., Brown, D., Buice, M. A., Cain, N., Caldejon, S., … Koch, C. (2021). Survey of spiking in the mouse visual system reveals functional hierarchy. Nature, 592(7852), 86–92. 10.1038/s41586-020-03171-x
- Harris, J. A., Hirokawa, K. E., Sorensen, S. A., Gu, H., Mills, M., Ng, L. L., Bohn, P., Mortrud, M., Ouellette, B., Kidney, J., Smith, K. A., Dang, C., Sunkin, S., Bernard, A., Oh, S. W., Madisen, L., & Zeng, H. (2014). Anatomical characterization of Cre driver mice for neural circuit mapping and manipulation. Frontiers in Neural Circuits, 8, 76. 10.3389/fncir.2014.00076
- Daigle, T. L., Madisen, L., Hage, T. A., Valley, M. T., Knoblich, U., Larsen, R. S., Takeno, M. M., Huang, L., Gu, H., Larsen, R., Mills, M., Bosma-Moody, A., Siverts, L. A., Walker, M., Graybuck, L. T., Yao, Z., Fong, O., Nguyen, T. N., Garren, E., … Zeng, H. (2018). A suite of transgenic driver and reporter mouse lines with enhanced brain-cell-type targeting and functionality. Cell, 174(2), 465-480.e22. 10.1016/j.cell.2018.06.035
- Zhang, Y., Rózsa, M., Liang, Y., Bushey, D., Wei, Z., Zheng, J., Reep, D., Broussard, G. J., Tsang, A., Tsegaye, G., Narayan, S., Obara, C. J., Lim, J.-X., Patel, R., Zhang, R., Ahrens, M. B., Turner, G. C., Wang, S. S.-H., Korff, W. L., … Looger, L. L. (2023). Fast and sensitive GCaMP calcium indicators for imaging neural populations. Nature, 615(7954), 884–891. 10.1038/s41586-023-05828-9
- Madisen, L., Mao, T., Koch, H., Zhuo, J., Berenyi, A., Fujisawa, S., Hsu, Y.-W. A., Garcia, A. J., Gu, X., Zanella, S., Kidney, J., Gu, H., Mao, Y., Hooks, B. M., Boyden, E. S., Buzsaki, G., Ramirez, J. M., Jones, A. R., Svoboda, K., … Zeng, H. (2012). A toolbox of Cre-dependent optogenetic transgenic mice for light-induced activation and silencing. Nature Neuroscience, 15(5), 793–802. 10.1038/nn.3078
- Taniguchi, H., He, M., Wu, P., Kim, S., Paik, R., Sugino, K., Kvitsani, D., Fu, Y., Lu, J., Lin, Y., Miyoshi, G., Shima, Y., Fishell, G., Nelson, S. B., & Huang, Z. J. (2011). A resource of Cre driver lines for genetic targeting of GABAergic neurons in cerebral cortex. Neuron, 71(6), 995–1013. 10.1016/j.neuron.2011.07.026
- Zhang, F., Wang, L.-P., Boyden, E. S., & Deisseroth, K. (2006). Channelrhodopsin-2 and optical control of excitable cells. Nature Methods, 3(10), 785–792. 10.1038/nmeth936
- Oommen, B. S., & Stahl, J. S. (2008). Eye orientation during static tilts and its relationship to spontaneous head pitch in the laboratory mouse. Brain Research, 1193, 57–66. 10.1016/j.brainres.2007.11.053
- Kalatsky, V. A., & Stryker, M. P. (2003). New paradigm for optical imaging: Temporally encoded maps of intrinsic signal. Neuron, 38(4), 529–545. 10.1016/S0896-6273(03)00286-1