Clinical Overview & Biophysical Mapping
SeizureZone acts as an interactive bridge between clinical seizure semiology—the structural taxonomy of subjective and objective manifestations during an ictal event—and the corresponding cortical regions parcellated in the Destrieux Atlas (Destrieux et al., 2010). During an epileptic discharge, the hypersynchronous firing of neuronal populations creates a localized electrical fields that propagate along white matter tracts. Finding the origin of these discharges involves delineating the spatial boundaries of multiple physiological zones, primarily the Symptogenic Zone ($SZ$), which refers to the specific region of the brain whose excitation generates the clinical symptoms, and the Epileptogenic Zone ($EZ$), representing the neural network whose complete resection or isolation is necessary to produce seizure freedom.
Within clinical electrophysiology, network-level seizure dynamics can be modeled mathematically. By treating cortical parcels as coupled nonlinear oscillators, the propagation of ictal wavefronts can be approximated using a coupled differential framework:
$$ \frac{d\vec{x}_i}{dt} = \mathbf{F}(\vec{x}_i) + K \sum_{j=1}^{N} A_{ij} \mathbf{H}(\vec{x}_j - \vec{x}_i) $$
where $\vec{x}_i$ is the state vector of the $i$-th cortical parcel, $\mathbf{F}(\vec{x}_i)$ represents local intrinsic neural dynamics, $K$ is the global coupling strength, $A_{ij}$ is the structural connectivity matrix representing white-matter tracts (the structural connectome), and $\mathbf{H}$ models the inter-areal coupling function. The coordinate transformation mapping individual mesh coordinates to standard stereotaxic space (Montreal Neurological Institute, or $MNI$ space) is defined through a homogeneous registration matrix:
$$ \begin{bmatrix} X_{\text{MNI}} \\ Y_{\text{MNI}} \\ Z_{\text{MNI}} \\ 1 \end{bmatrix} = \mathbf{T} \begin{bmatrix} X_{\text{mesh}} \\ Y_{\text{mesh}} \\ Z_{\text{mesh}} \\ 1 \end{bmatrix} $$
Through these structural representations, SeizureZone provides an intuitive educational visualizer showing how localized hyper-excitation of targeted cortical regions produces observable clinical signs—such as visceral auras from the insula, gustatory hallucinations from the uncus, or localized clonic motor contractions from the precentral gyrus ($lh.pial.Destrieux.G\_precentral$).
How To Use the Visualizer
The interface is organized into a primary visualizer container (left) and a seamlessly integrated, unconstrained clinical control panel (right).
- Anatomical Selection: Browse the "Seizure Semiology Target" list on the right sidebar. Selecting a case (such as "Difficulty in Speech Production") updates the 3D visualizer to isolate and highlight the corresponding cortical meshes (e.g., the inferior and middle temporal gyri) in the configured focus color. The full list is visible at once for rapid traversal.
- Floating Canvas HUD: The active clinical description is projected directly onto the 3D workspace. This frosted glass panel allows you to read the medical context without diverting your eyes from the rendering model. You can rotate the brain model even when clicking or dragging over the floating text panel.
- Base Brain Opacity: Use the "Cortical Transparency" slider to adjust the base brain transparency. This allows highlighted deep-seated structures, such as the insular cortex or cingulate gyri, to stand out clearly against superficial cortical networks.
- Yaw Rotational Velocity: Adjust the "Yaw Rotational Velocity" slider to change the continuous horizontal rotation speed of the model, allowing you to observe highlighted structures from various angles autonomously.
- Ictal Focus Dye: Modify the active focus color of highlighted meshes using the dropdown menu. Options include Crimson, Amber, Emerald, and Sapphire to map multiple hypotheses.
- Web Audio Bio-Signal Pitch: Adjust the "Bio-Signal Probe Pitch" slider to modify the diagnostic audio frequency (ranging from $200\text{ Hz}$ to $900\text{ Hz}$). Toggle audio output via the "Mute Audio" button.
- Demo Mode: Click "Start Demo" to initiate an automated, physiologically paced tour of clinical cases and diagnostic modifications. The panel will automatically scroll to keep the highlighted target in focus. Any manual interaction instantly interrupts the sequence and returns control to the user.
Technical Details & Graphical Pipeline
SeizureZone renders high-density polygon surface reconstructions ($lh.pial$ and $rh.pial$ meshes) parsed from MRI-reconstructed Freesurfer data. The visualization uses a WebGL rendering pipeline with the Three.js (r128) library. The canvas sizing algorithm recalculates dimensions using device pixel ratios ($DPR$) to maintain high-DPI quality across displays.
$$ DPR = \text{window.devicePixelRatio} $$
This is scaled with the physical client bounding box:
$$ w_{\text{backstore}} = w_{\text{client}} \times DPR, \quad h_{\text{backstore}} = h_{\text{client}} \times DPR $$
By disabling automatic inline style updates via `renderer.setSize(w, h, false)`, the system prevents infinite layout scaling loops within responsive CSS grid configurations. The control panel abandons nested scrollbars in favor of a single master scroll architecture, significantly improving UX on touch displays.
The 3D coordinate transformations utilize homogeneous coordinate matrices to apply local rotation updates on every frame. The model yaw ($\theta_y$) is updated dynamically:
$$ \mathbf{R}_y(\Delta\theta_y) = \begin{bmatrix} \cos(\Delta\theta_y) & 0 & \sin(\Delta\theta_y) & 0 \\ 0 & 1 & 0 & 0 \\ -\sin(\Delta\theta_y) & 0 & \cos(\Delta\theta_y) & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} $$
The Web Audio synthesizer uses a standard `OscillatorNode` connected through a custom `GainNode` with an exponential decay envelope to simulate diagnostic EEG monitor spikes:
$$ A(t) = A_0 \cdot e^{-\lambda t} $$
Future Directions
Planned features for SeizureZone include integrating dynamic EEG source imaging ($ESI$) overlays. Users will be able to map active scalp potential distributions back to their cortical generators using inverse solution approximations. We also plan to integrate stereotactic EEG ($sEEG$) electrode plotting to visualize focal intracerebral target patterns:
$$ \Phi(\vec{r}) = \sum_{k=1}^{M} \frac{q_k}{4\pi\sigma \|\vec{r} - \vec{r}_k\|} $$
where $q_k$ represents localized charge values and $\sigma$ represents volume electrical conductivity. By utilizing graph theory network models, the visualizer will soon simulate the propagation of focal ictal events along structural pathways in real-time, providing students and clinicians with a clear visual representation of network-based epilepsy spread.
Explore Related Visualizers
- seizuresim/ - Brain seizure simulation and live 3D EEG layout.
- neurofeedback/ - Live neural mapping and feedback simulation tool.
- brain3d/ - 3D anatomical neurological visualizer.
- icapcaeeg/ - Brain EEG signal blind source separation cocktail party mixer.