# Visualization
# plotGlucose
function plotGlucose(data,varargin)
Function that visualizes the given data.
# Input
- data: timetable (required)
A timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl). - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
datamust be a timetable;datamust contain a column namedTimeand another namedglucose;PrintFigurecan be 0 or 1.
# Reference
- None
WARNING
Currently plotGlucose is not CI tested.
# plotGlucoseAsOneDay
function plotGlucoseAsOneDay(data,varargin)
Function that generates a plot of data in a single plot where each daily glucose profile is overlapped to each other.
# Inputs
- data: timetable (required)
A timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl); - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
datamust be a timetable having an homogeneous time grid;datamust contain a column namedTimeand another namedglucose;PrintFigurecan be 0 or 1.
# Reference
- None
WARNING
Currently plotGlucoseAsOneDay is not CI tested.
# plotGlucoseAsOneDayComparison
function plotGlucoseAsOneDayComparison(data1,data2,varargin)
Function that generates a plot of two glucose profiles in a single plot where each daily glucose profile is overlapped to each other.
# Inputs
- data1: timetable (required)
A timetable with columnTimeandglucosecontaining the first set of glucose data to analyze (in mg/dl); - data2: timetable (required)
A timetable with columnTimeandglucosecontaining the second set of glucose data to analyze (in mg/dl); - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
data1anddata2must be a timetable having an homogeneous time grid;data1anddata2must contain a column namedTimeand another namedglucose;PrintFigurecan be 0 or 1.
# Reference
- None
WARNING
Currently plotGlucoseAsOneDayComparison is not CI tested.
# plotGlucoseArmAsOneDay
function plotGlucoseArmAsOneDay(arm,varargin)
Function that generates a plot of an arm in a single plot where each daily profile is overlapped to each other.
# Inputs
- arm: cell array of timetable (required)
A cell array of timetables containing the glucose data of the arm. Each timetable corresponds to a patient and contains a columnTimeand a columnglucosecontaing the glucose recordings (in mg/dl); - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
armmust be a cell array containing timetables;- Each timetable in
armmust have a column namesTimeand a column namedglucose; PrintFigurecan be 0 or 1.
# Reference
- None
WARNING
Currently plotGlucoseArmAsOneDay is not CI tested.
# plotGlucoseArmAsOneDayComparison
function plotGlucoseArmAsOneDayComparison(arm1,arm2,varargin)
Function that generates a plot of an arm in a single plot where each daily profile is overlapped to each other.
# Inputs
- arm1: cell array of timetable (required)
A cell array of timetables containing the glucose data of the first arm. Each timetable corresponds to a patient and contains a columnTimeand a columnglucosecontaing the glucose recordings (in mg/dl); - arm2: cell array of timetable (required)
A cell array of timetables containing the glucose data of the second arm. Each timetable corresponds to a patient and contains a columnTimeand a columnglucosecontaing the glucose recordings (in mg/dl); - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
arm1must be a cell array containing timetables;- Each timetable in
arm1must have a column namesTimeand a column namedglucose; arm2must be a cell array containing timetables;- Each timetable in
arm2must have a column namesTimeand a column namedglucose; PrintFigurecan be 0 or 1.
# Reference
- None
WARNING
Currently plotGlucoseArmAsOneDayComparison is not CI tested.
# generateAGP
function generateAGP(data,varargin)
Function that generates the ambulatory glucose profile (AGP) reports of the given data. A report is generated every 14 days of recordings starting backwards from last 14 days.
# Inputs
data: timetable (required)
A timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl);Name: vector of characters (optional, default: '')
A vector of characters defining the name of the patient;DOB: vector of characters (optional, default: '')
A vector of characters defining the date of birth of the patient;PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to each AGP or not.
# Preconditions
datamust be a timetable having an homogeneous time grid;datamust contain a column namedTimeand another namedglucose;Namemust be a vector of characters;DOBmust be a vector of characters;PrintFigurecan be 0 or 1.
# Reference
- Danne et al., "International consensus on use of continuous glucose monitoring", Diabetes Care, 2017, vol. 40, pp. 1631-1640. DOI: 10.2337/dc17-1600 (opens new window).
WARNING
Currently generateAGP is not CI tested and requires a screen "big enough".
# plotCVGA
function plotCVGA(glucoseProfiles, varargin)
Function that plots the control variablity grid analysis (CVGA).
# Input
- glucoseProfiles: cell array of timetable (required)
A cell array of timetables each with columnTimeandglucosecontaining the glucose data to analyze (in mg/dl). - PlotZoneNames (optional, default: 1, {0, 1})
A numerical flag defining whether to plot the zone names in the CVGA plot or not. - HighlightBestControl (optional, default: 1, {0, 1})
A numerical flag defining whether to highlight the best controlled profile in the CVGA plot or not. - FontSize: integer (optional, default: 16)
A scalar defining the font size of the CVGA plot. - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to generated CVGA.
# Preconditions
glucoseProfilesmust be a cell array containing timetables;- Each timetable in
glucoseProfilesmust have a column namesTimeand a column namedglucose; PlotZoneNamescan be 0 or 1;HighlightBestControlcan be 0 or 1;PrintFigurecan be 0 or 1.FontSizemust be an integer.
# Reference
- Magni et al., "Evaluating the efficacy of closed-loop glucose regulation via control-variability grid analysis", Journal of Diabetes Science and Technology, 2008, vol. 2, pp. 630-635. DOI: 10.1177/193229680800200414.
WARNING
Currently plotCVGA is not CI tested.
# plotCVGAComparison
function plotCVGAComparison(glucoseProfilesArm1,glucoseProfilesArm2, varargin)
Function that plots and visually compares the control variablity grid analysis (CVGA) of two arms.
# Input
- glucoseProfilesArm1: cell array of timetable (required)
A cell array of timetables each with columnTimeandglucosecontaining the glucose data to analyze (in mg/dl) of arm 1. - glucoseProfilesArm2: cell array of timetable (required)
A cell array of timetables each with columnTimeandglucosecontaining the glucose data to analyze (in mg/dl) of arm 2. - PlotZoneNames (optional, default: 1, {0, 1})
A numerical flag defining whether to plot the zone names in the CVGA plot or not. - HighlightBestControl (optional, default: 1, {0, 1})
A numerical flag defining whether to highlight the best controlled profile in the CVGA plot or not. - FontSize: integer (optional, default: 16)
A scalar defining the font size of the CVGA plot. - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to generated CVGA.
# Preconditions
glucoseProfilesArm1must be a cell array containing timetables;- Each timetable in
glucoseProfilesArm1must have a column namesTimeand a column namedglucose; glucoseProfilesArm2must be a cell array containing timetables;- Each timetable in
glucoseProfilesArm2must have a column namesTimeand a column namedglucose; PlotZoneNamescan be 0 or 1;HighlightBestControlcan be 0 or 1;PrintFigurecan be 0 or 1.FontSizemust be an integer.
# Reference
- Magni et al., "Evaluating the efficacy of closed-loop glucose regulation via control-variability grid analysis", Journal of Diabetes Science and Technology, 2008, vol. 2, pp. 630-635. DOI: 10.1177/193229680800200414.
WARNING
Currently plotCVGAComparison is not CI tested.
# plotGRI
function plotGRI(glucoseProfiles, varargin)
Function that plots the control variablity grid analysis (CVGA).
# Input
- glucoseProfiles: cell array of timetable (required)
A cell array of timetables each with columnTimeandglucosecontaining the glucose data to analyze (in mg/dl). - HighlightBest: integer (optional, default: 1, {0, 1})
A numerical flag defining whether to highlight the best GRI dot in the plot or not. - FontSize: integer (optional, default: 16)
A scalar defining the font size of the GRI plot. - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
glucoseProfilesmust be a cell array containing timetables;- Each timetable in
glucoseProfilesmust have a column namesTimeand a column namedglucose; HighlightBestcan be 0 or 1.FontSizemust be an integer.PrintFigurecan be 0 or 1.
# Reference
- Klonoff et al., "A Glycemia Risk Index (GRI) of hypoglycemia and hyperglycemia for continuous glucose monitoring validated by clinician ratings", Journal of Diabetes Science and Technology, 2022, pp. 1-17. DOI: 10.1177/19322968221085273.
WARNING
Currently plotGRI is not CI tested.
# plotGRIComparison
function plotGRIComparison(glucoseProfiles, varargin)
Function that plots and visually compares the control variablity grid analysis (CVGA) of two arms.
# Input
- glucoseProfilesArm1: cell array of timetable (required)
A cell array of timetables each with columnTimeandglucosecontaining the glucose data to analyze (in mg/dl) of arm 1. - glucoseProfilesArm2: cell array of timetable (required)
A cell array of timetables each with columnTimeandglucosecontaining the glucose data to analyze (in mg/dl) of arm 2. - HighlightBest: integer (optional, default: 1, {0, 1})
A numerical flag defining whether to highlight the best GRI dot in the plot or not. - FontSize: integer (optional, default: 16)
A scalar defining the font size of the GRI plot. - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
glucoseProfilesArm1must be a cell array containing timetables;- Each timetable in
glucoseProfilesArm1must have a column namesTimeand a column namedglucose; glucoseProfilesArm2must be a cell array containing timetables;- Each timetable in
glucoseProfilesArm2must have a column namesTimeand a column namedglucose; PlotZoneNamescan be 0 or 1;HighlightBestControlcan be 0 or 1;PrintFigurecan be 0 or 1.FontSizemust be an integer.
# Reference
- Klonoff et al., "A Glycemia Risk Index (GRI) of hypoglycemia and hyperglycemia for continuous glucose monitoring validated by clinician ratings", Journal of Diabetes Science and Technology, 2022, pp. 1-17. DOI: 10.1177/19322968221085273.
WARNING
Currently plotGRIComparison is not CI tested.
# plotGlucoseROC
function plotGlucoseROC(data,varargin)
Function that visualizes the glucose ROC of the given data.
# Input
- data: timetable (required)
A timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl). - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
datamust be a timetable;datamust contain a column namedTimeand another namedglucose;PrintFigurecan be 0 or 1.
# Reference
- None
WARNING
Currently plotGlucoseROC is not CI tested.
# histGlucoseROC
function histGlucoseROC(data,varargin)
Function that visualizes the histogram of the glucose ROC of the given data.
# Input
- data: timetable (required)
A timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl). - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
datamust be a timetable;datamust contain a column namedTimeand another namedglucose;PrintFigurecan be 0 or 1.
# Reference
- Clarke et al., "Statistical Tools to Analyze Continuous Glucose Monitor Data", Diabetes Technol Ther, 2009, vol. 11, pp. S45-S54. DOI: 10.1089=dia.2008.0138.
WARNING
Currently histGlucoseROC is not CI tested.
# plotAggregatedGlucose
function plotAggregatedGlucose(data,varargin)
Function that visualizes the given data with superimposed aggregated glucose values.
# Input
- data: timetable (required)
A timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl). - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
datamust be a timetable;datamust contain a column namedTimeand another namedglucose;PrintFigurecan be 0 or 1.
# Reference
- Clarke et al., "Statistical Tools to Analyze Continuous Glucose Monitor Data", Diabetes Technol Ther, 2009, vol. 11, pp. S45-S54. DOI: 10.1089=dia.2008.0138.
WARNING
Currently plotAggregatedGlucose is not CI tested.
# plotPoincareGlucose
function plotPoincareGlucose(data,varargin)
Function that generates the Poincare' plot of the (x,y) = (glucose(t-1),glucose(t)) graph.
# Input
- data: timetable (required)
A timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl). - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
datamust be a timetable;datamust contain a column namedTimeand another namedglucose;PrintFigurecan be 0 or 1.
# Reference
- Clarke et al., "Statistical Tools to Analyze Continuous Glucose Monitor Data", Diabetes Technol Ther, 2009, vol. 11, pp. S45-S54. DOI: 10.1089=dia.2008.0138.
WARNING
Currently plotPoincareGlucose is not CI tested.
# plotPoincareGlucoseComparison
function plotPoincareGlucoseComparison(data1,data2,varargin)
Function that generates and compares the Poincare' plot of the (x,y) = (glucose(t-1),glucose(t)) graphs of two CGM profiles.
# Input
- data1: timetable (required)
A first timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl). - data2: timetable (required)
A second timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl). - PrintFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
data1must be a timetable;data1must contain a column namedTimeand another namedglucose;data2must be a timetable;data2must contain a column namedTimeand another namedglucose;PrintFigurecan be 0 or 1.
# Reference
- Clarke et al., "Statistical Tools to Analyze Continuous Glucose Monitor Data", Diabetes Technol Ther, 2009, vol. 11, pp. S45-S54. DOI: 10.1089=dia.2008.0138.
WARNING
Currently plotPoincareGlucoseComparison is not CI tested.
# plotClarkeErrorGrid
function plotClarkeErrorGrid(data,dataHat,printFigure)
Function that plots the Clarke Error Grid.
# Input
- data: timetable (required)
A timetable with columnsTimeandglucosecontaining the glucose data to analyze (mg/dl). - dataHat: timetable (required)
A timetable with columnTimeandglucosecontaining the inferred glucose data (in mg/dl) to compare withdata; - printFigure: integer (optional, default: 0, {0, 1})
A numeric flag defining whether to output the .pdf files associated to the figure or not.
# Preconditions
datamust be a timetable with homogeneous timegrid;datamust contain a column namedTimeand another namedglucose;dataHatmust be a timetable with homogeneous timegrid;dataHatmust contain a column namedTimeand another namedglucose;dataanddataHatmust start from the same timestamp and end with the same timestamp;dataanddataHatmust have the same length;printFigurecan be 0 or 1.
# Reference
- Clarke et al., "Evaluating clinical accuracy of systems for self-monitoring of blood glucose", Diabetes Care, 1987, vol. 10, pp. 622–628. DOI: 10.2337/diacare.10.5.622.
WARNING
Currently plotClarkeErrorGrid is not CI tested.