Skip to main content

viewephys

Neuropixel raw data viewer

Installation

pip install viewephys

Alternatively, in development mode:

git clone https://github.com/int-brain-lab/viewephys.git
cd viewephys
pip install -e .

Supported environments

This is compatible with the IBL environment

Otherwise, you can create a new environment as such:

conda create -n viewephys python=3.12
conda activate viewephys

And then follow the install instructions above.

Controls

  • ctrl + z: -3dB gain
  • ctrl + a: +3dB gain
  • ctrl + p: in multi-windows mode, link the displays (pan, zoom and gain)

Pick spikes

When the picking mode is enabled (menu pick)

  • left button click sets a point
  • shift + left button removes a point
  • control + left does not wrap on maximum around pick
  • space increments the spike group number

Examples

Visualize raw binary file through the command line

Activate your environment and type viewephys, you can then load a neuropixel binary file using the file menu.

alt text

Alternatively you can point the viewer to a specific file using the command line:

viewphys -f /path/to/raw.bin

Load in a numpy array or slice

viewephys can be used through the Python console or iPython, allowing you to create multiple instances of the viewer at once.

# if running ipython, you may have to use the `%gui qt` magic command
import numpy as np
from viewephys.gui import viewephys
nc, ns, fs = (384, 50000, 30000)  # this mimics one second of neuropixel data
data = np.random.randn(nc, ns) / 1e6  # volts by default
ve = viewephys(data, fs=fs)

# We can open multiple windows at once, but they must have different titles
data2 = data * 50
ve2 = viewephys(data, fs=fs, title="plot 2")

alt text

Note if you are running through a script, you need to instantiate the Qt application yourself:

Opening a binary file through a script

from viewephys.gui import EphysBinViewer, create_app

app = create_app()

viewer = EphysBinViewer(r"C:\Users\Joe\Desktop\1119617_LSE1_shank12_g0_imec0\1119617_LSE1_shank12_g0_t0.imec0.ap.bin")

app.exec()

Load in a numpy array or slice through a script

import numpy as np
from viewephys.gui import viewephys, create_app

app = create_app()

nc, ns, fs = (384, 50000, 30000)  # this mimics one second of neuropixel data
data = np.random.randn(nc, ns) / 1e6  # volts by default

ve = viewephys(data, fs=fs)
ve2 = viewephys(data * 50, fs=fs, title="plot 2")

app.exec()

Contribution

Fork and PR.

Pypi Release checklist:

ruff check
rm -fR dist
rm -fR .pdm-build
pdm publish
#twine upload --repository-url https://test.pypi.org/legacy/ dist/*

Download files

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

Source Distribution

viewephys-1.3.0.tar.gz (58.0 kB view details)

Uploaded Source

Built Distribution

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

viewephys-1.3.0-py3-none-any.whl (63.2 kB view details)

Uploaded Python 3

File details

Details for the file viewephys-1.3.0.tar.gz.

File metadata

  • Download URL: viewephys-1.3.0.tar.gz
  • Upload date:
  • Size: 58.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.28.0 CPython/3.11.15 Linux/6.17.0-1018-azure

File hashes

Hashes for viewephys-1.3.0.tar.gz
Algorithm Hash digest
SHA256 31eb261dc174864a361cffbda41a6b1b58c5ced630c981f814c340f2f187fa6b
MD5 7fb4f1d928202442cf382798e8f2af16
BLAKE2b-256 1d149a58cd0598d75b1c1c99ad7ae1b077d69def4db38227a8a9397eeb263283

See more details on using hashes here.

File details

Details for the file viewephys-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: viewephys-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 63.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.28.0 CPython/3.11.15 Linux/6.17.0-1018-azure

File hashes

Hashes for viewephys-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 470d6a7527ef1c285f0f6332e49531098d19e145cc622435a195fdbd2a2f3a2a
MD5 ad7e1a48f7d0dd35255ef140f86025c4
BLAKE2b-256 ecdabbb3dc3ce7ea9f9be1a1b202af0d339bd0c9a19d1049fbaed52706dc329d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 files

1.2.0

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

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