%% Figure Generation Code for VAST 2023 Trial % Ella Guy % Last Updated: 29AUG2023 clear all, close all, clc % Load Data %-------------------------------------------------------------------------- % Inputs------------------------------------------------------------------- SubjectNumber = 1; % de-identifyed subject number start = 0; finish = 1000; %-------------------------------------------------------------------------- %-------------------------------------------------------------------------- infile_format = 'ProcessedDataset/ProcessedData_Subject%02d_Indexed.mat'; infile = sprintf(infile_format, SubjectNumber); load(infile) % Infile: % T = Time [s] % P = Pressure [cmH2O] % Q = Flow [L/s] % V = V_tidal [L] % CC = Chest Circumference [mm] % AC = Abdominal Circumference [mm] % Ind = Inspiratory Indicies % T_GA = Time (Aeration Data) [s] % GA = Global Aeration % Ind_GA = Inspiratory Indicies (Aeration Data) FigureName_format = 'Subject%02d.png'; FigureName = sprintf(FigureName_format, SubjectNumber); %-------------------------------------------------------------------------- % Plots of Processed Data ------------------------------------------------- ChestMin = floor(max(CC(1:900))); AbdominalMax = ceil(max(AC(1:900))); figure(1) ax(1) = subplot(6, 1, 1); hold on plot(T, P) plot(T(Ind), P(Ind), 'x') hold off grid on grid minor xlim([start finish]) ylim([-20 20]) title("Gauge Pressure [cmH_2O]", 'Fontsize', 12) ax(2) = subplot(6, 1, 2); hold on plot(T, Q) plot(T(Ind), Q(Ind), 'x') hold off grid on grid minor xlim([start finish]) title("Flow [L/s]", 'Fontsize', 12) ax(3) = subplot(6, 1, 3); hold on plot(T, V) plot(T(Ind), V(Ind), 'x') hold off grid on grid minor xlim([start finish]) title("Volume [L]", 'Fontsize', 12) ax(4) = subplot(6, 1, 4); hold on plot(T, CC) plot(T(Ind), CC(Ind), 'x') hold off grid on grid minor xlim([start finish]) ylim([ChestMin-10 ChestMin+30]) title("Chest Circumference [mm]", 'Fontsize', 12) ax(5) = subplot(6, 1, 5); hold on plot(T, AC) plot(T(Ind), AC(Ind), 'x') hold off grid on grid minor xlim([start finish]) ylim([AbdominalMax-30 AbdominalMax+10]) title("Abdominal Circumference [mm]", 'Fontsize', 12) ax(6) = subplot(6, 1, 6); hold on plot(T_GA, GA) plot(T_GA(Ind_GA), GA(Ind_GA), 'x') hold off grid on grid minor xlim([start finish]) title("Global Aeration (EIT)", 'Fontsize', 12) linkaxes(ax, 'x') set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]); saveas(figure(1), FigureName) close(figure(1)) clear all %-------------------------------------------------------------------------- %--------------------------------------------------------------------------