Optical design
Optical modeling of the VR eyepiece was performed using OpticStudio in sequential mode, with custom Matlab scripts used for analysis and plotting. The Fresnel lens model was supplied by the manufacturer (FRP0510, Thorlabs). The display was positioned at the focal length of the lens (10 mm) for infinity focus. We estimate this to be near the center of a mouse’s depth of field based on previous research testing the impact of various focal length lenses on free-walking mice in a rotational optomotor assay, where it was found that either no lens or a +7 D lens with the display at a distance of ~30 (20-40) cm resulted in the strongest behavioral reactions, while lenses outside of this range negatively affected optomotor responses14. This data suggests that infinity focus (equivalent to a +3.33 D lens with the display at 30 cm) is near the center of the mouse’s depth of field. Using the optical model set to infinity focus, the apparent display resolution and focal distance was estimated by first casting parallel rays from the eye position (i.e., rays which appear at infinity focal depth) for multiple viewing angles (0-70 deg, in 10 deg increments). For each viewing angle, the mean position of the rays as they intersect with the display (in pixels from the display center) was calculated, and the true focal point of the rays calculated from the position with minimum variance in ray spread. The resolution by viewing angle was calculated from the slope of the line of viewing angle as a function of pixel position. The focal depth by viewing angle was calculated from the distance between each viewing angle’s focal point and the display; the inverse of this distance (in cm) quantifies the focal distance in diopters away from infinity focus. 2D projections of the visual field coverage of the display, as seen through the lens, were estimated assuming a constant display resolution of 1.57 pixels/deg: pixels were mapped onto a sphere with the center of the display pointing straight ahead, then rotated to match the final position in a typical headset orientation (45o azimuth, 15o elevation). The mouse’s FOV (shown in Fig. 1 and Supplementary Fig. 4) was approximated based on prior measurements of V1 retinotopic organization15 which found receptive field centers roughly spanning from 0o to 140o in azimuth and -40o to 60o in elevation. Extending these RF centers by a radius of 20o, we approximate the mouse FOV as a 180o x 140o ellipse centered at 70o azimuth and 10o elevation (likely overestimating the FOV in the lower periphery where RF centers were not found).
Display hardware
For the monocular display used for V1 imaging, a circular, 16-bit color TFT LED display (TT108RGN10A, Shenzhen Toppop Electronic) was connected to a Teensy 4.0 microcontroller (TEENSY40, PJRC) using a custom PCB, with a short focal length Fresnel lens (FRP0510, Thorlabs). For the binocular headset, two of the same displays were connected to a Raspberry Pi 4 (Pi 4B-2GB, Adafruit); both displays were connected to the SPI0 port with different chip select pins (display0 on CE0, display1 on CE1) to allow independent display control. Plastic enclosures used to house the components (Teensy/Raspberry Pi, PCB, displays, Fresnel lenses) were printed using a 4K resin 3D printer (Photo Mono X, Anycubic). Parts lists and assembly instructions are available in a public online repository (mousegoggles.org)
Display software
To present visual stimuli on the monocular display, a custom Arduino script was written for the Teensy 4.0 microcontroller. Pattern drawing commands are read over serial communication from a host PC and utilize the Adafruit GFX library (https://github.com/adafruit/Adafruit-GFX-Library) to create simple visual stimuli such as drifting gratings, edges, and flickers. To control the display from a host PC, custom Matlab and Python scripts were used. To render and present 3D scenes on the binocular display, the Linux-compatible game engine Godot (version 3.2.3.stable.flathub) was installed on the Raspberry Pi OS (based on 32-bit Debian Bullseye) using the Flathub Linux-based app distribution system. To accurately map the 3D environment onto the circular displays, custom Godot shaders were created to warp the default rendered view (which linearly maps a flat plane in the virtual scene onto the flat plane of the display) to the spherical view created by the headset (which linearly maps viewing angles onto the flat plane of the display). All custom software and code are available in a public online repository (mousegoggles.org)
Animals
All animal procedures were performed after approval by the Institutional Animal Care and Use Committee (IACUC) of Cornell University (protocol number 2015-0029). All mice were housed in a 12-hour light-dark cycle with ad libitum access to food and water. All behavioral experiments were performed during the night phase. For mouse inter-eye distance measurement (Supplementary Fig. 1), a variety of mouse genotypes and ages were used: C57BL/6 (3 females, 5 males; 4-16 months old), APPnl-g-f heterozygotes16 (3 males, 4 females; 2-3 months old), TH::Cre heterozygotes (line Fl12, www.gensat.org) (1 male; 16 months old), and Drd2::Cre heterozygotes (line ER44, www.gensat.org) (1 male, 2 females; 4 months old). For 2-photon calcium imaging and hippocampal electrophysiology experiments (Fig. 2), 6–9-month-old C57BL/6J male mice were used (3 mice for imaging and 2 for electrophysiology). For virtual linear track behavioral conditioning experiments (Fig. 3a-d), 10 male 2–4-month-old C57BL/6 mice were used. For looming visual stimulus behavioral experiments (Fig. 3 e-f), 8 male 2–7-month-old C57BL/6 mice were used.
Surgical preparation for head-fixed behavior
Mice were anesthetized with isoflurane (5% for induction, 1% for maintenance) and placed on a feedback-controlled heating pad. Surgeries were performed on a stereotaxic apparatus where the heads of mice were fixed with two ear bars. Ointment (Puralube, Dechra) was applied to both eyes for protection. Injection of Buprenex (dose: 0.05 mg/kg) was given for analgesia. Lidocaine (2.5 mg/kg) was administered to the scalp after being disinfected by 75% ethanol and povidone–iodine. A small incision (∼12–15 mm) along the sagittal line of the skull was made to expose a section of the skull sufficiently large to place a custom-designed titanium head plate. The head was rotated so that the bregma and lambda features of the skull were level. The surface of the skull was gently scratched by a scalpel to remove the periosteum. After the skull was completely dry, a thick layer of Metabond (Parkell, Inc., Edgewood, NY) was applied to cover the skull surface. A titanium head plate was mounted on top of the Metabond and aligned with the surface of the skull and position of the eyes. The Headplate was further secured by an additional layer of Metabond. After surgery the mouse was returned to its home cage on a heating pad for recovery. All behavior tests were performed at least one week after surgery.
Surgical preparation for calcium imaging
Mice underwent surgical procedures for head-fixed behavior with modifications to accommodate a viral injection. First, a 3-mm craniotomy was made above V1 (A-P 3 mm, M-L 2.5 mm from Bregma, centerline) on the right hemisphere. A 50-nL bolus of AAV9-Syn-GCaMP6s (Addgene) was injected to target V1 layer 2/3 (D-V -0.2 mm from brain surface). A 3-mm glass window then replaced the hole in the skull, and the titanium head plate was secured to the skull with Metabond. Post-operative ketoprofen and dexamethasone were administered subcutaneously, and the mouse was allowed to fully recover in a cage on a heating pad. Four weeks were allowed for viral expression before imaging.
Surgical preparation for electrophysiology
Mice underwent surgical procedures for head-fixed behavior with modifications to accommodate a chronic electrode implant. First, a craniotomy was made above dorsal CA1, (A-P 1.95 mm, M-L 1.5 mm from Bregma, centerline), and a burr hole was made in the contralateral occipital plate for placement of a ground screw. A stainless-steel wire was soldered to the ground screw and threaded through the head plate, which was then secured to the skull with Metabond. A 64-channel single-shank silicon probe (NeuroNexus, Ann Arbor, MI) was adhered to a metal moveable micro drive (R2Drive, 3Dneuro) to allow vertical movement of the probe after implantation. The probe was implanted above dorsal CA1 (D-V -1.1 mm from brain surface), and the craniotomy was sealed with a silicone elastomer (DOWSIL 3–4680, Dow Chemical). Copper mesh was fixed to the Metabond which surrounded the micro drive and formed a cap. Ground and reference wires were soldered to the copper mesh to reduce environmental electrical noise. While the mouse was in the home cage, the copper mesh was covered with an elastic wrap to prevent debris from entering the cap.
Two-photon microscopy
2-photon calcium imaging was performed using a Ti:Sapphire laser (Coherent Vision S Chameleon; 80-MHz repetition rate, 75-fs pulse width) at 920 nm to excite the GCaMP6s calcium indicator, with 35-mW power at the sample. Imaging signals were acquired using ScanImage17 software into separate blue and green color channels (separated by a 488 nm dichroic; channel 1 using a 510/84 bandpass filter and channel 2 using a GCaMP-specific 517/65 bandpass filter). A TTL signal from the monocular display was acquired into an additional unused imaging channel for synchronizing imaging with visual stimuli. 256x256 pixel image frames were acquired at 3.41 Hz.
Monocular visual stimulation
Visual stimulation experiments were performed with anesthetized, head-fixed mice by positioning a monocular display at the mouse’s left eye for contralateral 2-photon imaging in the right hemisphere. The display was oriented to 45o azimuth and 0o elevation respective to the long axis of the mouse. To measure display light contamination, a maximum brightness blue square (covering a 66o wide region of the visual field) was flickered at 0.5 Hz for 5 repetitions, first by the monocular display, then by a flat LED monitor (ROADOM 10.1” Raspberry Pi Screen, Amazon) positioned 10 cm from the mouse eye and oriented at 70o azimuth and 0o elevation. To measure V1 neuron visual stimulus encoding, neurons with receptive fields in the monocular display center were located by presenting a drifting grating stimulus in a small square region in the center of the display (24 pixel/15.3o wide square and 24 pixel/15.3o spatial frequency) once every 6 seconds, cycling through 4 directions (right, down, left, up) until V1 L2/3 neurons excited by the stimulus were found through the live view of the fluorescence microscope. In this position, a single visual stimulation protocol was performed with 3 mice. All stimuli were blue square-wave gratings shown at 100% contrast, 1-Hz temporal frequency (TF), and 20 pixel/12.7o spatial frequency (SF) unless otherwise noted. First, receptive field mapping was performed by presenting a 4-direction drifting grating stimulus (right, down, left, up; 0.5 s per direction, 2 s total) in one location at a time in a 5x5 grid at the center of the display. Each segment of the grid was a 12 pixel/7.6o wide square, where 12 pixel/7.6o spatial frequency gratings were shown. Stimuli were presented in the 25 segments one at a time in a random order with 6 s between stimuli, for a total of 5 repetitions at each location. Next, orientation and direction tuning were measured by presenting drifting gratings at 12 angles (0-330o, in 30o increments) in a random order, at a 40 pixel/25.5o spatial frequency in an 80 pixel/51o wide square that rotated based on the angle of the grating. Each stimulus was 1 s in duration with 6 s between stimuli, for 5 repetitions. Finally, spatial frequency, temporal frequency, and contrast tuning were measured using unidirectional (rightward) drifting gratings in an 80 pixel/51o wide square region; only a single direction was used to reduce the number of stimuli and the duration of the experiment. The stimulus set consisted of the default grating stimulus (100% contrast, 1 Hz TF, 12.7o SF) varied across 5 spatial frequencies (4, 10, 20 40 and 80 pixels; 2.5o, 6.4o, 12.7o, 25.5o, and 51o respectively), 6 temporal frequencies (0.5, 1, 2, 4, 8, and 12 Hz), and 6 contrast values (5-bit bright/dark bar values of 15/15, 18/12, 21/9, 24/6, 27/3, and 30/0 – for contrast values of 0, 20, 40, 60, 80, and 100% respectively), for a total of 15 unique stimuli. Each stimulus was 2 s in duration with 6 s between stimuli, for 5 repetitions.
Calcium imaging analysis
Scanimage Tiff files were processed through suite2p18 for motion stabilization, active ROI segmentation, and spike inference, followed by custom Matlab scripts for analysis and plotting. Segmented cells were manually screened for accurate classification, resulting in 410 cells pooled from 3 mice (142, 112, and 156 cells from mouse 1, 2, and 3, respectively). For each cell, time-series vectors of the extracted fluorescence and inferred spikes were aligned for each stimulus repetition to calculate the average stimulus response. Activity was quantified at baseline and during each stimulus from the mean of all spikes during baseline frames (2 s preceding each stimulus) and during the stimulus presentation (1 or 2 s in duration depending on the stimulus). Receptive field size was estimated similar to previous methods8. Briefly, the mean response to the 4-direction stimuli presented in a 5x5 grid was fitted with a 2D Gaussian function using lsqcurvefit(@D2GaussFunctionRot) in Matlab, estimating an ellipse with 2 independent widths for the major and minor axes. The RF size was calculated by averaging the half-width at half-maximum of the major and minor axes. Only cells well-fit to the 2D Gaussian were included (resnorms < 0.25; 341 cells). Normalized spatial frequency tuning curves were estimated similar to previous methods9 by fitting each cell’s responses with a log-Gaussian function:
where SF is the spatial frequency, SFpref is the preferred spatial frequency, and σ is a fitting parameter describing the width of the curve. Only cells well-fit to the function were included (adjusted R2 > 0.8; 124 cells). Normalized contrast tuning curves were estimated similar to previous methods10 by fitting each cell’s responses with a Naka-Rushton function:
where c is the contrast, c50 is the semisaturation contrast, and n is a fitting exponent describing the sharpness of the curve. Only cells well-fit to the function were included (adjusted R2 > 0.8, 202 cells).
Spherical treadmill and lick port
The spherical treadmill system was built based on an existing design1. A 20-cm diameter Styrofoam ball was suspended by compressed air. Locomotion of mice was tracked through ball movement by two optical flow sensors (ADNS-3080 Optical Flow Sensor APM2.6) mounted on the bottom and side of the ball. The optical sensors sent the ball motion to an Arduino Due via SPI which was processed by a custom script (https://github.com/Lauszus/ADNS3080) and relayed via a USB connection to a Raspberry Pi or PC. The roll, pitch, and yaw movements of the ball were transformed to drive the corresponding animal movements in the virtual reality environment. Velocity gain was calibrated to ensure a one-to-one correspondence between the distances traveled in the virtual environment and on the surface of the ball. A 1.83-mm diameter stainless steel lick port along with a customized capacitive sensor19 was used to deliver water rewards and measure licking behavior. Water was delivered through a solenoid valve (SSZ02040672P0010, American Science Surplus) operated by a Teensy 4.0 microcontroller (Teensy40, PJRC) and relay (4409, Adafruit). The microcontroller received valve open commands from and transmitted lick detections to the Raspberry Pi over USB using XInput (https://github.com/dmadison/ArduinoXInput).
Head-fixed behavioral tests
All mice were habituated in the room where the experiment would be performed for at least one day. Habituation on the treadmill system without VR system (for both projector-based and headset-based VR systems) was conducted more than 5 days before the start of behavioral tests. In each training day, mice were head-fixed on a custom-designed holder via the mounted headplate. The head was positioned on the center of the ball as previously described1. Mice were then habituated to the VR display for 10 minutes with only a gray image showing on the screen.
Hippocampal electrophysiology and analysis
Recordings were conducted using the Intan RHD2000 interface board or Intan Recording Controller, sampled at 30 kHz. Amplification and digitization were done on the head stage. Data were visualized with Neurosuite software (Neuroscope). Mice concurrently underwent neural activity screening and head-fixed behavior habituation. For screening, activity from each amplifier channel was monitored while a mouse foraged for sugar pellets in an open field (30 cm x 30 cm x 12 cm), and the electrode was lowered (<125 µm/day) until area CA1 layers were visible with unit activity and characteristic local field potential features, as previously described20. The mouse’s virtual position on the ball was synchronized with electrophysiological data using a TTL pulse from the Teensy microcontroller connected to the Raspberry Pi.
Spike sorting, unit identification, and encoding of virtual position
Spike sorting was performed semi-automatically with KiloSort (https://github.com/cortex-lab/KiloSort), followed by manual curation using the software Phy (github.com/kwikteam/phy) and custom designed plugins (https://github.com/petersenpeter/phy-plugins). Identified units were assessed by manual inspection of auto-correlograms, waveforms, waveform distribution in space, and PCA metrics. Units with high contamination in the first 2 ms of the auto-correlogram or with visible noise clusters were discarded. Spatial tuning curves were created by binning spike data and the mouse's virtual position into 3-cm bins. Raw spike and occupancy maps were smoothed using a Gaussian kernel (3-cm SD). Only spike data from when the animal's velocity was greater than 5 cm/s was used. A spatial information content score21 was calculated for each cell by the following definition:
where the virtual environment is divided into N spatial bins, Pi is the occupancy of bin i, λi is the mean firing rate for bin i, and λ is the overall mean firing rate of the cell. A surrogate set of information content scores was created by shuffling the position coordinates 500 times and computing the spatial information content score for the resulting tuning curves at each shuffle. A cell was defined as a place cell if the observed information content score was greater than the 95th percentile of shuffled scores and if the cell’s peak rate was at least 1 Hz.
Linear track place learning
A virtual linear track was designed for the VR headset using the Godot video game engine (https://godotengine.org/). The track was 1.5 m long and 6 cm wide, with 5 cm high walls that were divided into 3 equal-length, visually distinct wall sections: 1. Black and green vertical stripes, 2. black and white spots, and 3. black and green horizontal stripes. Additionally, a tall black tower was located at 0.9 m (track start = 0 m; track end = 1.5 m) to provide a more distal cue of location. The virtual location of the mouse began at 0.04 m and oriented at 0o, looking straight down the track – mice were constrained to locations within the track that were at least 4 cm from the nearest wall to prevent camera views clipping through the walls, limiting the total habitable length of the track to 1.42 m. The spherical treadmill pitch controlled forward/backward walking, while mouse heading was maintained at 0o to keep mice traversing down the track. Liquid rewards were given through the lick port at a specific location along the track to condition licking behavior at that location over time; rewards were given at 0.5 m for mice 1-5 (cohort A) and at 1.0 m for mice 6-10 (cohort B).Three days before training, mice were provided with 1.2 ml of water daily and their body weight was continuously monitored, with additional water supplementation administered to maintain their body weight above 85% of their pre-training weight. After habituation for head-fixed behavior, all mice underwent a 5-day linear track place-learning protocol with the following parameters:
- Days 1-2: liquid reward is automatically delivered when the mouse reaches the reward location.
- Day 3: For the 1st 3 trials, liquid reward is automatically given. For trials 4+, the mouse must first lick in the reward zone (no farther than 0.25 m away from the reward location) before a reward is delivered at the mouse’s location of licking.
- Days 4-5: Similar to day 3 (trials 1-3 guarantee reward; trials 4+ require licks), with a random 20% of trials unrewarded (probe trials).
Mice performed one session of track traversals per day, where each session consisted of 40 laps down the track. Once mice reached the end of the track (located at 1.46 m), the traversal finished, and the mice were teleported back to the beginning to start a new lap. If mice did not reach the track end within 60 s, the trial data was discarded but still counted toward the 40-lap session limit. Licks were detected by the rising edge of the lick sensor and were recorded alongside mouse position during each traversal. All licking data was binned by location into 5-cm wide bins, with the first and last bin excluded due the mouse’s constrained position away from the walls. Lick rates were calculated by dividing the number of licks in each binned position by the time spent at that position. “Post-reward” licks were defined as a series of licks which quickly followed a reward delivery (starting within 3 s of a delivered reward) and continued until the lick rate dropped below 1 lick/s). All licks not occurring following a reward delivery were defined as “exploratory licks”. Reward and control zones were defined as regions spanning +/- 0.25 m (10 total position bins) from the rewarded location. The fraction of exploratory licks in the reward and control zones were calculated by dividing the total number of licks in each zone by the total licks in all 28 habitable bins. Chance level zone licking was calculated by dividing the size of the zones in bins by the total habitable zone of the track (10/28 = 35.71 %). During days 4-5, data was subdivided into rewarded vs unrewarded “probe” trials, where probe trials contain no post-reward licks. Statistically significant differences in the proportion of licks in reward vs control zones during probe trials was calculated using the two-tailed Mann-Whitney U-test (ranksum function in Matlab), comparing the mean lick proportions of each mouse with trials pooled from days 4 and 5.
Projector-based VR system
To compare the VR headset to a traditional panoramic display, a virtual-reality environment was generated by the Unity video game engine and projected onto a custom-built conical rear-projection screen (Stewart FilmScreen 150) surrounding the mouse using two projectors (Optoma HD141X Full 3D 1080p 3000 Lumen DLP). The projection screen covered 260o in azimuth of the mouse’s visual field and spanned an elevation of 92o (-28o to 64o) with a circular hole at the top to accommodate a microscope objective (Supplementary Fig. 4).
Loom-startle analysis
Head-fixed mice walking on the spherical treadmill were recorded using an HD webcam (NexiGo N980P, 1080p 60 fps). Mice were shown looming visual stimuli, appearing as a dark circular object in the sky 45o in elevation and either 45o to the left or right from straight ahead, beginning 20 m away and approaching at 25 m/s until disappearing at 0.6 m away. Left or right looms were displayed pseudorandomly, separated by 10 s, for 10 repetitions (5 left and 5 right). Video clips of mice during each looming stimulus presentation (from 5 s before the loom to 5 s after) were created and evaluated by two independent scorers who were blind to the goals of the experiment, though they could not be completely blinded to the experimental condition (headset vs projector) due to the nature of the recorded videos. Both scorers were given following instructions for determining startle responses (and other behaviors) from clips:
“In each 10 s clip, look for a behavioral reaction to the loom stimulus. The loom is a dark spot that appears on the screen, grows exponentially in size, then disappears, the full process taking ~0.8 s. The loom may be easy or hard to see based on the display used and the starting position of the loom, but will always be visible when it reaches its max size and disappears.
[For each clip], write down your confidence level (0-3) in seeing that reaction in each clip. Except for grooming, these reactions should be something the mouse was not doing before the loom, but started doing during or immediately at the end of the loom. For the grooming reaction, write down whether the mouse was grooming during the stimulus, even if it was grooming before it as well.
Possible reactions:
- Startle: burst of movement, jump, or kick
- Tense up: back arches, tailbone or tail curling under
- Stop: stops, from a moving state
- Run: starts running, from a stopped or slowly walking state
- Turn: rear end of its body swings to the side
- Grooming: uses its paws to wipe at mouth/whiskers/eyes
Confidence scores:
- 0: reaction did not happen
- 1: reaction possible happened
- 2: reaction probably happened
- 3: reaction definitely happened”
Due to the startle and tense up reactions being difficult for the scorers to differentiate, the individual confidence scores for these two behaviors were combined into a single reaction score, where the larger of the two became the new score. To classify responses for each mouse, repetition, and experimental condition, the average of the 2 scores (1 from each scorer) was taken, where average scores of 1.5 or greater were classified as a startle response to the looming stimulus. Proportion of startle responses were calculated by dividing the number of startle responses by the number of observations at each repetition, and was fitted with an exponential decay function with offset:
where r is the repetition number, R1 is the startle response proportion at r=1, 𝜆 is the decay rate constant, and b is the offset. The experiment was initially performed with 2 mice where startle responses were first observed in the VR headset, after which a 2nd cohort of mice were tested with both the VR headset and the projector-based system. For mice which began with the headset VR (4/6 mice), 10 days elapsed before testing with the projector to attempt to restore the novelty of the looming stimulus. For mice which began with the projector VR, only 1 day elapsed before testing with the headset. Neither of the 2 ‘projector-first’ mice were startled in projector VR, but both were startled in headset VR.