Skip to main content

ibl-neuropixel

Collection of tools to handle Neuropixel 1.0 and 2.0 data (documentation coming soon...)

Installation

Minimum Python version supported is 3.10 uv pip install ibl-neuropixel

Destriping

Getting started

Compress a binary file losslessly using mtscomp

The mtscomp util implements fast chunked compression for neurophysiology data in a single shard. Package repository is here.

from pathlib import Path
import spikeglx
file_spikeglx = Path('/datadisk/neuropixel/file.imec0.ap.bin')
sr = spikeglx.Reader(file_spikeglx)
sr.compress_file()
# note: you can use sr.compress_file(keep_original=False) to also remove the orginal bin file

Reading raw spikeglx file and manipulating arrays

The mtscomp util implements fast chunked compression for neurophysiology data in a single shard. Package repository is here.

from pathlib import Path
import spikeglx

import ibldsp.voltage

file_spikeglx = Path('/datadisk/Data/neuropixel/human/Pt01.imec0.ap.bin')
sr = spikeglx.Reader(file_spikeglx)

# reads in 300ms of data
raw = sr[10_300_000:10_310_000, :sr.nc - sr.nsync].T
destripe = ibldsp.voltage.destripe(raw, fs=sr.fs, neuropixel_version=1)

# display with matplotlib backend
import ibldsp.plots
ibldsp.plots.voltageshow(raw, fs=sr.fs, title='raw')
ibldsp.plots.voltageshow(destripe, fs=sr.fs, title='destripe')

# display with QT backend
from viewephys.gui import viewephys
eqc = {}
eqc['raw'] = viewephys(raw, fs=sr.fs, title='raw')
eqc['destripe'] = viewephys(destripe, fs=sr.fs, title='destripe')

Destripe a binary file

This relies on a fast fourier transform external library: pip install pyfftw.

Minimal working example to destripe a neuropixel binary file.

from pathlib import Path
from ibldsp.voltage import decompress_destripe_cbin
sr_file = Path('/datadisk/Data/spike_sorting/pykilosort_tests/imec_385_100s.ap.bin')
out_file = Path('/datadisk/scratch/imec_385_100s.ap.bin')

decompress_destripe_cbin(sr_file=sr_file, output_file=out_file, nprocesses=8)

Viewer

The best way to look at the results is to use viewephys, open an ephys viewer on the raw data.

  • tick the destripe box.
  • move to a desired location in the file
  • ctr+P will make the gain and axis the same on both windows

alt text

You can then move within the raw data file.

White Paper

The following describes the methods implemented in this repository. https://doi.org/10.6084/m9.figshare.19705522

Contribution

Please see our contribution guidelines for details on how to contribute to this project.

Metadata

Release files for ibl-neuropixel 1.15.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ibl-neuropixel 1.15.1
File Size Uploaded Provenance Actions
ibl_neuropixel-1.15.1.tar.gz 360.9 kB Without provenance Details for ibl_neuropixel-1.15.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ibl-neuropixel 1.15.1
File Interpreter ABI Platform Actions
ibl_neuropixel-1.15.1-py3-none-any.whl Python 3 none any Details for ibl_neuropixel-1.15.1-py3-none-any.whl

Total release size: 476.6 kB

Release files / ibl_neuropixel-1.15.1.tar.gz

Download URL ibl_neuropixel-1.15.1.tar.gz
Size 360.9 kB
Tags Source
SHA-256 checksum
How to use checksums
74be4aa5e095a6dc8c656759421c330f279ab839aa9d2ab877601345fac19e56
BLAKE2b-256 checksum
How to use checksums
1faebc16947b53c5c739851e32d27691c6f56acb7fffd9c6533207b425f61c58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / ibl_neuropixel-1.15.1-py3-none-any.whl

Download URL ibl_neuropixel-1.15.1-py3-none-any.whl
Size 115.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a13040bede0b1d3972e8b24cb3c57f0df4211bee812fb843a179b91b63ce20e9
BLAKE2b-256 checksum
How to use checksums
405eb8cc75f148bffafb29bb44659ae20ea3793f1235e013cb25934fefb86978
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for ibl-neuropixel 1.15.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.15.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page