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. If the optional lfpack dependency is installed (pip install viewephys[lfpack]), File > open > LFPack (HDF5) is also available and loads HDF5-packed LFP archives (.h5/.hdf5); if the file holds several recordings you can switch between them with the recording selector.

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

You can also "replay" .bin or .cbin files using the viewephys-replay command. This will rewrite the specified file to a new location in chunks (a replay subfolder next to the source unless -o is given) and allow you to open it with File > open live recording in the viewephys GUI.

viewephys-replay /path/to/raw.bin -o /path/to/replay/directory --speed 0.25

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.4.0

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.4.0
File Size Uploaded Provenance Actions
viewephys-1.4.0.tar.gz 72.6 kB Without provenance Details for viewephys-1.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 151.2 kB

Release files / viewephys-1.4.0.tar.gz

Download URL viewephys-1.4.0.tar.gz
Size 72.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0fd42e7df706cefe1f77fb9f0edd14368d4618cd098d720881a19b22ef1396e4
BLAKE2b-256 checksum
How to use checksums
d5c66cc0cb10d37e917bdca69c82e6da6ff26f8d408fb2b924eb91903b4f3fd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.29.7 CPython/3.11.18 Linux/7.0.0-1020-azure

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

Download URL viewephys-1.4.0-py3-none-any.whl
Size 78.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32a4a0a2fc42d9d3f9922d794861ddcdc4f046a9282c4d9cc1c4ce81a45ba8bd
BLAKE2b-256 checksum
How to use checksums
ebbeb0cd179ace43a781c37e271b5c94505251eeedf3af3e985ea537846637ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.29.7 CPython/3.11.18 Linux/7.0.0-1020-azure

Security for viewephys 1.4.0

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