Bilal Shihab / Projects

phy 3D Feature View

A 3D feature view for phy, the open-source tool electrophysiology labs use to sort neural spikes, so clusters can be inspected and split in three dimensions:

Recanzone Lab, UC DavisResearch intern, Jun – Aug 2025Pull request open upstream
Spec
Project
phy (cortex-lab), open source
Data
Extracellular spike features
Added
3D feature view
Built
Projection pipeline, camera controls
Editing
Lasso cluster split in 3D
Stack
Python, OpenGL
Fig. 1The full phy window with the 3D feature view in the center: two spike clusters plotted on their first three principal components, rotated with shift-drag.

Why I built it

My work at Longhorn Neurotech made me want to learn more about how neural recordings are analyzed at the level of individual neurons. The lab wanted a 3D view because it lets them compare two clusters across three principal components at once, instead of piecing that together from several 2D plots.

The hard part

The first obstacle was getting phy to run on my Mac. Its older graphics code wouldn't start on Apple Silicon, so I forced an OpenGL 2.1 compatibility profile on macOS and fixed a crash caused by a newer version of joblib. The other difficult part was the lasso split: it only checked the spikes drawn on screen, which are a subsample, so splits were missing spikes. I changed it to reload every spike before splitting.