SmartCGMS

SmartCGMS is a next-generation continuous glucose monitoring system.

About SmartCGMS

SmartCGMS is a software-stack for the next generation of continuous glucose monitoring, controlling and research systems. Its architecture comprises a number of building blocks, which could be either real or simulated devices such as glucose-sensor, model of glucose dynamics and insulin pump. Simulation is an irreplaceable tool in the development of new methods and algorithm. Our software allows the user to define such simulation and later, when the new method is ready, just switch the simulated device for the real one with the same program code.

SmartCGMS architecture builds on the top of ideas of co-simulation and the High-Level Architecture standard. As insulin pump and mobile devices in general have limited computational resources and power supply, the architecture was simplified to allow adaptation to low-power devices.

SmartCGMS contains/supports the following in-silico models:

  • Bergman-Hovorka-Willinska-Koutny model combination
  • UVA/Padova S2013
  • SimGlucose, by setting UVA/Padova S2013 xi parameter to zero
  • T1DMS
  • DMMS.R

Research

The research application comes in the graphical-user-interface and console variants. Graphical user interfaces lets a researcher to set up a simulation, including individual component parametrization. Once the simulation is set, the researcher can start it in the simulation view. Researcher can control the simulation during its runtime.

The research application visualize the results with graphs, plots and grids during the simulation - daily statistics, overall view, Parke's and Clarke's grids or ambulatory glucose profile, metrics and empirical cumulative distribution function of errors. Graphical user interface updates all of this in the real time, while offering additional filtering options. Entire experiment can be recorded and replayed as needed.

Generated graphs can be zoomed and visible are saved to a vector-graphics file format.

Setting up

The graphical environment offers the configuration window, where the user can build custom configurations using predefined blocks, called filters. The right side contains available filters; the left side contains already selected filters. The order of filters is important - they are connected in a linear manner to a chain, with a simplex message passing.

Typically, the first filter in chain is a filter, which loads or generates input data. Such data may be loaded from a database, standard output file of CGM device or a log of previously simulated scenario. Then, calculation filters are defined. Such a filter schedules the solver algorithm to obtain model parameters. Then, the filter calculates the model signal using the determined parameters. In the graphical environment, visualization filter must be present to observe the calculated signal. This filter maintains graphical output, error metrics and simulation logging.

Detailed description of all available filters is present in documentation.

Mobile application

Thanks to the architecture design, our implementation could be ported to a low-power device without any change in the source code. Mobile phone is an example of such a device, which could be complemented with smart watch and insulin pump.

The mobile application is able to connect to a sensor implementing IEEE-11073 standard for glucose sensors, using low-energy Bluetooth. Hence, with a minimal configuration change we can instantly put the selected research configuration into the practice.

By complementing the mobile phone with smart watch, the patient's comfort increases. To determine glucose levels, user simply looks at the wrist. There is no need to install any additional application - data are displayed in the existing watch-face.

Matlab

The application is highly modular and supports integration with other tools. Along implementing custom filter, model, metric and solver algorithm with a compiled language (e.g. C++), a researcher can create custom model or solver algorithm with Matlab.

Matlab user can implement custom model of glucose dynamics or a solver algorithm. You can find an example of such scripts in the matlab subdirectory - simple linear regression and linear model. Let this example be your starting point in developing a custom model or solver algorithm.

The most important file in Matlab connection is a manifest - matlab_manifest.xml. This file contains XML-formatted structures, which defines Matlab scripts to be run for a given purpose. This file should be present in filters subdirectory of the compiled software. The developer can further specify input and output parameters, such as signals needed for the calculation.

By defining the session name and exporting the same name in already running instance of Matlab, the debugging routines becomes available.

Installation

SmartCGMS source codes are available under appropriate licencing conditions in the binary distribution archive mentioned below.

The building environment should have the following prerequisities installed:

  • compiler with C++17 (e.g.; gcc 7 or newer)
  • CMake
  • Qt 5 or 6

To build SmartCGMS, a CMakeLists.txt file is included. The core directory is empty - source code of your custom filters belong here.

After a successful build, a bin subdirectory is created. It contains the following, important files and directories:

  • gpredict3-desktop - research application with graphical user interface
  • gpredict3-console - console version of the research application
  • filters - directory containing filter libraries

Download SmartCGMS

The SmartCGMS software could be downloaded in the downloads section, as well, as CGM profile database. More information and steps needed to obtain SmartCGMS and database could be found there.