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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ibl_neuropixel-1.11.3.tar.gz (348.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ibl_neuropixel-1.11.3-py3-none-any.whl (102.6 kB view details)

Uploaded Python 3

File details

Details for the file ibl_neuropixel-1.11.3.tar.gz.

File metadata

  • Download URL: ibl_neuropixel-1.11.3.tar.gz
  • Upload date:
  • Size: 348.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for ibl_neuropixel-1.11.3.tar.gz
Algorithm Hash digest
SHA256 73bec060c070bea4a877e33f63f2805a4511388590dad4aea7e630c1fa207765
MD5 72738f8cb3d857ed73156d30b3a08723
BLAKE2b-256 aa577cae59095deb30c92e719158b3c5ae40ad4fa66c73e08fffb1102d9ac12a

See more details on using hashes here.

File details

Details for the file ibl_neuropixel-1.11.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ibl_neuropixel-1.11.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e0447b3fce1524a42e0b9231dcdeddabecbd01ec70e14391e71db369c2d28b10
MD5 d008bdac9f6931db98f4205bdc103b4c
BLAKE2b-256 ca6a94028f363ed668f0941fe82132d7c2bdf1498fd6ce9b6e918a58e56bbbda

See more details on using hashes here.

Release history Release notifications | RSS feed

1.12.0

2 files

This release

1.11.3 This release

2 files

1.11.2

2 files

1.11.0

2 files

1.10.0

2 files

1.9.3

2 files

1.9.2

2 files

1.9.1

2 files

1.9.0

2 files

1.8.1

2 files

1.8.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.0.1

2 files

1.0.0

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

0.0.1

2 files

0.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page