Views
Every view is a dockable tile. The default layout puts three tab groups side by side — shape (Waveforms, Templates, Probe, Summary), comparison (CCG, Features, Amplitudes, ISI, Rate, Similar) and assessment (Quality, Suggest, Stats, Raster, Drift, Contam·time); PSTH sits in the comparison group — above a full-width Trace, so a waveform overlay, a correlogram grid and a feature scatter of the same selection are visible at once, as in phy.
- Drag a tab title to move it into another group, or to the edge of a tile to split it. Drag the borders to resize.
×on a tab closes the view; the+at the right of a tab bar or the View menu in the top bar reopens it. View → Reset layout restores the default.- Every view can be maximized or popped out: the two buttons at the right of
a tab bar act on its active tab. Maximize fills the view area with that one
view (header Restore button,
EscorCtrl+Shift+Mbrings the layout back); pop-out moves the view to its own native window, leaving “In its own window” and a Bring back button in its tile, and closing that window brings the view back.F11toggles full screen in either window. The:maxand:popsnippets do the same for the view under the pointer. A popped-out window handles the same keyboard shortcuts while it has focus (Ksplits,Escclears a lasso and never closes it). - The layout, table sort/filter, trace settings and last selected cluster
are saved per dataset in
<dataset>/.sorrel/ui.jsonand restored on the next open.
The cluster table stays in the left panel. Clusters in the selection are coloured by their position in it (first = blue, second = orange, …), and every view uses the same colour for the same cluster.
Spike counts. The table’s n is the total current spike membership of that cluster, not the number of points or waveforms drawn. A merge adds the selected clusters’ counts; a split redistributes them. Waveforms separately reports loading and valid-snippet counts, because spikes at recording edges or with missing raw data may not have a complete waveform.
| View | What it shows |
|---|---|
| Trace | Raw recording for a configurable window, one row per channel, with channel numbers, a time axis and a tick on each selected cluster’s peak channel for every spike in view. LTTB downsampling with optional CMR + high-pass. Drag or wheel to pan, Ctrl-wheel to zoom. |
| Trace image | phy v2.1’s TraceImageView: the trace window as an image (blue negative, red positive), following the Trace window, filters and origin. |
| Spike data | phy’s Spike*Views: any spike_<name>.npy against time (1-D) or as x vs y (2-D), Ctrl-click lasso and K to split. A closed lasso is the app-wide spike brush (brushed spikes draw in ink in every spike view); hovering a point (within 6 px) highlights it everywhere; Shift-drag along a 1-D attribute sets the time range. |
| Summary | Selection summary: cluster ids, spike counts and labels. |
| Waveforms | Every valid spike’s waveform plus the full-set mean per selected cluster on four shared channels by default. Hover and press M to toggle mean-only versus all-spike overlays; each press switches back, without clicking the pane. Loading runs in cancellable background batches and shows progress and valid/total spike counts, never labeling a 100-spike sample as “all.” All selected clusters use the same channel boxes; selecting comparison clusters never adds channels. A four-channel tetrode shows all four channels. Larger recordings use the primary cluster’s peak and nearest channels in its channel group; ⚙ → channels explicitly allows more. Uses probe positions when available, otherwise a simple channel grid—not a peak-only fallback. Spikes, mean and template modes share the same channels. Snippets follow Trace HP/CMR. Shift+click a box toggles it in the Features channel set; Ctrl+click / Ctrl+right-click makes it A / B. Features’ lassoed spikes and optional PC shapes remain linked. |
| Templates | phy’s TemplateView: every cluster’s template on its peak channel, in table order, the selection outlined; click selects, Ctrl/Shift-click adds. |
| Amplitudes | phy’s AmplitudeView: template, feature or raw amplitude over time (A cycles), grey background spikes on the peak channel, a per-cluster histogram, Ctrl-click lasso and Alt-right-drag threshold, K splits; Alt-click seeks the trace. The lasso or threshold is the spike brush (ink points everywhere); hovering a point (within 6 px) rings it and draws its time line in Raster, Rate, Drift and Trace; Shift-drag sets a time range (spikes outside fade, or hide with only in range), Shift-click clears it. |
| ISI | Inter-spike interval histogram per cluster. Click the shaded refractory band or a cluster’s violation chip to brush every spike that is part of a violating pair; hovering shows “N spikes in M violating pairs”. With a Features/k-means lasso brush on one selected cluster, the pane overlays that cluster’s split what-if (inside dashed, outside dotted, with each part’s refractory share), Quality adds green/red “if split · inside / outside” rows with composite deltas, and Waveforms draws the two means dashed and dotted. Hovering a Similar/Suggest row adds a grey dashed ghost mean in Waveforms and a grey “cN (ghost)” row and column in CCG. |
| CCG | Auto- and cross-correlogram grid across the selected clusters (memoised per selection). |
| Features | Phy’s full 4×4 grid of PC1/PC2 on channels A and B, with time on the diagonal and grey background spikes. All 16 projections are visible together at narrow, normal and maximized sizes; the grid fits the pane’s width and height. There is no projection navigator or replacement single-cell view. The channel set (default the selection’s best four) is edited from Waveforms or Probe: Shift+click toggles a channel, Ctrl+click / Ctrl+right-click sets A / B; C fixes A/B. Uses sorter PC features when present, otherwise PCs fitted on raw snippets. Ctrl+click or Ctrl+drag a lasso; K splits and Esc cancels. K-means can lasso a part and show collision evidence directly on the projections. Secondary controls and alternatives do not interrupt the projection matrix. The 2D|3D toggle explicitly switches to the inspection-only 3D scene. A lasso or k-means part becomes the linked spike brush, Alt+click seeks Trace, and Shift+drag a time cell sets the time range. |
| Raster | Every spike of every cluster, time on x, cluster row on y. Selected rows are highlighted and the current trace window is outlined; click to seek. Brushed spikes are full-height ink ticks; Shift-drag sets the time range, drawn as a band. |
| Rate | Firing rate over the recording, in Hz, one line per selected cluster; bin count (:frn, :frb) and time unit (s, min, h) in the header. Shift-drag sets the time range, Shift-click clears it; the hovered spike’s time is a vertical line. |
| Probe | Channel layout from probe geometry with a ring on each selected cluster’s peak channel. It is also the Features channel picker: set members get a selection ring (A and B a badge), the focused plot’s channels a strong ring; Shift+click a site toggles it in the set, Ctrl+click makes it A, Ctrl+right-click B. |
| Similar | Clusters whose template is most similar to the first selected one. Click a row to compare, Cmd/Ctrl-click to add it to the selection. Hovering a row ghosts that cluster in the other views (as a merge into the first selected cluster) and shows the merge preview delta (composite, contamination) in a tooltip; Suggest merge rows do the same. Hovering a History row ghosts the clusters before that edit in Features 3D. |
| Stats | Histograms of spike count, mean amplitude and ISI violations across all clusters. |
| Quality | Composite quality breakdown (refractory, presence, coverage, SNR, completeness, stability, isolation). Computed on a background thread; a spinner shows while it runs. |
| Suggest | Ranked merge and split suggestions with predicted outcomes. Ranked on a background thread; curation stays responsive while it runs. |
| Drift | Spike depth (µm, Kilosort 4 spike_positions.npy y, else PC-weighted centre of mass, else template peak) over time with a regression line per cluster; amplitude over time when the backend has no depth estimate. Brushed spikes draw in ink, the hovered one is ringed; Shift-drag sets the time range (outside points fade). |
| Contam·time | Sliding refractory contamination over the recording. |
| Tmpl features | phy’s TemplateFeatureView: with two clusters selected, each spike projected on both clusters’ templates (template_features.npy), Ctrl-click lasso, K splits; a closed lasso is the spike brush. |
| Scatter | phy v2.1’s ClusterScatterView: one point per cluster, x / y / size from amp, depth, fr, n_spikes or ch; click selects, Shift-click adds, Ctrl-click lasso selects. |
| PSTH | Event-aligned firing rate per selected cluster plus a per-trial raster of the first one. Needs events.csv (time,label, seconds) or events.npy next to the dataset, an NWB file’s /intervals/trials table, or --events FILE; pick the label, pre/post window and bins in the toolbar. |
Feature navigation. Plain drag pans the whole 4×4 projection grid, and the wheel zooms it like a single image around the pointer: the projection squares, the gaps between them and their captions scale together. A modest zoom enlarges the visible projections so they can be inspected, and panning brings an enlarged square fully into view. Double-click resets the zoom and pan so all sixteen projections fit the pane again. Ctrl-wheel still scales PC features and Alt-wheel changes marker size. Plain-wheel zoom and drag do not change axis ranges, the lasso polygon, spike brush or cluster data, or relayout the pane, reset the channel set or change the default grid; the toolbar and alternatives strip stay fixed. Esc abandons the lasso and a pending cut, clearing its linked spike highlights without changing the clusters; Undo reverses a completed split.
Lasso tracking. With live tracking unchecked (the default), a Ctrl-click
polygon stays a draft between clicks: only its outline changes, not the spike
selection or linked previews. Release Ctrl to finish it, then press K to cut;
K also finishes the current valid polygon directly. Node drags settle on
mouse-up. Large hit-tests and highlight-buffer builds run off the UI thread,
and a cut does not wait for a preview to finish. Esc cancels without editing.
Refractory-period settings
Set the windows in Settings → Refractory-period settings, or pass these flags when opening a recording. GUI settings are saved as defaults for new sessions, and each launch flag overrides its saved value for that session. Saving Settings applies only the fields you changed to open sessions, so a flag or MCP value for any other field stays in force.
| Parameter | CLI flag | Default | Source |
|---|---|---|---|
Fixed (fixed_ms) | --refractory-ms | 1.5 ms | SpikeInterface compute_isi_violations |
Sweep minimum (sweep_min_ms, exclusive) | --rp-min-ms | 0.5 ms | SpikeInterface exclude_ref_period_below_ms; IBL slidingRP rp_reject |
Sweep maximum (sweep_max_ms, inclusive) | --rp-max-ms | 10 ms | SpikeInterface max_ref_period_ms; IBL slidingRP upper limit |
Sweep step (sweep_step_ms) | --rp-step-ms | 0.25 ms | SpikeInterface bin_size_ms |
The first tested window is minimum + step: the default grid runs from 0.75 to 10 ms in 38 windows. For Bombcell’s 1 ms first window, set the exclusive minimum to 0.75 ms and keep the default step. The legacy rp_contamination and rp_estimate_ms columns still report the minimum of a linearised Hill estimate and its window. That estimate can be biased low when short windows have no violations.
The MCP tool refractory returns the current and default parameters without arguments. Supply any of the four fields to update the live session, including its attached GUI, without changing the saved GUI defaults. metrics includes the settings it used under refractory.
Refractory evidence in QC
sorrel qc, MCP metrics, and rules expose these columns. In the GUI, hover over a cluster’s coloured badge in the ISI view to see both results.
| Column | Meaning |
|---|---|
srp_contamination | Nominal upper limit: the smallest contamination fraction the sliding-RP test confirms at confidence strictly above 90%, under the model below. |
srp_rp_ms | Window (ms) of highest confidence at the reported fraction, IBL’s estimate of the unit’s refractory period. |
rpv_post_mean | Posterior mean contamination fraction at the session’s fixed window (not the SRP window), conditional on the model below. |
rpv_post_lo95 | Lower bound of the shortest 95% credible interval. |
rpv_post_hi95 | Upper bound of the shortest 95% credible interval. |
Both metrics count all spike pairs with a positive lag strictly inside the window, not just consecutive ISIs. Exact duplicates (zero lag) are not counted, so they need their own check. Windows are rounded to sample edges, and a window of e samples is charged e − 1 samples of exposure, which is what integer lags 1 to e − 1 can observe. IBL charges the full window; the difference is small at 30 kHz but matters on coarse timestamps, where IBL’s charge would understate contamination. Windows shorter than two samples or at least half the recording long are skipped. The sliding-RP test (Roth et al., 2026) uses a fixed 0.5–35% contamination grid in 0.5 percentage-point steps, with no correction for testing multiple windows. Sorrel uses the configured sweep above, rather than IBL’s every sample bin above 0.5 ms. The SRP columns are unavailable if no tested fraction reaches confidence; this does not distinguish contamination above 35% from too few spikes to tell.
The posterior uses a uniform Beta(1,1) prior on the contamination fraction and a Poisson likelihood with the same expected-violation model as the sliding test (Llobet et al., 2022). Both results assume stationary spike rates, a window no longer than the neuron’s true refractory period, and diffuse contamination: contaminating spikes arrive as a Poisson process, so they also violate each other. A unit whose contamination comes from one other refractory neuron produces fewer violations than this model expects, so both results understate it. If the posterior sits near 100% while the sliding test passes at a shorter window, the fixed window is probably longer than this unit’s refractory period. The interval is the shortest 95% credible interval, so with no violations it starts at 0. An interval from near 0 to high values means too little data to tell; one bounded well above 0 can still be wide, because the expected violations flatten as contamination nears 100%. The flat prior pulls the mean of a sparse unit towards 50%, so read the interval, not the mean alone. A unit firing in bursts, or drifting, can show more violations than any contamination explains, which pins the posterior near 100%. With fewer than two spikes or invalid recording duration or sample rate, both results are unavailable (NaN in Rust, null in JSON and blank in TSV).
For example, this rules.toml policy labels a unit mua only when the evidence says contamination exceeds 10%, that is when the posterior’s lower bound does. To find units that are merely uncertain (a wide interval, as with very few spikes), run rules_eval with rpv_post_lo95 <= 0.1 and rpv_post_hi95 > 0.1 together (all = [...]) and review them instead of relabelling.
Two traps when writing such rules:
- A rule never matches a missing (
NaN) value. Withdefault = "good", a rulesrp_contamination > 0.1labels every unit with a missingsrp_contaminationgood, including heavily contaminated ones. Write it the other way round:default = "mua"withsrp_contamination <= 0.1labellinggood. - The posterior uses the fixed window. If it is longer than a unit’s refractory period, as 1.5 ms can be for fast-spiking interneurons, a clean unit shows high contamination there while
srp_contaminationpasses at a shorter window. Lower Fixed for such recordings, or checksrp_contaminationbefore acting on the posterior.
[[rule]]
name = "refractory contamination"
metric = "rpv_post_lo95"
op = ">"
value = 0.1
label = "mua"
Stable epochs
Thin lines in the Amplitudes view mark fitted changes for the selected units, using their stored sorter amplitudes regardless of the displayed amplitude type. The lines are hidden when Ctrl+R reorders spike times. probe epochs C lists each interval in seconds with its spike count, firing rate (Hz), and signed mean amplitude. QC exports, MCP metrics, and rules expose these summaries:
| Column | Meaning |
|---|---|
n_epochs | Number of fitted segments, including 1 if no change was found. |
epoch_amp_ratio | Smallest divided by largest magnitude of the segment mean amplitudes. |
epoch_rate_ratio | Lowest divided by highest segment firing rate; 1 for a single segment. |
The fit divides the recording into 100 equal bins and finds the exact best piecewise-constant fit, with segments at least 5 bins long. Each bin gives two series: its spike count and the mean stored amplitude of its spikes. The count costs its Poisson deviance from the segment’s rate, divided by a dispersion measured from differences between neighbouring bins (never below the Poisson value). The amplitude costs its squared distance from the segment’s level, weighted by spike count and scaled by a noise level from robust differences between neighbouring bins; it widens when neighbouring bins are correlated, as when amplitudes drift on a timescale close to the bin width. Taking the noise from the data covers bursty firing and rounded amplitudes. Each series’s cost in a bin is capped at 9 (3 noise units squared; up to 18 when both rate and amplitude are fitted), after the biweight loss of Fearnhead & Rigaill (2019), JASA 114:169–183, so a burst or a stray bin cannot buy a boundary alone. Each fitted level costs ln 100 (a rate per segment, plus an amplitude per nonempty segment when fitted) and each boundary 2 ln 91 for the search over its position.
Missing or invalid amplitudes, or fewer than 21 nonempty bins, give a rate-only fit, and silent segments fit no amplitude. probe epochs marks each interval fit=rate or fit=rate+amp, and still shows descriptive means when amplitudes are valid but not fitted. Because a boundary in a fit=rate+amp unit also pays for an amplitude level, such units need a larger rate change to split; compare n_epochs and epoch_rate_ratio between units with the same fit. The amplitude ratio is unavailable if amplitudes were not fitted, any segment is silent, or the largest mean magnitude is zero. A single segment with a fitted nonzero mean has ratio 1. All three summaries are unavailable with fewer than 10 spikes, recordings shorter than 20 s (200 ms bins), or invalid recording timing (NaN in Rust, null in JSON, blank in TSV).
Boundaries are change points of a step model, not transition times. A gradual drift becomes a staircase whose edges fall wherever the fit is cheapest, and the ratios compare segment means, so they understate the end-to-end change. In simulations, a linear 100 → 55 amplitude ramp over the recording (5 Hz, SD 10) gave 4 to 5 segments and a median epoch_amp_ratio of 0.63. Slow firing-rate modulation splits too: a ±40% rate oscillation with a 50 s period split 70% of 100 s recordings. Some steady units also split: bursts whose spike amplitudes shrink within the burst (23% of simulated units), and amplitude fluctuations that last several bins, which are likelier at low firing rates or in short recordings (a spike-to-spike amplitude correlation of 0.75 split 14–19% of units at 1–2 Hz over 100 s, or at 5 Hz over 20 s).
A rate-only change is not by itself evidence of dropout: behaviour can change firing rates. For example, try epoch_amp_ratio < 0.6 as a review rule in rules_eval, then inspect where the change occurred. To split at a boundary, copy the reported time into split C by=time at=T in probe; probe epochs suggests this only when some boundary has spikes on both sides. The handle moves spikes at or after the boundary, matching the fit’s half-open intervals. Applying it is journaled and undoable; the fit itself makes no edits.
Cross-talk (Sorrel extra). The views share four kinds of state, so a pick in one shows in all the others:
- Spike brush. One set of spikes at a time, and the last writer wins. It comes from a Features lasso or k-means part, an Amplitudes lasso or threshold, a Spike data or Tmpl features lasso, or the ISI refractory band. Every spike view draws the brushed spikes in brush ink: white in dark, near-black in light. With a lasso or k-means brush, ISI, Waveforms and Quality also preview the split: the inside part dashed, the outside part dotted, and “if split” rows with the change in composite score.
- Time range. Shift-drag along a time axis (Amplitudes, Rate, Drift, Raster, Features’ time cells). Spikes outside it fade, or hide with only in range.
- Hovered spike. The spike under the pointer in Features, Amplitudes or Spike data, or the one clicked in Trace. It is ringed in the point views, marked with a line in the time views, and drawn bold in Waveforms. Alt-click seeks Trace to it.
- Ghosts. Hovering a Similar or Suggest row shows that cluster as a grey ghost (points, dashed mean, CCG row, 3D hull) with the merge’s quality change. Hovering a History row shows the clusters as they were before that edit, as dashed hulls in Features 3D.
The brush and the time range appear as chips in the top bar. Click a chip’s × or press Esc to clear them. A curation edit drops the brush, because its spike indices no longer mean the same spikes.
Features 3D (Sorrel extra; the 3D toggle in the Features header) shows
the same points in three dimensions of the channel set (time, then PC1 and
PC2 on every channel: 17 dimensions and 680 triples for eight channels)
behind an orbit camera. It is for inspection only: lasso, k-means and split
stay in the 2D grid. Every triple of the set is ranked by how well it
separates the selected clusters (mean simplified silhouette on at most 5000
points, every axis scaled to 0–1); with one cluster selected the k-means parts
are the labels, and with no parts the total variance. A wide pane lists the
top 20 in a sidebar with a score bar and a show all N toggle that expands
the list into a scroll area; a narrow one offers the top 20 in a combo box.
Your pick is remembered as its three axes, so it survives re-ranking, and
gives way to the best triple when the channel set changes and one of its axes
is gone. The focused 2D plot is pinned when you enter 3D (a
“pinned · x × y ×” chip under the toolbar, following the focused cell): only
the triples holding both its axes are listed, as “+ third axis” rows, and the
best of them is the default. × on the chip lists every triple; the “pin x
× y” button pins again. The channels of the triple on show are highlighted in
Waveforms. Each selected cluster gets a convex hull of the 95% of its
points nearest the median: translucent and filled for sorter-made (Auto)
units, wireframe for Sorrel-made ones. A cluster made by a split also shows
its parent before the split as a dashed grey hull (the union of the siblings
the split produced; merged units show only their current hull). A closed
lasso is extruded along the third axis as a prism when its two dimensions are
both in the triple, otherwise a note says which triple shows it. The k-means
part on show gets a dotted hull in the link colour, and its points turn white
(dark theme) or black (light). The legend names every cluster with its origin
(Auto[kilosort4], Sorrel[Manual], …) and each overlay. Drag orbits, Shift-drag (or
middle-drag) pans, the wheel zooms and double-click resets the camera.
Cross-talk in 3D: the app-wide spike brush (a Features lasso, k-means part,
ISI violators, …) draws its spikes in brush ink (white in dark, near-black in
light), a little bigger and on top; the time brush fades the spikes outside
its range, or hides them with “only in range”. The pointer picks the nearest
spike within 6 px, which rings it in the accent colour here and in every other
spike view (and the ring follows a spike hovered elsewhere). Hovering a
Similar or Suggest row draws that cluster as a grey dashed hull (“ghost cN”);
hovering a History row draws each cluster the edit changed as it was before it
(dashed, “before #n”, restricted to the spikes shown). The Features colour mode
(time, depth) colours the points the same way as the 2D grid. With spike depths
available (the Drift map’s source) the space family joins the axes: depth
takes part in the ranked triples like any PC, and so does x when the Kilosort 4 directory has spike_positions.npy (which also becomes the Drift map’s depth, y being the depth).
The Trace toolbar offers per shank CMR when the probe has more than one
shank (channel_shanks.npy), referencing each shank by its own median.
Plots follow the egui theme, so light mode renders light plot backgrounds.