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 data through the GUI

Activate your environment and type viewephys. Use File > open > SpikeGLX to load a neuropixel binary file, or File > open > Open Ephys to select an Open Ephys folder (containing structure.oebin). The GUI will prompt you to select a specific recording and data stream if multiple exist. File > open > NWB loads an NWB file containing an electrical series. If the file holds several electrical series you are prompted to select one.

For recordings without probe information, Probe > Load from probeinterface library allows for attaching probe geometries of different manufacturers and models from the probeinterface library (fetched online) to recordings. Channels are then shown at their positions on the probe, and can be spatially sorted.

alt text

Visualize raw binary file through the command line

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/*

Metadata

Release files for viewephys 1.3.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 viewephys 1.3.1
File Size Uploaded Provenance Actions
viewephys-1.3.1.tar.gz 64.3 kB Without provenance Details for viewephys-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for viewephys 1.3.1
File Interpreter ABI Platform Actions
viewephys-1.3.1-py3-none-any.whl Python 3 none any Details for viewephys-1.3.1-py3-none-any.whl

Total release size: 133.9 kB

Release files / viewephys-1.3.1.tar.gz

Download URL viewephys-1.3.1.tar.gz
Size 64.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e5be9e9c52e027cb75207e50cc9666256eafa2ef337a82896ea5968c03402321
BLAKE2b-256 checksum
How to use checksums
f493196207bedefc59b7fd6166c256c18b631b0b3d5ed0186712bd4f3821e8eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.29.5 CPython/3.11.17 Linux/7.0.0-1017-azure

Release files / viewephys-1.3.1-py3-none-any.whl

Download URL viewephys-1.3.1-py3-none-any.whl
Size 69.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
accfec4402d91f42b915b1c98d059a7bd0a9041a71169a3dc658ce4fb977b220
BLAKE2b-256 checksum
How to use checksums
7a89283192ee5fa369c2a07f14a5ea435cd92072cb1a2a455969c41bf681d42e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.29.5 CPython/3.11.17 Linux/7.0.0-1017-azure

Security for viewephys 1.3.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.

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