How prateekm180/ecg-analysis works
CORVIS is an ECG-image digitization and analysis application: a user uploads an ECG image, the backend extracts trace points and clinical metrics, and the frontend presents the returned results. The backend separates image preparation, lead-panel detection, per-panel waveform reconstruction, and clinical analysis. The frontend also contains 3D heart and waveform visualizations. One integration caveat is visible in the excerpts: the frontend passes data.points to its signal view, while the backend response shown contains leads, lead_names, and medical_report. Some frontend rendering lines are omitted, so uncertain component wiring is not inferred.
Main entry points: main.py Analyze endpoint · App.jsx Upload and results UI · EcgCanvas.jsx ECG visualizations · realistic_human_heart.glb Heart model asset
Components 14
Frontend
- Upload and results UI
ECG-Frontend/src/App.jsx - ECG visualizations
ECG-Frontend/src/EcgCanvas.jsx - Heart model asset
ECG-Frontend/public/realistic_human_heart.glb - Signal and reference view
ECG-Frontend/src/EcgCanvas.jsx - 3D heart view
ECG-Frontend/src/EcgCanvas.jsx
Analysis API
- Analyze endpoint
ECG-Backend/main.py - Leads and report response
ECG-Backend/main.py
Signal Reconstruction
- Image decoding
ECG-Backend/main.py - Ink mask
ECG-Backend/main.py - Lead panel detection
ECG-Backend/main.py - Panel digitization
ECG-Backend/main.py
Clinical Analysis
- Metrics lead selection
ECG-Backend/main.py - Clinical metrics
ECG-Backend/main.py
Other components
- ECG uploader
Connections 12
- ECG uploader → Upload and results UI: selects image
- Upload and results UI → Analyze endpoint: uploads image
- Analyze endpoint → Image decoding: decodes bytes
- Analyze endpoint → Ink mask: builds mask
- Analyze endpoint → Lead panel detection: finds panels
- Analyze endpoint → Panel digitization: digitizes panels
- Analyze endpoint → Metrics lead selection: selects metrics trace
- Metrics lead selection → Clinical metrics: analyzes signal
- Analyze endpoint → Leads and report response: returns leads and report
- Leads and report response → Upload and results UI: returns JSON
- Upload and results UI → Signal and reference view: renders waveform
- ECG visualizations → Heart model asset: loads model