Skip to content
 
 

Repository files navigation

CardioView

build license .NET platform

English · Português

Multiparameter monitor and ECG viewer built with WPF (.NET 10). It simulates real-time vital signs with alarms, trends and screen capture, and can open real recordings from the MIT-BIH database (*.hea / *.dat / *.atr) for beat and rhythm analysis.

The UI is available in Portuguese and English — switch it in the settings.

Monitor ECG viewer
Monitor ECG viewer

Features

Monitor (main window)

  • Real-time waveforms: ECG1, SpO2, P1, P2, EtCO2.
  • Vitals: HR (bpm), SpO2 (%), NIBP (mmHg), RR (rpm), T1/T2 (°C), ΔT, ST, MAP.
  • Patient states: Normal, Exercise, Tachycardia, Bradycardia, Hypoxia, Fever — each with its own vital targets.
  • Alarm system with limits (HR max/min, SpO2 min, NIBP max/min, RESP, TEMP, EtCO2), blinking indicator and audible beep.
  • SETTINGS overlay to edit limits and options (sound, alarm system, interface language).
  • TREND: log of the latest readings.
  • CAPTURE: saves a PNG of the monitor to Documents\Capturas.
  • MARK: adds a marker to the trend log.
  • Manual NIBP and AUTO (~30 s cycle).
  • FREEZE / RESUME: pauses the simulation.

ECG viewer (MIT-BIH recordings)

  • Opens *.hea header files (supports the 212 data format and multiple signals/leads).
  • Auto-plays on load; PAUSE / PLAY / RESTART.
  • Lead selector (e.g., MLII, V1).
  • Reads annotations from the *.atr file (annot(5) format): beats (N, V, Q…), noise, artifacts and rhythm changes.
  • HR computed from the .atr annotations (fallback: QRS detection).
  • Markers shown as bold symbols over the trace; hover a tag to see its meaning.
  • LEGEND button: shows the meaning of the tags present in the file.
  • DIAGNOSIS button: automatic analysis of the annotations, with a summary in Portuguese — beat counts by type, PVCs/APCs, runs, rhythm markers (N, (VT, (AFIB…, HR and noise — with a severity level (INFO / ATTENTION / CRITICAL).
    • Repeated findings are grouped by condition, with episode count (×N), total duration and the time of the first episode (e.g., 3 episódios · total 4 min 20 s · 1º às 00:00:10).
    • The summary leads with critical conditions and mentions the underlying rhythm in the background.
  • Bottom overview strip with the whole record: click/drag to seek.
  • TAGS: ON/OFF to toggle marker display.
  • REPORT button: generates an A4 PDF in a clinical format — metrics summary (mean/min/max HR, total beats, findings by severity), plain-language clinical interpretation, a detailed findings table with severity level, beat counts per type and a high-resolution snapshot of the trace (white background).

Requirements

Build and run

dotnet build
dotnet run

Or open CardioView.csproj in Visual Studio and run it.

Tests

dotnet test CardioView.Tests/CardioView.Tests.csproj

Unit tests covering the MIT-BIH reader and annotations (using the bundled record 105), QRS detection, rhythm analysis, clinical interpretation and localization (PT/EN). CI runs them on every push.

How to use

  1. ECG viewer: click CARREGAR ECG and pick a *.hea file (e.g., mitbih\105.hea). The trace starts playing; use LEGENDAS to see what the tags mean and the bottom strip to jump around the record.
  2. Monitor: the simulation runs on open. Use the top buttons to change the patient state and the bottom bar for settings, NIBP, capture, trend, mark, alarms, freeze and to go to the ECG viewer.

Sample data

The mitbih\ folder contains record 105 from the MIT-BIH database (30 minutes, 360 Hz, MLII + V1 leads, 2526 normal beats, 41 PVCs), including 105.hea, 105.dat and 105.atr.

Source: PhysioNet MIT-BIH Arrhythmia Database.

Project structure

CardioView/
├── Controls/          WaveformControl, AnnotationOverview, AnnotationPalette
├── Converters/        Display converters (patient states)
├── Models/            Patient, PatientState, VitalSigns
├── Services/          Simulation, alarms, MIT-BIH reader (.hea/.atr), QRS, rhythm analysis, clinical interpretation, PDF report, settings
├── Simulation/        Waveform generators (ECG, SpO2, BP, EtCO2) and simulator
├── ViewModels/        MonitorViewModel, EcgViewModel
├── Views/             MainWindow (monitor), EcgViewerWindow (ECG)
├── mitbih/            Record 105 (sample data)
└── CardioView.csproj

MIT-BIH format

  • Header (*.hea): format, gain, resolution and description fields (optional fields such as baseline/units are tolerated).
  • Data (*.dat): decoding of the 212 format (2 signals in 3 bytes).
  • Annotations (*.atr): annot(5) format — codes 1–41 (N, L, R, a, V, F, J, A, S, E, j, /, Q, noise, artifact, rhythm change, etc.) with meanings in Portuguese.

Settings

Alarm limits, options and the interface language live in %AppData%\CardioView\settings.json (created automatically).

License

Licensed under the MIT License.

Disclaimer: this application is for simulation and study only. Values, waveforms and alarms do not represent real medical data.


Português

Monitor multiparâmetro e visualizador de ECG em WPF (.NET 10). Simula sinais vitais em tempo real com alarmes, tendência e captura de tela, e permite abrir gravações reais do banco MIT-BIH (*.hea / *.dat / *.atr) para análise de batimentos e ritmo.

A interface está disponível em português e inglês — troque nas configurações.

Funcionalidades

Monitor (tela principal)

  • Sinais em tempo real: ECG1, SpO2, P1, P2, EtCO2.
  • Válvulas vitais: FC (bpm), SpO2 (%), PNI (mmHg), FR (rpm), T1/T2 (°C), ΔT, ST, PAM.
  • Estados do paciente: Normal, Exercício, Taquicardia, Bradicardia, Hipóxia, Febre — cada um com alvos vitais próprios.
  • Sistema de alarmes com limites (FC máx/mín, SpO2 mín, PNI máx/mín, RESP, TEMP, EtCO2), indicador piscante e bipe sonoro.
  • Overlay AJUSTES para editar limites e opções (som, sistema de alarmes, idioma da interface).
  • TENDÊNCIA: registro das últimas leituras.
  • CAPTURA: salva PNG do monitor em Documentos\Capturas.
  • MARCAR: insere marcação no log de tendência.
  • PNI manual e AUTO (ciclo automático de ~30 s).
  • CONGELAR/RETOMAR: pausa a simulação.

Visualizador de ECG (gravações MIT-BIH)

  • Abre arquivos de cabeçalho *.hea (suporta o formato de dados 212 e múltiplos sinais/derivações).
  • Reprodução automática ao carregar; PAUSAR / REPRODUZIR / REINICIAR.
  • Seletor de derivação (ex.: MLII, V1).
  • Leitura de anotações do arquivo *.atr (formato annot(5)): batimentos (N, V, Q…), ruído, artefatos e mudanças de ritmo.
  • FC calculada pelas anotações do .atr (fallback: detecção QRS).
  • Marcadores com símbolo em negrito sobre o traço; passe o mouse sobre uma tag para ver o significado.
  • Botão LEGENDAS: ao clicar, mostra à direita o significado das tags presentes no arquivo.
  • Botão DIAGNÓSTICO: análise automática das anotações (.atr) e sugestão de possíveis condições — contagem de batimentos por tipo, PVCs/APCs, salvas, marcadores de ritmo (N, (VT, (AFIB…, FC e ruído — com nível de gravidade (INFO / ATENÇÃO / CRÍTICO) e resumo em pt-BR.
    • Achados repetidos são agrupados por condição com contagem de episódios (×N), duração total e horário do 1º episódio (ex.: 3 episódios · total 4 min 20 s · 1º às 00:00:10).
    • O resumo lidera pelas condições críticas e cita o ritmo de base em segundo plano (ex.: "Episódios de taquicardia ventricular; Extrassístoles ventriculares (PVC); em ritmo sinusal normal").
  • Faixa inferior (overview) com todo o registro: clique/arraste para navegar (seek).
  • TAGS: LIG./DESL. para alternar a exibição dos marcadores.
  • Botão RELATÓRIO: gera um PDF (A4) com o diagnóstico em formato clínico — resumo com métricas (FC média/mín/máx, total de batimentos, achados por gravidade), interpretação clínica em linguagem simples sobre o que os achados podem significar, tabela detalhada de achados com nível de gravidade, contagem de batimentos por tipo e um snapshot de alta resolução do traçado (fundo branco).

Requisitos

Compilar e executar

dotnet build
dotnet run

Ou abra CardioView.csproj no Visual Studio e execute.

Testes

dotnet test CardioView.Tests/CardioView.Tests.csproj

Testes de unidade cobrindo o leitor/anotações MIT-BIH (registro 105 incluso), detecção QRS, análise de ritmo, interpretação clínica e localização (PT/EN). O CI roda a cada push.

Como usar

  1. Visualizador de ECG: clique em CARREGAR ECG, escolha um arquivo *.hea (ex.: mitbih\105.hea). O traço começa a tocar; use LEGENDAS para ver o significado das tags e a faixa inferior para pular no registro.
  2. Monitor: ao abrir, a simulação já está rodando. Use os botões do topo para mudar o estado do paciente e os botões da barra inferior para ajustes, PNI, captura, tendência, marcação, alarmes, congelar e ir ao ECG.

Dados de exemplo

A pasta mitbih\ contém o registro 105 do banco MIT-BIH (30 minutos, 360 Hz, derivações MLII + V1, 2526 batimentos normais, 41 PVC), incluindo 105.hea, 105.dat e 105.atr.

Fonte: PhysioNet MIT-BIH Arrhythmia Database.

Estrutura do projeto

CardioView/
├── Controls/          WaveformControl, AnnotationOverview, AnnotationPalette
├── Converters/        Conversores de exibição (estados)
├── Models/            Patient, PatientState, VitalSigns
├── Services/          Simulação, alarmes, leitor MIT-BIH (.hea/.atr), QRS, análise de ritmo, interpretação clínica, relatório PDF, configurações
├── Simulation/        Geradores de formas de onda (ECG, SpO2, PA, EtCO2) e simulador
├── ViewModels/        MonitorViewModel, EcgViewModel
├── Views/             MainWindow (monitor), EcgViewerWindow (ECG)
├── mitbih/            Registro 105 (dados de exemplo)
└── CardioView.csproj

Formato MIT-BIH

  • Cabeçalho (*.hea): campos de formato, ganho, resolução e descrição (campos opcionais como baseline/unidades são tolerados).
  • Dados (*.dat): decodificação do formato 212 (2 sinais em 3 bytes).
  • Anotações (*.atr): formato annot(5) — códigos 1–41 (N, L, R, a, V, F, J, A, S, E, j, /, Q, ruído, artefato, mudança de ritmo, etc.) com significados em pt-BR.

Configurações

Os limites de alarme, opções e o idioma da interface ficam em %AppData%\CardioView\settings.json (criado automaticamente).

Licença

Distribuído sob a Licença MIT.

Aviso: aplicativo apenas para simulação e estudo. Valores, formas de onda e alarmes não representam dados médicos reais.

About

ECG monitor & viewer built with WPF (.NET 10): real-time vitals simulation, MIT-BIH record support, QRS detection, clinical summary and PDF report generation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages