P1 client w-threshold-tuner

Threshold Tuner

Move a peak-to-peak rejection threshold and watch the per-condition rejection counts and the resulting ERP change together.

3 claims on this page are unverified. TODO(confirm) marks a specific statement the author has not yet checked against a primary source. Everything else on this page has been reviewed. Treat a marked claim as provisional and go to the cited source rather than quoting the sentence.

Modes: default — the widget below runs in default. Use Share state to put the exact view in the URL.

Threshold Tuner

mode: default
Loading Threshold Tuner…

Data: ds-erpcore , subject sub-001, run task-P3, -0.19921875–0.80078125 s · license CC-BY-SA-4.0 · DOI TODO(confirm) · labels: algorithmic · a cropped, re-referenced or filtered derivative of the source recording. Share-alike. This asset is derived from a source whose licence requires that anything built from it carry the same licence. If you reuse it, distribute your version under CC-BY-SA-4.0 and keep the attribution below.
Kappenman, E., Farrens, J., Zhang, W., Stewart, A. X., & Luck, S. J. (2020). ERP CORE: An Open Resource for Human Event-related Potential Research. PsyArXiv. Paper DOI 10.31234/osf.io/4azqm. Dataset DOI 10.18112/openneuro.ds003069.v1.0.0, https://osf.io/thsqg/. Licensed CC-BY-SA-4.0; this is a derived asset and is distributed under the same licence (data/directory.yaml license_decision, section 13 item 15).

What it does

One subject’s epochs, two conditions, and a threshold you can drag. As the peak-to-peak criterion moves, three panels update: the histogram of per-epoch peak-to-peak values with the threshold line drawn on it, the rejection count and percentage per condition, and the ERP recomputed from the surviving trials.

The counts are real. The widget thresholds on per-epoch values precomputed for every channel of the recording, not just the channels it draws, so the number of rejected epochs is the number a pipeline would reject at that setting. The ERP panel re-averages the stored channel subset.

Controls

ControlWhat it sets
Peak-to-peak thresholdThe rejection criterion, in µV, applied to every channel
Flat thresholdThe minimum peak-to-peak below which a channel counts as flat
Condition displayShow both conditions, one, or the difference wave
ChannelWhich channel the ERP panel shows
Balance countsSubsample the better-preserved condition to match the other (seeded), to see what equal trial counts do

What to look for

default

  • Lowering the threshold improves the average up to a point, and then makes it worse: the trade between cleanliness and trials has a turning point you can see.
  • Noise in an average falls as the square root of the trial count, so rejecting 20% of trials costs roughly 10% of the signal-to-noise ratio — while a handful of genuinely contaminated trials can cost far more than that.
  • The two conditions do not lose trials at the same rate. Watch the difference between the two percentages, not just the total.
  • At some thresholds the difference wave changes visibly while both conditions are still “reasonably clean” — the threshold has become an analysis choice.
  • With counts balanced, a difference driven by unequal noise shrinks; a real effect does not.

Used in

  • L2.5 Artifact rejection strategies (default)

Data provenance

ds-erpcore — ERP CORE (Kappenman et al., 2021), CC BY 4.0, open access, per-subject downloadable. Biosemi ActiveTwo, 30 EEG + 3 EOG electrodes, 1024 Hz, CMS reference, 60 Hz mains, no software filters. One subject’s P3 epochs (target and standard), derived: epoched over the stored window, baselined, resampled and cropped to the §4.5 asset budget; the per-epoch peak-to-peak, maximum-absolute and flatness values for every channel are precomputed in Python and shipped in epochs.json.

TODO(confirm): the subject id, the exact epoch window, the sampling rate of the shipped asset and the trial counts are read from data/manifest.json and the asset sidecar once data/scripts/extract_p2_widgets.py has run; the frame’s provenance line is the authority. TODO(confirm): the author mirrors the ERP CORE entry into data/registry.yaml (§10.11 item 8).

Open the code

site/src/components/widgets/w-threshold-tuner/Widget.svelte, index.ts, README.md. Repository link: TODO(confirm) (GitHub org/repo, §13 item 3).