MouseGoggles: an immersive virtual reality headset for mouse neuroscience and behavior (2025)

Optical design

Optical modeling of the VR eyepiece was performed using OpticStudio in sequential mode, with custom scripts written with Matlab (version 2022b) 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 on the basis of 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, whereas lenses outside of this range negatively affected optomotor responses22. These data suggest 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 (that is, rays that appear at infinity focal depth) for multiple viewing angles (0–70°, in 10° 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 was 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. Two-dimensional (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 per degree: 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 (45° azimuth, 15° elevation). The mouse’s FOV (shown in Fig. 1 and Extended Data Figs. 4 and 7) was approximated on the basis of prior measurements of V1 retinotopic organization6 that found RF centers roughly spanning from 0° to 140° in azimuth and −40° to 60° in elevation. Extending these RF centers by a radius of 20°, we approximate the mouse FOV as a 180° × 140° ellipse centered at 70° azimuth and 10° elevation (probably overestimating the FOV in the lower periphery where RF centers were not found).

Display hardware

For the MouseGoggles Mono 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 printed circuit board, with a short focal length Fresnel lens (FRP0510, Thorlabs). For the MouseGoggles Duo headset, two of the same displays were connected to a Raspberry Pi 4 (Pi 4B-2GB, Adafruit); both displays were connected to the serial peripheral interface (SPI) 0 port with different chip select pins (display 0 on CE0, display 1 on CE1) to allow independent display control. For the MouseGoggles EyeTrack headset, a slightly larger circular display was used (1.28 inch liquid crystal display module, model 19192, Waveshare). Plastic enclosures used to house the components (Teensy/Raspberry Pi, printed circuit board, displays, Fresnel lenses) were printed using a 4K resin 3D printer (Photon Mono X, Anycubic).

Display software

To present visual stimuli on MouseGoggles Mono, a custom Arduino script was written for the Teensy 4.0 microcontroller and uploaded via the Arduino IDE (version 1.8.15) using the Teensyduino add-on (version 1.57). Pattern drawing commands are read over serial communication from a host personal computer (PC) and utilize the Adafruit graphics functions 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 scripts written with Matlab and Python (version 2.8.8) were used. To render 3D scenes for MouseGoggles Duo, 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. Unlike the Unity game engine commonly used for neuroscience VR applications, Godot was selected for MouseGoggles because it is an open-source engine with reduced computational requirements that can operate at high framerates on simple hardware (for example, a Raspberry Pi 4), despite its feature-rich and powerful 3D rendering capabilities. The 3D environment was mapped onto the circular displays using custom Godot shaders 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). To deliver these rendered views to the circular displays, a custom display driver was modified from an existing open-source Raspberry Pi display driver for SPI-based displays (https://github.com/juj/fbcp-ili9341), which functions by copying a subset of the default high-definition multimedia interface (HDMI) framebuffer (the size of the frame subset determined by the resolution of the SPI display) and streams the frame data over the SPI channel. Our customized driver modifies the original to enable control of two SPI displays simultaneously; this is achieved by copying a subset of the framebuffer that is twice the height of a single SPI display, with the top half defining the frame for display 0 and the bottom half for display 1. For every program loop, where the loop frequency is determined by the desired framerate, the program streams the top half of the framebuffer with chip select 0 (connected to display 0) enabled, followed by streaming the bottom half of the framebuffer with chip select 1 (connected to display 1) enabled. During each refresh cycle, the entire frame of each display is updated. Latency could be reduced in the future using the ‘adaptive display stream updates’ mode of the display driver (not yet implemented with MouseGoggles), where only pixels that changed from the previous frame are streamed to the display.

Acute whole retina imaging during visual stimulation

Surgical procedure for imaging the display’s projection onto the back of the enucleated mouse eye was modified from a previous method23. Immediately after a previously scheduled euthanasia using CO2 and secondary euthanasia by cervical dislocation, curved jeweler’s forceps were used to enucleate the eyeball and remove the optic nerve and connective tissue. The dissected eyeball was immediately moved into room-temperature phosphate-buffered saline. Under a stereomicroscope, the sclera, choroid and retinal pigment epithelium were removed from the eye, and the intact retina was verified visually. The eye was then placed on a 3D-printed holder with a central hole matching the typical eye diameter, with the eye’s optical axis facing upward. A mini camera (OV5647, Arducam) was mounted below the eye facing upward and manually focused onto the back of the eye. Either a traditional flat monitor was mounted above the eye at a 10 cm distance, or a MouseGoggles Mono eyepiece was mounted on an adjustable optical post, with the display facing downward toward the eye. Vertically and horizontally drifting grating stimuli were then presented to the eye during by either a monitor (at a 10 cm distance) or MouseGoggles Mono display during the acquisition of retinal-plane images.

Eye-tracking hardware and software

To perform eye and pupil tracking with the MouseGoggles EyeTrack headset, each eyepiece included additional slots for a mini IR camera module (OV5647, Arducam), an IR hot mirror (FM01, Thorlabs) placed on a 15° angle between the Fresnel lens and display, and a custom circuit board with two surface-mount IR LEDs (VSMB2943GX01, Vishay) positioned on either side of the camera module. Each camera was positioned along the side of the angled eyepiece enclosure, facing the display, with an IR view of the mouse eye on the opposite side of the Fresnel lens based on reflection off of the hot mirror. Each camera was independently controlled using a Raspberry Pi 3 through the libcamera library (libcamera.org), acquiring 30 frames s−1 at 800 × 800 pixel resolution. Videos were preprocessed to extract the red imaging channel (which excludes most of the blue/green VR display) of a 500 × 500 pixel region of interest centered on the eye. Offline eye and pupil tracking of this preprocessed video was performed using the Deeplabcut16 toolbox for tracking the pixel coordinates of the top, bottom, left and right points of the pupil and eyelids. The pixel coordinates of the pupil center were calculated by averaging the left- and right-side points of the pupil, and the pupil diameter was calculated by the distance between these two points; the top and bottom points of the pupil were ignored due to their often-unreliable tracking as the mouse partially closes its eyelids. Lateral eye movements due to face movement behaviors were corrected by subtracting the movements of the eye center (defined as the average between the eyelid’s left and right side point coordinates) from the pupil center, similar to previous methods24. Lateral movements of the pupil center in pixels were then converted to movements in millimeters using a calibrated transformation estimating the radial distortion produced by the Fresnel lens and the camera’s tilted point of view. The following equations were used to relate positions (in millimeters) in the eye position plane to coordinates (in pixels) in the acquired images:

$${e}_{x}^{\prime} ={e}_{x}(a({{e}_{x}}^{2}+{{e}_{y}}^{2})+b\sqrt{({{e}_{x}}^{2}+{{e}_{y}}^{2})})$$

$${e}_{y}^{\prime} ={e}_{y}(a({{e}_{x}}^{2}+{{e}_{y}}^{2})+b\sqrt{({{e}_{x}}^{2}+{{e}_{y}}^{2})})$$

$${p}_{x}=\arcsin\left(\frac{{e}_{x}^{\prime} }{\sqrt{{{e}_{x}}^{2}+{({e}_{y}-c)}^{2}\,+d}}\right)$$

$${p}_{y}=\arcsin\left(\frac{{e}_{y}^{\prime} }{\sqrt{{{e}_{x}}^{2}+{({e}_{y}-c)}^{2}+d}}\right),$$

where ex and ey are the Cartesian coordinates of the eye plane, a and b are fitting parameters accounting for the radial lens distortion, ex′ and ey′ are the Cartesian coordinates after lens distortion, c and d are fitting parameters accounting for the cameras tilted view, and px and py are the camera pixel x and y coordinates. Parameters a, b, c and d were manually calibrated for each eyepiece to convert a millimeter-spaced grid placed at the mouse eye position into pixel coordinates (Fig. 4d). After pupil movements (in millimeters) relative to the eye center were calculated, eye rotations could then be estimated. Since IR glare and reflections off the Fresnel lens partially obstructed the view of the pupil, estimating eye rotations on the basis of elliptical pupil distortions as has been previously demonstrated24 was unreliable. Instead, we estimated eye rotations on the basis of the lateral movement of the pupil center and the approximate distance between the pupil and the mouse eye center, as measured previously25 (3.2–3.4 mm axial length and 0.35–0.4 mm anterior chamber depth, yielding ~1.3 mm from the pupil to the eye center). Pupil movements were converted to eye rotations by the following equations:

$${e}_{{{\mathrm{yaw}}}}=\arctan \left(\,{p}_{x}/{p}_{{\mathrm{r}}}\right)$$

$${e}_{{{\mathrm{pitch}}}}=\arctan (\,{p}_{y}/{p}_{{\mathrm{r}}}),$$

where eyaw and epitch are the eye yaw and pitch angles, px and py are the pupil x and y coordinates relative to the eye center (rotated so the x coordinate follows the horizon) and pr is the radial distance of the pupil from the eyeball center. Eye yaw and pitch angles were mapped onto the visual field relative to their approximate optical centers located at ±70° azimuth and 10° elevation.

Headset rotation feedback

To perform closed-loop feedback so headset rotation leads to rotation in the VR environment, an integrated sensor (6 degree-of-freedom gyroscope and accelerometer, LSM6DSOX, Adafruit) or magnetometer (LIS3MDL, Adafruit) was attached to a rotating mount supporting a MouseGoggles Duo headset. Accelerometer or magnetometer readings were measured by a Teensy 4.0 microcontroller (Teensy40, PJRC) running Arduino code to convert sensor readings into absolute headset orientation relative to straight ahead and relay these values via a Universal Serial Bus (USB) connection to the Raspberry Pi to control virtual movement.

Animals

All animal procedures complied with relevant ethical regulations and were performed after approval by the Institutional Animal Care and Use Committee of Cornell University (protocol number 2015-0029). All mice were housed in a climate-controlled facility kept at 22° C and 40–50% humidity, under a 12 h light–dark cycle with ad libitum access to food and water. All behavioral experiments were performed during the night phase. For mouse intereye distance measurement (Extended Data Fig. 2), a variety of mouse genotypes and ages were used: C57BL/6 (three females, five males; 4–16 months old), APPnl-g-f heterozygotes26 (three males, four females; 2–3 months old), TH::Cre heterozygotes (line Fl12, www.gensat.org) (one male; 16 months old) and Drd2::Cre heterozygotes (line ER44, www.gensat.org) (one male, two females; 4 months old). For two-photon calcium imaging and hippocampal electrophysiology experiments (Fig. 2), 6–9-month-old C57BL/6J male mice were used (three mice for imaging and two for electrophysiology). For virtual linear track behavioral conditioning experiments (Fig. 3a–d), ten male 2–4-month-old C57BL/6 mice were used. For looming visual stimulus behavioral experiments measuring startle reactions (Fig. 3e,f), eight male 2–7-month-old C57BL/6 mice were used. For looming visual stimulus experiments during eye and pupil tracking (Fig. 4), five male 4–5-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−1) was given for analgesia. Lidocaine (2.5 mg kg−1) 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) 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 head plate was further secured by an additional layer of Metabond. Postoperative ketoprofen and dexamethasone were administered subcutaneously, and the mouse was returned to its home cage on a heating pad for recovery. All behavior tests were performed at least 1 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 (anterior-posterior 3 mm, medial-lateral 2.5 mm from Bregma, centerline) on the right hemisphere. A 50 nl bolus of AAV9-Syn-GCaMP6s (Addgene) diluted to 1012 vg ml−1 was injected to the target V1 layer 2/3 (dorsal-ventral −0.2 mm from the 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. Postoperative 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 the dorsal CA1 (anterior-posterior 1.95 mm, medial-lateral 1.5 mm from Bregma, centerline), and a burr hole was made in the contralateral occipital plate for the 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) was adhered to a metal moveable micro drive (R2Drive, 3Dneuro) to allow vertical movement of the probe after implantation. The probe was implanted above the dorsal CA1 (dorsal-ventral −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 that 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

Two-photon calcium imaging was performed using a Ti:Sapphire laser (Coherent Vision S Chameleon; 80 MHz repetition rate, 75 fs pulse duration) at 920 nm to excite the GCaMP6s calcium indicator, with ~35 mW power at the sample. Imaging signals were acquired using ScanImage27 software (SI2022) into separate blue and green color channels (separated by a 488 nm long-pass dichroic; channel 1 using a 510/84 (center wavelength/bandwidth, both in nanometers) bandpass filter and channel 2 using 517/65). A transistor-transistor logic (TTL) signal from the monocular display was acquired into an additional unused imaging channel for synchronizing imaging with visual stimuli. The 256 × 256 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 MouseGoggles Mono display at the mouse’s left eye for contralateral two-photon imaging in the right hemisphere. The display was oriented to 45° azimuth and 0° elevation respective to the long axis of the mouse. To measure display light contamination, a maximum-brightness blue square (covering a 66°-wide region of the visual field) was flickered at 0.5 Hz for five 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 70° azimuth and 0° elevation, with the cranial window either unblocked or blocked with a circular cut piece of black masking tape (T743-2.0, Thorlabs) (Extended Data Fig. 5). To measure V1 neuron visual stimulus encoding, neurons with RFs 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.3°-wide square and 24 pixel/15.3° SF) once every 6 s, cycling through four directions (right, down, left and 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 three mice. All stimuli were blue square-wave gratings shown at 100% contrast, 1 Hz temporal frequency (TF) and 20 pixel/12.7° SF unless otherwise noted. First, RF mapping was performed by presenting a four-direction bar sweep stimulus (right, down, left and up; 0.5 s per direction, 2 s total) in one location at a time in a 5 × 5 grid at the center of the display. Each segment of the grid was a 12-pixel/7.6°-wide square, where 6 × 12 pixel/3.8 × 7.6° bright bar sweeps 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 five repetitions at each location. Next, orientation and direction tuning were measured by presenting drifting gratings at 12 angles (0–330°, in 30° increments) in a random order, at a 40 pixel/25.5° SF in an 80-pixel/51°-wide square that rotated on the basis of the angle of the grating. Each stimulus was 1 s in duration with 6 s between stimuli, for five repetitions. Finally, SF, TF and contrast tuning were measured using unidirectional (rightward) drifting gratings in an 80-pixel/51°-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.7° SF) varied across five SFs (4, 10, 20 40 and 80 pixels; 2.5°, 6.4°, 12.7°, 25.5° and 51°, respectively), six TFs (0.5, 1, 2, 4, 8, and 12 Hz) and six 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 five repetitions.

Calcium imaging analysis

Scanimage Tiff files were processed through suite2p28 (v0.10.3) for motion stabilization, active region of interest 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 inferred spikes during baseline frames (2 s preceding each stimulus) and during the stimulus presentation (1 or 2 s in duration depending on the stimulus). RF size was estimated similarly to previous methods9. In brief, the mean response to the four-direction stimuli presented in a 5 × 5 grid was fit with a 2D Gaussian function using lsqcurvefit(@D2GaussFunctionRot) in Matlab, estimating an ellipse with two 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 SF tuning curves were estimated similarly to previous methods10 by fitting each cell’s responses with a log-Gaussian function:

$$R\left({{\mathrm{SF}}}\right)={e}^{-\frac{({\log }_{2}{{\mathrm{SF}}}-{\log }_{2}{{{\mathrm{SF}}}}_{{{\mathrm{pref}}}})}{2{\sigma }^{2}}},$$

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 similarly to previous methods11 by fitting each cell’s responses with a Naka–Rushton function:

$$R\left(c\right)=\frac{{c}^{n}}{{c}^{n}{{+c}_{50}}^{n}},$$

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 on the basis of 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 VR 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 sensor29 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).

Linear treadmill

The linear treadmill was modified from an existing design (linear treadmill with encoder, Labmaker). Custom 3D-printed wall plates were used to accommodate a larger head mount, and custom code was uploaded to the treadmill microcontroller to convert treadmill motion into emulated computer mouse y movements, relayed via a USB connection to the Raspberry Pi to control virtual movement. Similarly to the spherical treadmill, 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 treadmill.

Head-fixed behavioral tests

Before the start of behavioral tests, all mice were habituated in the room where the experiment would be performed for at least 1 day, followed by at least 5 days of habituation on the spherical or linear treadmill (without a VR system attached). On each treadmill training day, mice were head-fixed on a custom-designed holder via the mounted head plate, and the head was positioned on the center of the spherical treadmill or positioned on the linear treadmill so that the body was contained by the treadmill walls. After room and treadmill habituation, mice were then habituated to the MouseGoggles Duo or MouseGoggles Eyetrack headset by positioning the headset to the mouse eyes using sliding optical posts so that both eyes were approximately positioned at the center of the eyepieces, typically 0.5–1 mm from the lens surface. A gray image was then shown on the VR display for 10 min before VR experiments were started.

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 × 30 cm × 12 cm), and the electrode was lowered (<125 µm per day) until area CA1 layers were visible, identified by physiological features of increased unit activity and local field potential ripples30. 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

Electrophysiology data were analyzed with custom Python code (https://github.com/lolaBerkowitz/SNLab_ephys) using the Nelpy python package (https://github.com/nelpy/nelpy). Spike sorting was performed semiautomatically 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 s.d.). Only spike data from when the animal’s velocity was greater than 5 cm s−1 was used. A spatial information content score31 was calculated for each cell by the following definition:

$${{\mathrm{SI}}}=\mathop{\sum }\limits_{i=1}^{N}{P}_{i}x\frac{{\lambda }_{i}}{\lambda }{\log }_{2}\frac{{\lambda }_{i}}{\lambda },$$

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. For cells that met these requirements for spatial information content, field detection was performed using the find_fields function in neuro_py (https://github.com/ryanharvey1/neuro_py). In brief, a field was defined as an area that encompassed at least 30% of a local peak of the ratemap. Place fields were at minimum 10 virtual cm and at most 80 virtual cm, or 7–53% of the virtual linear track (150 virtual cm length).

Linear track place learning

A virtual linear track was designed for the MouseGoggles Duo 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 three equal-length, visually distinct wall sections: (1) black and green vertical stripes, (2) black and white spots and (3) black and green horizontal stripes. In addition, 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 0°, 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 0° 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 pretraining 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 first three 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 were 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, while the first and last bin were 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 that quickly followed a reward delivery (starting within 3 s of a delivered reward) and continued until the lick rate dropped below 1 lick s−1). All licks occurring at other times than after a reward delivery were defined as ‘exploratory licks’. Reward and control zones were defined as regions spanning ±0.25 m (ten 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 were subdivided into rewarded versus unrewarded ‘probe’ trials, where probe trials contain no post-reward licks. Statistically significant differences in the proportion of licks in reward versus 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 with a traditional panoramic display, a VR 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 260° in azimuth of the mouse’s visual field and spanned an elevation of 92° (−28° to 64°) with a circular hole at the top to accommodate a microscope objective (Extended Data Fig. 7).

Loom–startle experiment and 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 with the MouseGoggles Duo headset, appearing as a dark circular object in the sky 45° in elevation and 45° to either the left or right from straight ahead, beginning 20 m away and approaching at 25 m s−1 until disappearing at 0.6 m away. Left or right looms were displayed pseudorandomly, separated by 10 s, for ten repetitions (five left and five 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, although they could not be completely blinded to the experimental condition (headset versus projector) owing to the nature of the recorded videos. Both scorers were given the 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 two scores (one from each scorer) was taken, where average scores of 1.5 or greater were classified as a startle response to the looming stimulus. The proportion of startle responses was calculated by dividing the number of startle responses by the number of observations at each repetition and was fit with an exponential decay function with offset:

$$R\left(r\right)={{R}_{1}e}^{-\lambda (r-1)}+b,$$

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 two mice where startle responses were first observed in the VR headset, after which a second cohort of mice was tested with both the VR headset and the projector-based system. For mice that 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 that began with the projector VR, only 1 day elapsed before testing with the headset. Neither of the two ‘projector-first’ mice was startled in projector VR, but both were startled in headset VR.

Loom–eye-tracking experiment and analysis

Head-fixed mice walking on the linear treadmill were presented with looming visual stimuli similar to the loom–startle experiment, using the MouseGoggles EyeTrack headset. Fifteen repetitions of the looming stimulus were presented in five sets of three conditions: a looming object approaching from 45° right, 45° left or center. The loom was 45° in elevation for all conditions, and the visual scene was blacked out above 64° elevation to match the vertical extent of the projector VR system. Treadmill velocity and the timing of looming stimulus presentation was logged by the game engine. An eye-tracking video for each eye was acquired independently and synchronized to the looming stimuli afterward using the blue channel of the eye-tracking video, which acquires a partial view of the VR display through the hot mirror so that looming stimuli can be observed (alongside eye tracking in the red channel). Post-loom walking speed change was calculated from the walking speed after the loom (average velocity during 2 s from loom onset), relative to the baseline walking speed (average velocity during 2 s before stimulus onset). The post-loom eye pitch angle change and pupil diameter change were calculated similarly, except that the average pupil diameter change was calculated during the 3 s after the loom onset owing to the relatively slower pupil response we observed. Post-loom walking speed change, eye pitch angle change and pupil diameter change were then averaged across each set of three looming conditions (left, right and center) for each mouse individually. Statistically significant trends of these three measurements by repetition number of the looming stimuli were determined by Cuzick’s trend test in Matlab (https://github.com/dnafinder/cuzick). An average time-series response of walking speed and eye pitch change was calculated by averaging the response across all looming repetitions for each mouse individually, followed by calculating the average and s.d. of the response across mice. Since the pupil diameter response habituated with increased loom repetition, an average time-series response of pupil diameter change was calculated using only the first set of three looming stimuli.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

MouseGoggles: an immersive virtual reality headset for mouse neuroscience and behavior (2025)

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Dr. Pierre Goyette

Last Updated:

Views: 6674

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Dr. Pierre Goyette

Birthday: 1998-01-29

Address: Apt. 611 3357 Yong Plain, West Audra, IL 70053

Phone: +5819954278378

Job: Construction Director

Hobby: Embroidery, Creative writing, Shopping, Driving, Stand-up comedy, Coffee roasting, Scrapbooking

Introduction: My name is Dr. Pierre Goyette, I am a enchanting, powerful, jolly, rich, graceful, colorful, zany person who loves writing and wants to share my knowledge and understanding with you.