Mosaics of Brain Activity
MOBA — Mosaics of Brain Activity — is an interactive 3D dashboard for clustering iEEG contacts. Pick a run from the dropdown above to see all contacts plotted on a translucent fsaverage cortex, with synced sample thumbnails on the right and live metrics below.
Each run is a method × feature_set combination. Four feature sets are available:
raw (full 129×300 ERSP), blob (valley-segmented blob feature vectors),
−101 (full-res painted ±1/0 segmentation maps), and hg (high-gamma
70–150 Hz time series). Two methods: K-Means and Hierarchical (Ward / average).
All four feature sets cluster on the same canonical sample set (high-activity-gated,
built once by lf_dataset.prepare_dataset) so cross-feature and cross-method
comparisons are valid.
Each sphere is one (patient × electrode × condition) sample, positioned at its MNI coordinate on FreeSurfer's fsaverage. Drag to rotate, scroll to zoom, right-drag to pan. Hover for a tooltip; click an electrode to highlight its sample thumbnail on the right. Color is set by the Color by filter (Cluster / Patient / Condition). The Palette button switches between the curated cohort-aware palette and a 32-color glasbey set for maximum perceptual distinctness across patients.
Thumbnails are one per (patient × electrode × condition) sample. The view toggle in the header swaps between four representations of the same sample:
Top-right badge on each card = per-sample silhouette (green ≥ 0, red < 0).
For any run saved with k_range (most KMeans + HC sweep runs), a slider
appears below the Color-by row. Scrubbing the slider re-points every sample's
cluster assignment via cluster_labels_by_k.csv — the brain, chips, samples
and metrics all update live. Label shows silhouette at the current K plus a
★ on the silhouette-optimal K. Best button jumps back to the best K.
Each chip shows the cluster's centroid thumbnail (mean ERSP for raw / hg, medoid sample with q34-style blob overlay for blob, mean painted −101 map for −101). Top-right of each chip is a patient-diversity badge:
Hover the badge for the comma-separated patient list. The denominator is the number of recording centers (BERN / GVA / MicroEPI) represented in the cluster.
Toggling cluster / patient / condition chips updates the brain, samples grid and
metrics simultaneously. High-sil only hides any sample with silhouette ≤ 0
— useful for showing the confident core of each cluster. 🧠 Brain toggles
the fsaverage cortex mesh (electrodes always shown).
Summary line counts currently-visible samples (post-filter). The two stacked bars show patient and condition makeup of that selection — a cluster dominated by one patient is a likely artifact; high patient diversity = real cross-patient pattern.
The 📄 PDF button generates a multi-page summary — one A4 page per enabled cluster, with the 3D brain colored by patient, the cluster's mean ERSP / centroid, and patient + condition breakdowns.
localStorage), scoped per run + K.
Different K cuts keep separate annotations.