⚠️ NOTICE: This repository is NOT available for AI training. See AI_TRAINING_PROHIBITION.md and LICENSE.md.
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
- 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
- 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
- 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
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
- Python 3.8+ (tested with Python 3.10)
- Tkinter (usually included with Python)
- pip (Python package installer)
- macOS/Linux/Windows (cross-platform compatible)
-
Clone the repository:
git clone https://github.com/umcu/sasicu-digital-twin.git cd sasicu-digital-twin -
Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
Recommended method (with virtual environment):
.venv/bin/python3 gui_system.pyAlternative method:
python3 gui_system.pyWhen 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
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
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
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
-
Start the application
.venv/bin/python3 gui_system.py
-
Open Control Panel → Click "START SIMULATION"
- Monitor status changes to "● RUNNING"
- Patient monitor auto-starts if open
-
Open ICU Patient Monitor
- View real-time waveforms and vital signs
- Monitor displays "● MONITORING" status
-
Adjust Parameters (Control Panel)
- Move FiO₂ slider to desired value
- Click "Apply" button
- Changes take effect immediately
-
Configure Alarms (Alarm Configuration)
- Adjust LOW/HIGH limits for each vital sign
- Click "Apply Settings"
- Alarms update without interrupting simulation
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 parametershealthyFlat_leukemia.json- Leukemia patient parameterssepsis.json- Sepsis simulation parametersrespfail.json- Respiratory failure parameters
- 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
- 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
- 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
Copyright (c) 2025, Dr. L.M. van Loon
All Rights Reserved.
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
For questions or support, please contact Dr. L.M. van Loon at lexvanloon@gmail.com.