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.12.0.tar.gz (351.7 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.12.0-py3-none-any.whl (106.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ibl_neuropixel-1.12.0.tar.gz
  • Upload date:
  • Size: 351.7 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.12.0.tar.gz
Algorithm Hash digest
SHA256 3eedbaabaf4e062c54dd58c8e38f44997c3d09b0276eb18d365cced13906b5ab
MD5 fcf34cfd7d8c40bd485e44bb688ea093
BLAKE2b-256 ebc7cad7ef65b01b846e2be7a59a4bf63ee6726c310432e3ba7c752a0cb568a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ibl_neuropixel-1.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52f05850dff5f804d8959685528c40e4adb7076daf69e1ae4c2e4493181a2a49
MD5 6911df8c051625c6f9667d1b43c9aeec
BLAKE2b-256 99276f1759dd9279dafff55c751726e0b840b459e5265e817b2f8a19cc31a73a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.12.0 This release

2 files

1.11.3

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