License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Stanford School of Medicine Dean's Postdoctoral Fellowship
A.P. Giannini Foundation Postdoctoral Fellowship
Abstract
This protocol collection explains how to build a low-cost, lightweight system to implant 1 Neuropixels 1.0 probe or 2 Neuropixels 2.0 probes into mice, record during freely moving behavior, then recover the probes for future use. This protocol first describes how to build a Neuropixels recording system using a National Instruments acquisition system and SpikeGLX software, from parts acquisition through your first recording. It also describes how to integrate a camera, including code and wiring to record and synchronize video frames. See full collection for more details.
Guidelines
The acquisition set up portion of this protocol is intended to be an unofficial, streamlined version of the official documentation, but not a replacement for it.
You will need a camera that you can manually wire to send synchronizing pulses to the NIDAQ system in order to synchronize video frames with neural data later.
You will need a camera, lens, power supply, mount, I/O cable with bare ends, data cable, tripod mount, and computer.
Supplier: Allied Vision cameras work with NIDAQ systems. This protocol explains how to wire an Allied Vision camera for this purpose.
Camera: Get a high enough resolution & frame rate for your project. Some cameras can adjust their settings so you can capture lower resolution at higher frame rates and vice versa. C(S)-mount refers to the lens attachment. C-mount cameras can take C or CS lenses, but CS-mount cameras can only take CS lenses.
Lens: The greater the focal length, the greater the zoom. Use this tool (https://www.baslerweb.com/en/products/tools/lens-selector) to estimate lens size based on camera to object distance and the size of the field. E.g. open field camera might use a 6mm lens, while a pupil camera might use a 24mm lens.
Power supply: whatever the camera needs. You may be able to power the camera through the data cable.
I/O cable with bare ends: This sends signals to the camera to start/stop capturing and receives signals of frame times.
Data cable: GigE (Cat6 cable) & USB are the most common. GigE is generally better over distances >5m.
Mounting: Attach to 80/20 by screwing into a tripod mount.
Computer: If you don't need real-time control, then just get a tower with enough SSD space to store your videos. If using GigE, make sure you get one that has PCIe cards to fit the Intel network adapter, and also get a PCIe Desktop Adapter.
Set up acquisition hardware
Set up acquisition hardware
Load the PCIe module into your computer
Load the PXIe modules and the IMEC module into the NIDAQ chassis
Connect the PXIe modules to the BNC breakout board and the computer. Connect the IMEC SMA to the BNC board (analog slot 0). Cover remaining unused BNC slots with BNC terminators to prevent TTLs from leaking across channels.
Plug in a probe, connected to a headstage, connected to a cable, into a port on the IMEC module.
Boot the chassis, then the computer.
Set computer settings
Set computer settings
Get your machine connected to the internet and install any institute-specific software.
Open Device Manager. Under "Other Devices", right-click the PXI device and select "Update". Select browse from my computer and select the folder where you unzipped the Enclustra drivers.
The PXI device should now appear under "Enclustra" in the Device Manager.
Copy all the Calibration files that you received via email when you purchased the probes into the Calibration folder in SpikeGLX. Note that some of them have typos from when IMEC sent them. The correct format is [probe #]/[probe #][ADCCalibration or gainCalValues]. I.e. each probe should have its own directory named after it, with 2 files inside with the probe number once, underscore, and the file type.
Update firmware
Update firmware
Launch SpikeGLX. Go to Tools/Update Imec Firmware.
Select the slot your IMEC module is in.
Check the box and select the file(s) for a BS and a BSC update. The files for this version of SpikeGLX are in the folder named Firmware that is included in your SpikeGLX release. Click Update.
Power cycle by shutting down the computer, then the NIDAQ, and waiting for a few seconds before rebooting.
Test the probe and headstage
Test the probe and headstage
Launch Spike GLX. Tools/BIST Test or Tools/HST Test.
Select the slot your IMEC module is in, the port your headstage is in, and dock 1.
For HST, plug in the headstage test device. Note as of April 2021, this isn't working in the newest IMEC updates.
First acquisition
First acquisition
Launch SpikeGLX. File/New Acquisition.
Check the boxes for enable IMEC and enable NIDAQ.
Select the slot your module is in and click Add. Then uncheck the boxes except for the row with the port your headstage is plugged into and dock 1 (dock 2 is for 2.0 probes). Click detect.
Calculate the true sample rate and determine how the headstage and computer clocks map. Do this for every new headstage. First, launch SpikeGLX and detect the headstage, as described above.
In the "NI Setup" tab, specify 0:7 analog (XA) and 0:7 digital (XD).
Go to the Sync tab of the Configuration to set up the sync pulse.
Select “Imec slot x" under Square Wave Source, where x is the slot of the Imec card in the PXIe chassis. This produces a 1 Hz square wave with 50% duty cycle. The sync output will be visible on the last channel of the "imec0 probe", SY0, bit #6.
Input channel should be Analog 0.
Measured period should read “1.00000…” and Threshold should read “1.100."
Check “Use next run for calibration".
Set calibration time: 20 min minimum, 40 min is ideal.
Click Run to do a Calibration run.
When Calibration run is done recording, should get a popup dialog with the measured sample rate. Check “Yes” to apply the new sample rates.
The Calibration file is now in C:/SpikeGLX/Release_<#>/SpikeGLX/_Calibration. You will have:
1 file for _imec, with 1 entry per headstage in the file - if you’ve calibrated with that headstage, you’re calibrated with any probe attached to it.
1 file for _nidaq
During subsequent acquisitions, SpikeGLX should automatically use your most recent Calibration files. You can also choose them manually in the Sync tab. In the Sync tab, make sure "Use next run for calibration" is unchecked and keep the sync pulse enabled to use the calibrated clock.
Set up the camera
Set up the camera
Plug the I/O cable and the data cable into the camera. Screw tripod adapter onto base, then attach the adapter to an 80/20 L-bracket mounted on 80/20 frame or to Thorlabs components mounted on an air table, depending on your setup.
Set up the camera acquisition computer and acquisition software as described by your camera's manufacturer. This should be a separate computer from the SpikeGLX acquisition computer. For Allied Vision cameras connecting via GigE cables, you can follow hardware instructions here: https://github.com/emilyasterjones/X_maze#gige-vimba-camera-acquisition-instructions
Wire I/O cable to send TTL pulses from camera to SpikeGLX
Wire I/O cable to send TTL pulses from camera to SpikeGLX
Run SpikeGLX, then hit Run on Vimba Viewer. If it worked, you should see an upward pulse for the duration of the exposure.
Acquire video
Acquire video
Neither SpikeGLX nor Allied Vision have accompanying video acquisition software (Allied Vision's Vimba Viewer allows streaming but not recording of video). To acquire video, use a script to connect to the camera, define its acquisition settings including those for sending TTL pulses, acquire each frame and save it.