P1 client w-epoch-builder

Epoch Builder

Move tmin, tmax and the baseline window on real trials and watch the single-trial image, the condition averages and the difference wave update together.

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

Epoch Builder

mode: default
Loading Epoch Builder…

Data: ds-erpcore , subject sub-001, run task-P3, -1–1.49609375 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 trials, stored over a window wider than any sensible analysis window, and four boundaries you can drag: tmin, tmax, and the two edges of the baseline interval. Every change re-crops and re-baselines the stored trials in the browser, so the single-trial image, the condition averages, the difference wave and the amplitude read-outs all update together — and every number shown is recomputed from those trials rather than looked up.

Because the stored window is wider than the analysis window, the epoch moves inside real data instead of being padded. Each trial carries its condition, its reaction time, its accuracy and the gap to the next stimulus, so the image can be sorted by any of them and the overlap marker can show which epochs actually reach into the next trial.

The baseline control offers three modes — none, subtract the mean, and a regression baseline — which is the L3.1 concept pair (mean-subtraction versus baseline as a covariate) made operable rather than described.

Controls

ControlWhat it sets
tmin / tmaxThe epoch window in ms; number inputs, and draggable lines on both plots
Baseline correctionNone, subtract the baseline mean, or use the baseline as a regression covariate
Baseline start / endThe baseline interval, constrained to lie inside the epoch
Baseline presets“Just before the stimulus” and “a second earlier” — the L3.1 exercise in one click
ChannelWhich channel the image, the averages and every read-out follow
Show trials fromAll trials or one condition (filters the image only, never the averages)
Order rows byRecorded order, condition, reaction time, baseline value, amplitude in the window, or gap to the next event
Smooth overMoving average across neighbouring rows after sorting
Mark overlapping trialsFlag the rows whose epoch reaches the next stimulus
Measurement windowThe a-priori window the amplitude read-outs are taken over
Difference waveDraw target minus standard beneath the two conditions

Dragging is an accelerator; every boundary also has a labelled number input, so the widget is operable from the keyboard.

What to look for

default

  • Drag tmin and tmax. The data under them do not change — the stored window is fixed — so an epoch is a choice about what to look at, not a measurement. The trial count stays the same; only what you can measure moves.
  • Read the baseline means per condition before touching anything. If they differ, the conditions were already apart before the stimulus, and under “subtract the baseline mean” that whole difference is transferred, with the opposite sign, to every post-stimulus sample of the difference wave. That is pf-baseline-contamination in one line.
  • Do the L3.1 exercise: move the baseline window back into the pre-stimulus condition difference and watch the amplitude read-out in the fixed measurement window change while the raw data never did. The size of that change is the size of the mistake a badly chosen baseline makes.
  • Switch to the regression baseline. The correction now uses only the within-condition relationship between baseline and signal, so a condition-level pre-stimulus difference is no longer subtracted from the effect — the alternative L3.1 asks you to be able to describe.
  • Push tmax past the shortest gap to the next event and read the overlap count: those epochs contain the next stimulus’s response as well as this one’s. Sorted by “gap to the next event”, the image shows the intruder arriving as a diagonal band.

Used in

  • L3.1 Epoching and baseline (default)

Data provenance

ds-erpcore — ERP CORE (Kappenman et al., 2021), open access, per-subject downloadable. Biosemi ActiveTwo, 30 EEG + 3 EOG electrodes in a 10-20 placement scheme, 1024 Hz, CMS online reference, 60 Hz mains, no software filters, 40 participants per paradigm.

The shipped asset is sub-001’s P3 run: 200 trials (40 target, 160 standard) at four midline channels (Fz, Cz, CPz, Pz), stored over −1.0 to 1.496 s and deliberately not baseline-corrected, so tmin, tmax and the baseline can all move inside stored data. Derived: FIR band-pass 0.1–40 Hz applied at the native rate, epoched, re-referenced offline to the average of P9 and P10 (the montage has no mastoid sites; P9/P10 are the nearest stand-in), resampled 1024 → 256 Hz. Generated by data/scripts/extract_p2_widgets.py; every field above is in trials.json, which is both the widget index and the §4.5 sidecar of trials.bin, and the asset is registered in data/manifest.json. The frame’s provenance line is the authority.

TODO(confirm): the asset sidecar records a licence conflict in the source — the OSF node record for thsqg says CC BY 4.0, the per-paradigm component’s own LICENSE file says CC BY-SA 4.0, and its dataset_description.json says CC0. The site states CC BY 4.0 on the strength of the node record; the author reconciles the three (§10.11 item 8, §13 item 22) and mirrors the entry into data/registry.yaml. TODO(confirm): the dataset DOI and paper DOI are TODO(confirm) in data/directory.yaml. TODO(confirm): the reference used by the dataset’s own published processing pipeline is not recorded, so the P9/P10 stand-in is this site’s choice, not the dataset’s.

Open the code

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