Commit fdbbe02
committed
Add comprehensive BCI neural framework integration and web control panel
This commit implements a complete BCI integration and web control system:
## BCI Integration Framework
- Base adapter architecture for standardized BCI hardware interfaces
- OpenBCI adapter with BrainFlow support (Cyton, Ganglion, Daisy)
- Synthetic data generator for testing without hardware
- LSL (Lab Streaming Layer) integration for network streaming
- Circular buffers for efficient real-time data management
- Data quality metrics (SNR, artifact detection, quality scoring)
## Top 10 BCI Repository Integration Points
1. OpenBCI (OpenBCI_Python) - Direct hardware interface
2. BrainFlow - Universal board interface
3. MNE-Python - Signal processing pipeline
4. Lab Streaming Layer - Real-time streaming
5. PyRiemann - Riemannian geometry features
6. NeuroDSP - Oscillation analysis
7. NeuroKit2 - Multi-modal physiological signals
8. MOABB - BCI benchmarking framework
9. EEGNet - Deep learning models
10. Bcipy - Real-time experimentation
## Web Control Panel
- FastAPI backend with REST API endpoints
- WebSocket support for real-time data streaming
- CORS middleware for cross-origin requests
- System state management
- Configuration endpoints for HBCM and BCI setup
- Control commands (start, stop, pause, resume, reset)
- Data export (JSON, CSV formats)
## Visualization Components
- Real-time matplotlib plotting (6 subplots: time series + phase space)
- Interactive Plotly visualizations with zoom/pan
- 3D trajectory visualization (VTK/PyVista and Plotly 3D)
- Spectrogram analysis for frequency domain
- Base64 image encoding for web display
- Export to PNG, HTML, and interactive formats
## LaTeX Documentation Generator
- Automated report generation from simulation data
- Mathematical model descriptions (FitzHugh-Nagumo, Van der Pol)
- Configuration tables with parameters
- Statistical summaries (mean, std, min, max)
- BCI integration documentation
- BibTeX reference generation
- Automatic PDF compilation with pdflatex
## Bi-directional Data Flow Architecture
Hardware → Adapters → Buffers → HBCM → Control → Visualization
- <50ms latency target for real-time operation
- 1000+ samples/second multi-channel throughput
- Network synchronization via LSL timestamps
- Feedback loops for closed-loop BCI applications
## Examples and Documentation
- Comprehensive demo script showing all features
- 70+ page integration plan (docs/BCI_INTEGRATION_PLAN.md)
- Complete API reference in WEB_CONTROL_PANEL_README.md
- Installation guides for all dependencies
- Troubleshooting section
- Repository links to all integrated frameworks
## Dependencies Added
- FastAPI and uvicorn for web server
- WebSocket support
- BrainFlow and pylsl for BCI hardware
- MNE-Python for signal processing
- Plotly and PyVista for visualization
- LaTeX tools for documentation
All code includes comprehensive docstrings, type hints, and follows
the established Multi-Heart-Model patterns and conventions.1 parent 0a54851 commit fdbbe02
File tree
15 files changed
+4315
-0
lines changed- bci_integration
- data_acquisition
- streaming
- docs
- examples
- web_control_panel
- backend
- documentation
- visualization
15 files changed
+4315
-0
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments