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.0.tar.gz (377.1 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.0-py3-none-any.whl (135.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ibl_neuropixel-1.11.0.tar.gz
  • Upload date:
  • Size: 377.1 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.0.tar.gz
Algorithm Hash digest
SHA256 c1a7a0a526ecde9ab8cb280125163ae7eda33e032f41bacd65a97ab34ab8a450
MD5 46e4a30b93af40cd0bb262ff59a9f396
BLAKE2b-256 1cf006f783c161a46addfbe3ea2bd156b23021e288a0dd40fb70b62c6e86d412

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ibl_neuropixel-1.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08d3c127880987c7775a2e469fea09c0c8f49d946d572fbe07d1c2f3d8811008
MD5 5c13a105af59602f56ad55eed19eac4d
BLAKE2b-256 f8e97ff815ffbc058b6fef4975cd878efac7823559a02e947977c3b3a7166222

See more details on using hashes here.

Release history Release notifications | RSS feed

1.12.0

2 files

1.11.3

2 files

1.11.2

2 files

This release

1.11.0 This release

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