EDITH-CSA 2024 presentation Tomas Kulhanek
Created by Tomas Kulhanek

Bodylight.js & eGolem - Methods and tools for scientific models in medical simulation education

acknowledgment


team current and past

What language/technology do you use for modeling?

1. Science - mathematical models
3. Use cases - medical simulators for education
2. Technology - how to simulate models
Is it a model? equations

Elena Zappon Efficient Reduced Order Modeling for Coupled Problems in Cardiac Electrophysiology, CompBioMed2023, 13th September 2023
Is it a model? component diagram

Magdalena Otta et al. A 0D model of lower limb haemodynamics: sensitivity analysis, CompBioMed2023, 13th September 2023
Is it a model? block schema

A C Guyton, T G Coleman, H J Granger, Circulation: overall regulation, Annu Rev Physiol.1972;34:13-46.doi: 10.1146/annurev.ph.34.030172.000305.
Correction after reimplementation in 2010

J.Kofránek, et al., Restoration of Guyton‘s Diagram for Regulation of the Circulation ...Physiol Res. 2010;59(6):897-908.doi: 10.33549/physiolres.931838.
explanatory models
to explain:
- equations
- way of computation
- physical reality
who is the audience?
- mathematician/computer scientist
- biomedical engineer
- other domain expert
- clinicians, physicians
- healthcare staff
- students of medicine
- patient
model of glucose insulin regulation - explain equations



model of glucose insulin regulation - block schema - explain computation

model of glucose insulin regulation - acausal and component modeling (compartment modeling) - explain physical reality

components




Tomas Kulhanek, Jiri Kofranek. Experience with Teaching Different Modeling Techniques on the example of Glucose Insulin Regulation Model,
Annu Int Conf IEEE Eng Med Biol Soc. 2020 Jul;2020:6024-6027. doi: 10.1109/EMBC44109.2020.9176535
Guyton's original scheme

implementation in component and acausal modeling language

Frank-Starling law is much more visible in component model - "force of the heart muscle depends on pressure of incoming blood".
Physiolibrary & Chemical
https://physiolibrary.org
free open-source Modelica library designed for modeling physical chemistry & human physiology.
Physiomodel

Complex model of physiology in Modelica based on HumMod and Physiolibrary
https://physiomodel.org
>60 000 equations
who is the audience?
- mathematician/computer scientist
- biomedical engineer
- other domain expert
- clinicians, physicians
- healthcare staff
- students of medicine
- patient
from model to web simulator and where bodylight.js fills the missing pieces

bodylight.js
- scripts translate model - FMU (standard C-source,C-binary following API) to WebAssembly
- javascript library
- custom element for model
- custom element for animation
- custom element for other useful web libraries and simplified elements
- Optional tools (composer, editor) to simplify creating and deploying web simulators
1. export model to FMU with C source code

2.compile to WebAssembly

Configuration and scripts to facilitate compilation with emscripten
emcc … -O3 –closure 0 …
https://github.com/creative-connections/Bodylight.js-FMU-Compiler
3. download JS with WebAssembly and use it in <bdl-fmi> web component

webcomponents - HTML elements

webcomponents - custom elements


- custom tag for model: fmi


- custom tag for chart


webcomponents - custom elements animation


simulator with web components - src
<script src=" bodylight.bundle.js" ></script>
...
<body aurelia-app="webcomponents">
...

we can put HTML/CSS styling


simulation education

4369 students, most of them general medicine and dentistry, >3500 study in Czech language (including >500 non-Czech nationality), >800 study in English (India,Israel,Iran,United Kingdom, ...)
lecture supported by simulators

physiology and pathophysiology
web simulators in a browser / desktop/tablet

co-simulation of multiple models

blood-gas exchange

respiration

hemodynamics of cardiovascular system

simulator of glucose/insulin

native mobile apps


control HW mannequin



bring virtual reality to life


WebGL+WebXR Unity+WebView
medical simulators - products

https://egolem.online/irm
simulator of iron metabolism: https://egolem.online/irm
digital appendix of scientific paper

Mazumder, Nikhilesh R et al. (2023). “Portal Venous Remodeling Determines the Pattern of Cirrhosis Decompensation: A Systems Analysis.” In: Clinical and Translational Gastroenterology. DOI: 10.14309/ctg.0000000000000590.
summary
- Science - Physiomodel, Physiolibrary - open source MIT license
- Modelica language - open source, interoperable via FMI standard
- Modelica tools - open source OpenModelica, commercial Dymola,...
- Technology - Bodylight.js - library to enable in-browser simulation

bodylight.physiome.cz (with source codes at GITHUB)
- Use cases - eGolem - digital textbook with web simulators
- HTML or Markdown with bodylight.js webcomponents
- seek economical/business model to maintain science, technology and use cases
- Value - dissemination of scientific results to educate students, domain experts, patients

explanatory simulators

GI equation

model of circulation and its regulation