Skip to content

umcu/sasicu-digital-twin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

135 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MDT-container - ICU Patient Monitor

⚠️ NOTICE: This repository is NOT available for AI training. See AI_TRAINING_PROHIBITION.md and LICENSE.md.

Overview

MDT-container is a desktop ICU patient monitoring system with real-time visualization and digital twin simulation. Built with Python and Tkinter, this application provides a comprehensive interface for monitoring vital signs, configuring alarms, and controlling physiological simulation parameters in an intensive care unit environment.

The system features three integrated screens:

  • ICU Patient Monitor: Real-time waveform visualization (ECG, arterial pressure, plethysmogram, respiratory) and vital signs display
  • Alarm Configuration: Customizable threshold-based alarm system with LOW/HIGH limits
  • Control Panel: Live parameter adjustment and simulation control

Key Features

Real-Time Monitoring

  • Waveform Display: ECG Lead I, Arterial Pressure, Plethysmogram, and Respiratory/EtCO₂ waveforms
  • Vital Signs: Heart Rate, Blood Pressure, SpO₂, Respiratory Rate, EtCO₂, Temperature
  • Synchronized Updates: 100ms refresh rate with phase-accurate waveform generation
  • 15-Second Scrolling Display: Continuously updated medical-grade visualization

Intelligent Alarm System

  • Threshold-Based Alarms: Simple LOW/HIGH limit configuration for all vital signs
  • Visual Indicators: Color-coded alarm display with automatic clearing
  • Real-Time Evaluation: Continuous monitoring with instant alarm triggering
  • Customizable Profiles: Save and load alarm configuration profiles

Live Parameter Control

  • FiO₂ Control: 0-100% oxygen concentration adjustment
  • Blood Volume: 3000-8000 mL total blood volume control
  • Heart Rate Baseline: 40-120 bpm baseline adjustment
  • Respiratory Rate: 8-40 breaths/min control
  • Instant Application: Live parameter updates without simulation interruption

Project Structure

MDT-container/
├── gui_system.py              # Main GUI application (4 screens)
├── ventilator_gui.py          # Mechanical ventilator module
├── digital_twin_model.py      # Core physiological simulation model
├── ECGGenerator.py            # ECG waveform generation
├── Alarms/
│   ├── alarmModule.py         # Alarm evaluation logic
│   └── AscomMathFunctions.py  # Mathematical utilities
├── *.json                     # Patient parameter files
├── requirements.txt           # Python dependencies
└── README.md

Prerequisites

  • Python 3.8+ (tested with Python 3.10)
  • Tkinter (usually included with Python)
  • pip (Python package installer)
  • macOS/Linux/Windows (cross-platform compatible)

Installation

  1. Clone the repository:

    git clone https://github.com/umcu/sasicu-digital-twin.git
    cd sasicu-digital-twin
  2. Create and activate a virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate  # On Windows use `.venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt

Usage

Starting the Application

Recommended method (with virtual environment):

.venv/bin/python3 gui_system.py

Alternative method:

python3 gui_system.py

Using the ICU Monitor System

1. Launch Screen

When you start the application, you'll see four buttons:

  • 🏥 ICU Patient Monitor - Open the main monitoring display
  • ⚠️ Alarm Configuration - Configure alarm thresholds
  • 🎛️ Control Panel - Control simulation and parameters
  • 🫁 Mechanical Ventilator - Control and monitor ventilation

2. ICU Patient Monitor

Features:

  • Real-time waveform visualization (4 waveforms)
  • Large vital signs display with color coding
  • Active alarms section with visual indicators
  • Automatic monitoring start on window open

Waveforms Displayed:

  • ECG Lead I (Green, 600 Hz sampling)
  • Arterial Pressure (Red, synchronized with HR)
  • Plethysmogram (Cyan, pulse oximetry waveform)
  • Respiratory/EtCO₂ (Yellow, capnography)

Vital Signs:

  • HR (Heart Rate): bpm
  • BP (Blood Pressure): Systolic/Diastolic mmHg
  • SpO₂ (Oxygen Saturation): %
  • RESP (Respiratory Rate): /min
  • EtCO₂ (End-tidal CO₂): mmHg
  • TEMP (Temperature): °C

3. Alarm Configuration

Default Thresholds:

  • Heart Rate: 50-100 bpm
  • Blood Pressure (MAP): 70-100 mmHg
  • SpO₂: 90-100%
  • Respiratory Rate: 10-30 /min
  • EtCO₂: 30-50 mmHg
  • Temperature: 36.0-38.5°C

Actions:

  • Apply Settings: Update alarm limits (non-blocking)
  • Reset to Defaults: Restore default thresholds
  • Save Profile: Export current configuration to JSON

4. Control Panel

Simulation Control:

  • START SIMULATION: Begin digital twin simulation
  • STOP SIMULATION: Terminate simulation
  • PAUSE/RESUME: Temporarily pause simulation

Adjustable Parameters:

  • FiO₂: 0-100% (oxygen concentration)
  • Total Blood Volume: 3000-8000 mL
  • Heart Rate Baseline: 40-120 bpm
  • Respiratory Rate: 8-40 bpm

Current System Values Display:

  • Real-time vital signs
  • Current parameter values
  • Simulation time and status

Workflow Example

  1. Start the application

    .venv/bin/python3 gui_system.py
  2. Open Control Panel → Click "START SIMULATION"

    • Monitor status changes to "● RUNNING"
    • Patient monitor auto-starts if open
  3. Open ICU Patient Monitor

    • View real-time waveforms and vital signs
    • Monitor displays "● MONITORING" status
  4. Adjust Parameters (Control Panel)

    • Move FiO₂ slider to desired value
    • Click "Apply" button
    • Changes take effect immediately
  5. Configure Alarms (Alarm Configuration)

    • Adjust LOW/HIGH limits for each vital sign
    • Click "Apply Settings"
    • Alarms update without interrupting simulation

Digital Twin Model

The core simulation logic is handled by the DigitalTwinModel class in digital_twin_model.py. This class:

  • Simulates comprehensive cardiorespiratory physiology
  • Runs in a separate thread for real-time performance
  • Supports dynamic parameter adjustment via events
  • Provides continuous state updates for monitoring

Supported Parameter Files:

  • healthyFlat.json - Normal physiological parameters
  • healthyFlat_leukemia.json - Leukemia patient parameters
  • sepsis.json - Sepsis simulation parameters
  • respfail.json - Respiratory failure parameters

Technical Details

Architecture

  • GUI Framework: Tkinter with matplotlib integration
  • Threading Model: Separate threads for simulation and GUI
  • Update Rate: 100ms GUI refresh, 20ms simulation timestep
  • Waveform Sampling: 600 Hz ECG, 100 Hz other waveforms

Waveform Generation

  • Phase Accumulation: Smooth HR/RR transitions during changes
  • Synchronized Signals: ECG, arterial pressure, and pleth synchronized to heart rate
  • Realistic Artifacts: Baseline wander, respiratory modulation, noise

Alarm System

  • Evaluation Frequency: Every GUI update (10 Hz)
  • Threshold Logic: Simple LOW/HIGH boundary checks
  • Auto-Clear: Alarms automatically clear when values normalize
  • Visual Feedback: Color-coded vital sign frames, alarm list display

License

Copyright (c) 2025, Dr. L.M. van Loon
All Rights Reserved.

⚠️ IMPORTANT: Research and Educational Use Only

This software is provided for RESEARCH AND EDUCATIONAL PURPOSES ONLY.

PROHIBITED USES:

  • No clinical or medical use - Not approved for patient care or clinical decision-making
  • No commercial use - Requires explicit written permission
  • No AI training - Cannot be used to train AI models without permission

REQUIRED FOR ANY USE: You must obtain explicit prior written permission from Dr. L.M. van Loon (lexvanloon@gmail.com) before any use, copying, modification, distribution, or commercial application of this software.

MEDICAL DISCLAIMER: This is a research simulation tool. It has not been validated for clinical use and must never be used for actual patient diagnosis, treatment, or care decisions.

See LICENSE.md for complete terms.

For permissions or licensing inquiries, contact:
Dr. L.M. van Loon - lexvanloon@gmail.com

Contact

For questions or support, please contact Dr. L.M. van Loon at lexvanloon@gmail.com.

About

No description, website, or topics provided.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors