Extractors module

Overview

The extractors module allows you to load BaseRecording, BaseSorting, and BaseEvent objects from a large variety of acquisition systems and spike sorting outputs.

Most of the Recording classes are implemented by wrapping the NEO rawio implementation.

Most of the Sorting classes are instead directly implemented in SpikeInterface.

Although SpikeInterface is object-oriented (class-based), each object can also be loaded with a convenient read_XXXXX() function.

import spikeinterface.extractors as se

Read one Recording

Every format can be read with a simple function:

recording_oe = read_openephys(folder_path="open-ephys-folder")

recording_spikeglx = read_spikeglx(folder_path="spikeglx-folder")

recording_blackrock = read_blackrock(folder_path="blackrock-folder")

recording_mearec = read_mearec(file_path="mearec_file.h5")

Importantly, some formats directly handle the probe information:

recording_spikeglx = read_spikeglx(folder_path="spikeglx-folder")
print(recording_spikeglx.get_probe())

recording_mearec = read_mearec(file_path="mearec_file.h5")
print(recording_mearec.get_probe())

Read one Sorting

sorting_KS = read_kilosort(folder_path="kilosort-folder")

Read one Event

events_OE = read_openephys_event(folder_path="open-ephys-folder")

For a comprehensive list of compatible technologies, see Supported File Formats.

Lazy loading

An important concept is that all read_XXXX() functions are lazy. Traces are not read from disk; instead only the relevant metadata (e.g. channel_ids, sampling frequency, etc.) is.

The actual reading will be done on demand using the get_traces() method:

# opening a 40GB SpikeGLX dataset is fast
recording_spikeglx = read_spikeglx(folder_path="spikeglx-folder")

# this really does load the full 40GB into memory : not recommended!!!!!
traces = recording_spikeglx.get_traces(start_frame=None, end_frame=None, return_scaled=False)

Supported File Formats

Currently, we support many popular file formats for both raw and sorted extracellular datasets. Given the standardized, modular design of our recording and sorting extractors, adding new file formats is straightforward so we expect this list to grow in future versions.

Most formats are supported on top of NEO

Dependencies

The neo package is a hard dependency of SpikeInterface. So all formats handled by Neo directly will also be handled in SpikeInterface.

However, some formats are handled directly by SpikeInterface and need extra installation.

You can install all extractors’ dependencies with:

pip install spikeinterface[extractor]

Raw Data Formats

For raw recording formats, we currently support:

Sorted Data Formats

For sorted data formats, we currently support:

Dealing with Non-Supported File Formats

With recording and sorting objects, we hope that any user can access SpikeInterface regardless of the nature of their underlying file format. If you feel like a non-supported file format should be included in SpikeInterface as an actual extractor, please open an issue.