Phase-locked stimulation of a simulated seizure

New here? Read the guide ↓

A model seizure is running below. Press Space or Stimulate now to deliver one brief pulse, then watch whether the seizure stops. That depends on how strong the pulse is and on where in the seizure wave it lands. This is a simulation for research, not a clinical tool.

Time the pulse to a phase of the wave
Or time it: °

observed EEG (with noise) noise-free EEG, with landmarks ticked tracked phase pulse; shaded: 15-ms blank
No pulse yet. Press Space or Stimulate now to deliver one.
truetracked ± SDtarget

Phase: position within the current seizure wave, 0° at its landmark (the upward crossing of a fixed level by the noise-free EEG) and 360° one period later. Click or drag the dial to set the target.

seizure cyclestateafter a pulse

terminatednotfilled: biphasic, ring: monophasic

Your pulses so far: angle = true phase at the pulse (0° at top, clockwise), distance from the centre = amplitude.

Pulses

Terminated: the noise-free EEG's peak-to-peak over the last period of the 2 s after the pulse is below 15% of the seizure cycle's. Rsupp: RMS of the noise-free EEG over the two cycles before the pulse divided by that over the two cycles after the 15-ms blank (early) or over the last two cycles of the 2 s (late).

#deliverytrue phasetracked phaseamplitudecharge / phasepulseoutcomeRsupp earlyRsupp latetime to term.

Guide

What this page is

In these models a seizure is a rhythm the tissue gets stuck in: the same wave, repeating a few times a second. With the same settings the model can also sit quietly at rest. A brief electrical pulse can knock it from the seizure back to rest, but only if the pulse is the right size and arrives at the right moment in the wave. This page lets you test that by hand.

Two published models are available. The Neural mass (Wendling et al. 2002), which the page starts on, describes interacting populations of excitatory and inhibitory neurons. The Epileptor (Jirsa et al. 2014) is an abstract model of seizure dynamics.

Try this first

  1. Watch the top trace for a few seconds. It is the simulated EEG during a seizure.
  2. Press Space a few times, a few seconds apart. Each press delivers one pulse (the orange line). Two seconds later, the line under the trace says whether the seizure terminated. Most presses will fail: with the starting settings, only a pulse that lands in roughly the first third of the wave (0° to 105°) stops the seizure.
  3. If it stopped, press Start seizure to bring it back.
  4. In the Example menu choose “Neural mass: a phase that terminates”, then “Neural mass: same amplitude, a phase that fails”. The pulse is the same; only its timing differs.
  5. Set Speed to 0.1× and run an example again while watching the phase plane. The orange path shows where the pulse pushed the model.

Stimulation (top box)

Stimulate now, or Space
Delivers one pulse immediately. While paused, the pulse waits for the next step.
Pulse amplitude
How strong the pulse is. Too weak does nothing. In the neural mass, too strong also fails. In the Epileptor, a strong enough pulse works at any phase, so the timing only matters in a narrow range of amplitudes.
Biphasic / Monophasic
Biphasic is a push followed by an equal and opposite push, so the net charge is zero, as stimulators normally deliver. Monophasic is the first push only.
Target phase
The moment in the wave to aim for, in degrees. 0° is the landmark where the wave crosses a fixed level on its way up, and 360° is one full wave later. Type it, or drag the dial.
True phase / Tracked phase
Which clock times the pulse. The true phase is read from the noise-free model, which only a simulation can know. The tracked phase is estimated from the noisy EEG, as a device would have to. The tracker needs about 6 s to settle and calibrate, and it holds fire while its uncertainty is 40° or more.
Arm
Waits until the chosen phase reaches the target, then fires one pulse.
Repeat until it stops
Keeps firing at the target: at most one pulse per wave, at least two waves apart, and at most 10 per seizure.
Random-time pulse
One pulse at a random moment in the next wave, to compare with a timed pulse.
Start seizure
Puts the model back into the seizure after it has stopped.

Running the model

Neural mass / Epileptor
Switches the model. Each starts in its seizure.
Example
Worked cases. Choosing one restarts the seizure, sets the pulse and the target, and arms one pulse.
Pause, Step 5 ms, Reset
Step advances the paused model 5 ms per press. Reset restarts the seizure and clears the traces; the table of pulses is kept.
Speed
1× is real time. 0.1× is slow enough to follow what a single pulse does.
Model parameter
Moves the model towards or away from seizure. Inside the grey bar, rest and seizure coexist, so a pulse can switch between them. Outside it only one of the two exists.
Signal-to-noise ratio
How much measurement noise is added to the observed EEG. It never touches the model; it only makes the tracker's job harder.

Reading the displays

EEG, last 5 s
Top lane: the EEG as measured, with noise. Middle lane: the noise-free EEG, with a tick at each landmark. Bottom lane: the phase, true in grey and tracked in blue, with the target dashed. An orange line marks each pulse; the shaded 15 ms after it is ignored by the tracker, as a stimulation artifact would be.
Dial
Grey hand: true phase. Blue hand: tracked phase, with an arc for its uncertainty. Orange marker: the target.
Phase plane
Two of the model's variables plotted against each other. The closed loop is the seizure and the open circle is rest. The dot is the model now. The orange path is the 1.2 s after the latest pulse, starting at the ring, and it ends in a green dot if the seizure terminated or a red one if not. Earlier pulses fade quickly. Where pulses lead tries a pulse of the current size from 36 points around the loop. Green means it ends at rest, red that the seizure returns, and the thick line is the path for your target phase. The neural mass shows every path. The Epileptor shows a ring where each pulse starts and a dot where it leaves the model. For the Epileptor, Flow and separatrix adds arrows for the direction of motion and the dashed boundary that divides the green dots from the red.
Outcome map
Every pulse you have delivered: angle is its phase, distance from the centre is its amplitude, green means terminated. Keep going and the pattern of what works appears.
Pulses table
One row per pulse. Rsupp is how much smaller the EEG became: 1 means no change, large values mean the seizure was suppressed.