Concept Notes

This page collects longer conceptual explanations that are linked from other chapters. Use it as a reference while reading the walkthroughs.

SpikeGLX streams

TODO

A stream refers to a continuous recording of voltage signals from a specific set of channels, sampled at a fixed rate. SpikeGLX saves different streams to separate files depending on the frequency band and channel type. Streams written by SpikeGLX can include the action potential (AP) band, local field potential (LF) band and a sync stream (depending on the version).

TODO

A stream refers to any contiously recorded stream of bytes, which usually represent numbers. Two key streams are the data stream (which contains recorded data from the probe) and the sync stream. The sync stream is used to align times between the probe and other equiptment used in the experiment (e.g. cameras), and consists of repeating ON/OFF pattern (e.g. 0 1 0 1 0 1…).

TODO: better integrate Source reference: SpikeGLX User Manual: Data Stream.

In earlier Neuropixel probe versions, the data stream was separated into AP and LF streams. was filtered in the probe into two separate streams. The action potential (AP) band was filtered with high-pass filter (300, 500 or 1000 Hz, depending on how it was set). This filtering removes low-frequency signal component, leaving the action potentials (which are typically in the 300-3000 Hz range) untouched. This stream is used for spike sorting.

A local-field potential band was also written, filtered using a 300 Hz low pass filter. This removes high-frequency data (including action potentials) and leaves low-frequency local feild potentials (LF). The LF band represents the summed voltage ossilations generated by neurons across the brain and is subject to differnt analyses.

In recent Neuropixels versions (e.g. Neuropixels 2) there is no longer a distinction betweeen AP and LF data streams. The unfiltered data is written to disk (saved in the imec0.ap band suffix, although it is now broadband), and popst-hoc filtering left up to the user.

In more recent Neuropixels versions (e.g. Neuropixels 2) there is no logner a distinction betweeen data streams. The unfiltered data is written to disk (saved in the imec0.ap band suffix, although it is now broadband), and popst-hoc filtering left up to the user.

Inheritence

The SpikeInterface API Documentation is a useful resource for looking up methods associated with an object and their arguments. In Spikeinterface, all recordings inherit💡 from the BaseRecording, so checking out the API docs for BaseRecording gives us iformation about all recording objects.

Under the hood, SpikeInterface XX widely relies on a class inheritence model, and the Recording object is a good example of this. A BaseRecording object defines many useful functions for interacting with a recording for example getXXX (see the API docs here). All other recording objects inherit from this BaseRcording object, for example our SpiekGLXRecordingExtractor object inherits from BaseRecording, and so contains all of this.

Every recording-like object we will deal with doday inherits from BaseRecording and so includes all this functionality. Often, these inherited classes add some functinoaity on top. For example, BaseRecording has a get_traces() fucntion that returns the underlying data. A Filter recording extends this function to first filter the data before returning it.

Data storage in int16 and scaling to uV

Most acquisition systems will store data in int16 format (i.e. integers in the range XXX) to save storage space. To get these values, the acquired data in uV is scaled and offset into the int16 range.

By default, SpikeInterface will display the raw int16 data. To use the stored offsets and gains to reconstrct XX, we can use the return_in_uV argument on many functions. Also see XX, XX and XX for working with these.