BrainViz is a lightweight Chrome extension designed for researchers, students, and clinicians working with brainwave data. It enables fast and intuitive visualization of EEG signals from .txt and .edf files directly in the browser, with filtering, channel control, and PSD analysis.
- .edf and .txt Support: Upload EEG signals from common biomedical formats
- Auto File Interception: Detects and opens EEG downloads from PhysioNet and similar sources
- Offline File Viewer: Manually upload files via the popup panel
- Interactive UI: Play, scroll, and zoom through signal windows
- Channel Selection: Toggle and focus on individual EEG channels
- Stacked & Compact Modes: Choose between clinical-style or overlay visualization
- Filtering Tools: Apply bandpass, lowpass, highpass, or notch filters (50Hz/60Hz)
- Real-Time Time Slider: Navigate large EEG datasets with a draggable canvas-based slider
- Python-Powered Filtering: Uses Pyodide with SciPy for advanced signal processing
- Power Spectral Density (PSD): Generate PSD plots to observe signal frequency patterns
- Channel-wise PSD: Analyze frequency band activity per selected channel
- Overlay Comparison: Preview multiple channel spectra
- Band Topomaps: Visualize Delta, Theta, Alpha, and Beta frequency bands as brain topographic maps
- Download Detection: Intercepts
.edfor.txtEEG downloads for instant preview - Storage Fallbacks: Uses IndexedDB and Chrome storage for large file handling
- Clone this repository:
git clone https://github.com/your-username/brainviz.git
cd brainviz- Load in Chrome:
- Open
chrome://extensions/ - Enable Developer Mode
- Click Load unpacked and select the root project folder
- Click the BrainViz icon in your Chrome toolbar
- Use the popup to upload an EEG file manually or intercept a download
-
EEG files auto-open the signal viewer UI
-
Use the top menu to:
- Select channels
- Apply filters
- Toggle PSD or stacked mode
- Toggle Topomap on PSD Screen
- Use the slider to scroll across the EEG timeline
- Click "Show PSD" for frequency analysis
- View brain topomaps for different frequency bands
- Export results or view channel overlays
- View multiple channels aligned with timestamp labels
- Adjust signal amplitude scale (e.g., 2 Β΅V/mm)
- Switch between compact/stacked view
- Filter dropdowns
- PSD toggle button
- Canvas-based EEG window slider
- Channel checkbox panel
.edf(standard EEG format).txt(structured signal arrays)
BrainViz/
βββ icons/ # Extension icons
β βββ Brainviz16.png
β βββ Brainviz48.png
β βββ Brainviz128.png
β
βββ libs/ # JavaScript libraries and Python packages
β βββ EdfDecoder.js # EDF file decoder
β βββ jsEDF.js # JavaScript EDF parser
β βββ plotly.min.js # Plotly.js for data visualization
β βββ pyodide.js # Python in the browser runtime
β βββ pyodide.asm.js # Pyodide WebAssembly interface
β βββ pyodide.asm.wasm # Pyodide WebAssembly binary
β βββ pyodide-lock.json # Pyodide package lock file
β βββ python_stdlib.zip # Python standard library
β βββ numpy-1.26.4-cp311-cp311-emscripten_3_1_46_wasm32.whl # NumPy for signal processing
β βββ scipy-1.11.2-cp311-cp311-emscripten_3_1_46_wasm32.whl # SciPy for filtering
β βββ openblas-0.3.23.zip # Linear algebra library
β
βββ background.js # Service worker (background logic)
βββ contentScript.js # Injected into pages to enable EEG detection
βββ eegStorage.js # Handles large file storage using IndexedDB
βββ index.html # Extension popup UI
βββ manifest.json # Extension configuration (Manifest v3)
βββ popup.js # Logic for popup panel and file upload
βββ scriptInjector.js # Injects scripts into web pages for EEG detection
βββ viewer.html # EEG viewer interface
βββ viewer.js # EEG signal rendering and analysis logic
βββ privacy-policy.md # Privacy policy for Chrome Web Store
βββ README.md # Project documentation
- Interception may fail if page disables content scripts or uses custom download logic.
| Issue | Solution |
|---|---|
| EEG file is downloaded | Check that "Intercept Downloads" is ON in the popup |
| Viewer shows "No Data" | Make sure your file has valid headers and numeric rows |
| Content not displaying | File may be HTML or invalid EEG data (check devtools/network tab) |
| Not working on some pages | Some domains restrict extension scripts (e.g. chrome:// or sandboxed pages) |
| Python engine not ready | Wait a few seconds for Pyodide to initialize before using filters |
| Topomaps not showing | Ensure at least 3 channels are selected and mappable to electrode positions |
No npm build step required. This is a vanilla JS/HTML/CSS extension using Chrome Extension Manifest V3 with Pyodide for Python functionality.
To test changes:
- Reload extension in
chrome://extensions/ - Click icon and try file upload or download interception
- Open Chrome DevTools on viewer.html or popup
- Use
console.log()in background.js and viewer.js to trace events - Monitor
chrome://extensions/for errors
This extension processes EEG files locally in your browser using client-side Python via Pyodide. No user-identifiable data is collected, transmitted, or stored on external servers. All signal processing happens entirely within your browser.
- Report issues via GitHub Issues
- For feature requests or academic collaboration, contact: support@mieweb.org
-
Supported by MIE
-
JavaScript Libraries:
- Plotly.js- Interactive data visualization
- jsEDF.js - JavaScript EDF file parser
- EdfDecoder.js - Additional EDF decoding capabilities
-
Python in Browser:
- Pyodide - Python scientific stack in WebAssembly
- NumPy - Numerical computing for signal processing
- SciPy - Scientific computing and signal filtering
- OpenBLAS - Optimized linear algebra library
-
EEG Dataset Support:
- Testing with PhysioNet datasets
- 10-20 International System electrode positioning
-
Browser APIs:
- Chrome Extension APIs (Storage, Downloads, Tabs)
- IndexedDB for large file handling
- Web Workers for background processing