Epilepsy surgery is a curative option for drug-resistant patients. The goal is to remove the Seizure Onset Zone (SOZ)—the brain region triggering seizures—without damaging essential functional areas.
The brain is a complex Connectome (network of connected regions). Seizures are often network phenomena, where a "hub" drives synchronization across the brain.
- Indeterminacy: It's often unclear exactly which node is the driver. Removing the wrong node fails to stop seizures.
- Invasiveness: Trial-and-error in surgery is impossible. We need a way to "test" resections virtually before cutting.
- Network Dynamics: A static map isn't enough; we need to simulate how the network behaves when parts are removed.
This example builds a Virtual Brain (Digital Twin) to simulate surgical outcomes.
-
Topology (
Graph): We model brain regions as nodes and white-matter tracts as edges, loaded from grid-like connectome data. -
Dynamics (
Kuramoto Model): We simulate synchronization. Seizures are modeled as "hyper-synchronous" states (Order Parameter$R > 0.8$ ). -
Causal Intervention (
do(resect)): We perform Virtual Resection:- Baseline: Run simulation on the full graph -> Confirm Seizure.
- Intervention: For each suspect node, strictly remove it (causal intervention implies modifying the graph topology).
- Counterfactual: Run simulation on the resected graph.
- Outcome: If synchronization drops below threshold, the resection is marked "Curative."
- Risk Reduction: Identifies optimal targets non-invasively, reducing the chance of failed surgeries.
- Systemic View: Treats the brain as a system, not isolated spots, capturing complex network failures.
- Data-Driven: Can directly ingest patient DTI-MRI connectivity matrices to build the graph.
cargo run -p medicine_examples --example epilepsy