Skip to content

Commit ba18b83

Browse files
committed
Document view settings controls
1 parent 0024261 commit ba18b83

5 files changed

Lines changed: 112 additions & 4 deletions

File tree

‎docs/api.md‎

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ phy: interactive visualization and manual spike sorting of large-scale ephys dat
4040
* [phy.gui.screen_size](#phyguiscreen_size)
4141
* [phy.gui.screenshot](#phyguiscreenshot)
4242
* [phy.gui.thread_pool](#phyguithread_pool)
43+
* [phy.gui.view_settings_dialog](#phyguiview_settings_dialog)
4344
* [phy.gui.Actions](#phyguiactions)
4445
* [phy.gui.Debouncer](#phyguidebouncer)
4546
* [phy.gui.DockWidget](#phyguidockwidget)
@@ -49,6 +50,7 @@ phy: interactive visualization and manual spike sorting of large-scale ephys dat
4950
* [phy.gui.KeyValueWidget](#phyguikeyvaluewidget)
5051
* [phy.gui.Snippets](#phyguisnippets)
5152
* [phy.gui.Table](#phyguitable)
53+
* [phy.gui.ViewSettingsDialog](#phyguiviewsettingsdialog)
5254
* [phy.gui.Worker](#phyguiworker)
5355

5456

@@ -731,6 +733,18 @@ thread_pool().start(w)
731733

732734
---
733735

736+
#### phy.gui.view_settings_dialog
737+
738+
739+
**`phy.gui.view_settings_dialog(title, fields, parent=None, validate=None)`**
740+
741+
Show a typed settings dialog and return its values, or ``None`` when cancelled.
742+
743+
``validate`` may return an error message. The dialog remains open until the
744+
values are valid or the user cancels it.
745+
746+
---
747+
734748
### phy.gui.Actions
735749

736750
Group of actions bound to a GUI.
@@ -1505,7 +1519,7 @@ user input.
15051519
#### KeyValueWidget.add_pair
15061520

15071521

1508-
**`KeyValueWidget.add_pair(self, name, default=None, vtype=None)`**
1522+
**`KeyValueWidget.add_pair(self, name, default=None, vtype=None, label=None, minimum=None, maximum=None, decimals=None, suffix=None, tooltip=None)`**
15091523

15101524
Add a key-value pair.
15111525

@@ -1977,6 +1991,21 @@ sizeHint(self) -> QSize
19771991

19781992

19791993

1994+
---
1995+
1996+
### phy.gui.ViewSettingsDialog
1997+
1998+
A reusable typed settings form for view-specific parameters.
1999+
2000+
---
2001+
2002+
#### ViewSettingsDialog.values
2003+
2004+
2005+
**`ViewSettingsDialog.values(self)`**
2006+
2007+
Return the settings currently entered in the form.
2008+
19802009
---
19812010

19822011
### phy.gui.Worker
@@ -7675,6 +7704,15 @@ Decrease the scaling parameter.
76757704

76767705
---
76777706

7707+
#### FiringRateView.edit_view_settings
7708+
7709+
7710+
**`FiringRateView.edit_view_settings(self)`**
7711+
7712+
Edit the histogram bin size and displayed range.
7713+
7714+
---
7715+
76787716
#### FiringRateView.get_clusters_data
76797717

76807718

@@ -7909,6 +7947,15 @@ Decrease the scaling parameter.
79097947

79107948
---
79117949

7950+
#### HistogramView.edit_view_settings
7951+
7952+
7953+
**`HistogramView.edit_view_settings(self)`**
7954+
7955+
Edit the histogram bin size and displayed range.
7956+
7957+
---
7958+
79127959
#### HistogramView.get_clusters_data
79137960

79147961

@@ -8136,6 +8183,15 @@ Decrease the scaling parameter.
81368183

81378184
---
81388185

8186+
#### ISIView.edit_view_settings
8187+
8188+
8189+
**`ISIView.edit_view_settings(self)`**
8190+
8191+
Edit the histogram bin size and displayed range.
8192+
8193+
---
8194+
81398195
#### ISIView.get_clusters_data
81408196

81418197

‎docs/changelog.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This file records user-visible changes to phy. The format is based on
88

99
Changes below are available from the latest source checkout but have not yet
1010
been included in a stable release. The current entries cover all user-visible
11-
changes committed on 23 July 2026; test-only commits are represented by the
11+
changes committed on 23–24 July 2026; test-only commits are represented by the
1212
behavior they verify rather than listed separately.
1313

1414
### Added
@@ -30,6 +30,10 @@ behavior they verify rather than listed separately.
3030
- Waveform, Amplitude, and Correlogram views support optional fixed total spike
3131
budgets across multi-cluster selections. They use fixed per-cluster budgets
3232
by default so sampling accuracy does not decrease as selections grow.
33+
- Configure per-cluster and optional shared spike budgets from **View
34+
settings** in the Waveform, Amplitude, and Correlogram view menus.
35+
Correlogram, Firing Rate, and ISI settings dialogs also expose their bin,
36+
window, range, and related display parameters.
3337
- Hidden or inactive-tab Waveform, Amplitude, and Correlogram views defer
3438
selection plotting until they become visible, retaining only the latest
3539
selection.

‎docs/gui.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@ Each graphical view has controls for:
1919

2020
The arrangement and most view settings are restored the next time phy opens.
2121

22+
### View settings
23+
24+
Open a plot's view-specific menu and choose **View settings** to edit related
25+
parameters together:
26+
27+
* Waveform, Amplitude, and Correlogram views expose independent per-cluster
28+
spike budgets and an optional shared total budget.
29+
* The Amplitude View also exposes its gray background-spike budget.
30+
* The Correlogram View also exposes bin size, window size, and refractory
31+
period.
32+
* Firing Rate and ISI views expose bin size and the displayed range. These
33+
views use every spike in the displayed clusters and therefore have no
34+
spike-sampling budget.
35+
36+
Enabled budget checkboxes map directly to integer controller settings.
37+
Disabling one maps that setting to `None`. Changes apply and replot
38+
immediately. The existing snippets and mouse-wheel controls remain available
39+
for quick single-setting changes.
40+
2241
## Selecting clusters
2342

2443
The Cluster View contains the primary selection. The first selected cluster is blue, the second
@@ -90,4 +109,9 @@ phy template-gui params.py --clear-state
90109
phy template-gui params.py --clear-cache
91110
```
92111

112+
Spike-budget controller settings are global and carry across datasets.
113+
Correlogram bin/window/refractory settings and Firing Rate/ISI bin/range
114+
settings are dataset-specific, because appropriate display scales can depend
115+
on the recording.
116+
93117
For more detail, see [Configuration and customization](configuration.md).

‎docs/performance.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ predictable runtime or memory use matters more. For example,
3232
clusters, subject to the 100-per-cluster ceiling. Small clusters keep all
3333
their available spikes and leave their unused shares for larger clusters.
3434

35+
You can change these values without a plugin: open the Waveform, Amplitude, or
36+
Correlogram view menu and choose **View settings**. **Use per-cluster budget**
37+
controls the corresponding `n_spikes_*` value, and **Use shared total budget**
38+
controls `n_spikes_*_total`. Disabling either checkbox stores `None` for that
39+
limit. The Amplitude dialog also exposes
40+
`n_spikes_amplitudes_background`. Changes apply immediately and are saved in
41+
the global Template GUI state when phy closes normally.
42+
3543
Other common cluster display limits are eight clusters for the Waveform,
3644
Feature, Amplitude, and scatter views, and 20 for histogram and Probe views.
3745
These limits control what a view plots; they do not change the table selection.
@@ -69,6 +77,10 @@ cluster, with no spike-sampling budget. Its bin count and visible time range
6977
control the histogram. The time range is saved in the dataset's `.phy/state.json`
7078
and is not reused for fresh datasets.
7179

80+
The Correlogram, Firing Rate, and ISI view menus expose their bin and range
81+
parameters together under **View settings**. These display parameters are
82+
dataset-local; changing them does not affect the controller spike budgets.
83+
7284
Some actions explicitly request `load_all=True` and bypass a display limit.
7385
That does not turn the corresponding view setting into a global analysis
7486
setting; check the action or plugin doing the calculation.

‎docs/visualization.md‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ of spikes per cluster. By default,
189189
`controller.n_spikes_waveforms_total=None`, so every displayed cluster gets
190190
its own budget. Set the total to an integer, such as `400`, to share that fixed
191191
number across all displayed clusters.
192+
Choose **View settings** in the Waveform View menu to edit both limits
193+
together. Each limit has its own enable checkbox; disabling a limit stores
194+
`None`. Changes replot immediately, while the `:wn` snippet remains available
195+
for quickly changing only the per-cluster value.
192196
The parameter `controller.batch_size_waveforms=10`, by default, specifies the number of batches used to extract the waveforms. Each batch corresponds to a set of successive spikes. The different batch positions are uniformly spaced in time across the entire recording.
193197

194198
You can select a channel with **Control+click** (this impacts the feature view). You can change the scaling of the channel positions and the waveforms.
@@ -323,6 +327,10 @@ auto- and cross-correlogram calculation. These spikes are picked randomly.
323327
See [Spike sampling and performance](performance.md) before increasing them.
324328

325329
You can dynamically change the window size and bin size with control+mouse wheel and alt+mouse wheel.
330+
Choose **View settings** in the view menu to edit the two spike-budget modes,
331+
bin size, window size, and refractory period together. The budget settings are
332+
global controller preferences; the bin, window, and refractory settings are
333+
saved for the current dataset.
326334

327335
*Note*: the central peak is artificially removed to avoid artifacts. Decrease the bin size (e.g. to 0.1 ms) if you need to visualize fine temporal structure.
328336

@@ -455,6 +463,9 @@ The parameter `controller.n_spikes_amplitudes=10000` bounds the selected
455463
spikes per cluster. The default `controller.n_spikes_amplitudes_total=None`
456464
preserves that budget for every selected cluster. Set the total to an integer
457465
to share a fixed budget across the Amplitude View.
466+
Choose **View settings** in the Amplitude View menu to edit the per-cluster,
467+
optional shared total, and gray background budgets together. Changes take
468+
effect immediately and are saved as global controller preferences.
458469

459470
*Note*: currently, this number is divided by 5 for the `raw` amplitudes, so as to keep loading delays reasonable.
460471

@@ -496,8 +507,9 @@ This generic view shows histogram related to the selected clusters. Built-in sta
496507

497508
The Firing Rate View does not sample or impose a spike budget. Its number of
498509
bins and visible time range only control how all cluster spikes are grouped.
499-
The time range is dataset-local, so a range saved for one recording does not
500-
clip a fresh dataset.
510+
Choose **View settings** in the Firing Rate or ISI view menu to edit bin size
511+
and the displayed range together. These parameters are dataset-local, so
512+
values saved for one recording do not clip or coarsen a fresh dataset.
501513

502514
![image](https://user-images.githubusercontent.com/1942359/58951704-193e5080-8792-11e9-873f-91a9115a9e7c.png)
503515

0 commit comments

Comments
 (0)