-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSitStandAnalysisMain.m
More file actions
60 lines (43 loc) · 1.84 KB
/
SitStandAnalysisMain.m
File metadata and controls
60 lines (43 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%% Process all video files and save SitStand Test Event Intensty to sitStandProcessedDataMap.mat
% Note that all video names have to be the patient ID
path_videos_dir = './tempVideos'; % This is the dir contains all videos to be processed
path_save_dir = './tempProcessedFolder'; % This is the dir to save all processed data
% Create a new sitStandProcessedDataMap
% sitStandProcessedDataMap = containers.Map;
% Load the saved data first
savedDataMap = load('sitStandProcessedDataMap.mat');
files = dir(path_videos_dir);
fileIndex = find(~[files.isdir]);
% savedDataMap('12321') = AnalyzeSitStandRGB( path_rgb_video, path_save_dir );
% Load all movies in the directory
for i = 1:length(fileIndex)
videoFileName = files(fileIndex(i)).name;
parsed = strsplit(videoFileName, '.');
patientID = char(parsed(1));
if isempty(patientID) == false % Make srue the file is valid
path_rgb_video = strcat(strcat(path_videos_dir, '/'), videoFileName);
path_patient_save_dir = strcat(strcat(path_save_dir, '/'), patientID);
disp(strcat('======Processing pratient with ID: ', patientID)); % Display info
% Save each analyzed sitStand event intensity to the data map
% try
AnalyzeSitStandRGB( path_rgb_video, path_patient_save_dir );
% Just to be safe, save the data to file
%save('sitStandProcessedDataMap.mat' ,'savedDataMap');
% catch
% error(strcat('Error occurred when processing: ', videoFileName));
% end
end
end
%% Load processed data above and graph them
% Each row contains a single person's data
% Each column contains the scenario
y = [1 1 1;
2 2 2;
3 8 9;
2 11 12];
bar(y)
xticklabels({'S1','S2','S3','S4'});
legend('eyes closed', 'normal', 'whatever');
xlabel('Do whatever');
ylabel('Do whatever');
title('Do whatever');