-
Notifications
You must be signed in to change notification settings - Fork 4
/
Real_Time_ICM_OpeningFcn.m
51 lines (43 loc) · 2.28 KB
/
Real_Time_ICM_OpeningFcn.m
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
% --- Executes just before Real_Time_ICM is made visible.
function Real_Time_ICM_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Real_Time_ICM (see VARARGIN)
% Choose default command line output for Real_Time_ICM
handles.output = hObject;
% set the position of the GUI on screen (08-23-2016)
set(handles.Real_Time_ICM,'Units', 'pixels');
screenSize = get(0, 'ScreenSize');
set(handles.Real_Time_ICM,'Position', [screenSize(1) screenSize(2) screenSize(3) screenSize(4)]);
%% Create a folder for results
rootDir = pwd;
handles.cp.ResultFolder = fullfile(rootDir, 'Result');
% create a result folder if it doesn't exist
if ~exist(handles.cp.ResultFolder, 'dir')
mkdir(rootDir, 'Result');
end
%% % Set up logging of acquired video file
% handles.video.LoggingMode = 'disk&memory';
% logging directory
handles.cp.VideoFolder = fullfile(handles.cp.ResultFolder, 'Video');
% create a video folder if it doesn't exist
if ~exist(handles.cp.VideoFolder, 'dir')
mkdir(handles.cp.VideoFolder);
end
% % % handles.VideoLoggingNO = 1; % added field of video sequence NO.
% % diskLogger = VideoWriter(fullfile(handles.cp.VideoFolder,sprintf('ICM_%s.avi',datestr(now,'yyyymmdd_HHMMSS'))), 'Grayscale AVI');
% diskLogger = VideoWriter(fullfile(handles.cp.VideoFolder,sprintf('ICM_%s.avi',datestr(now,'yyyymmdd_HHMMSS'))), 'Uncompressed AVI');
% % diskLogger = VideoWriter(fullfile(handles.cp.VideoFolder,sprintf('ICM_%s.avi',datestr(now,'yyyymmdd_HHMMSS'))), 'Archival');
% diskLogger.FrameRate = handles.cp.FPS;
% handles.video.DiskLogger = diskLogger;
%% set measurement parameters by default
pb_DefaultMeasParameters_Callback(hObject, eventdata, handles);
handles = updateParameters(handles);
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Real_Time_ICM wait for user response (see UIRESUME)
% uiwait(handles.Real_Time_ICM);% xyz note: by default it is blocked, but some
...website suggest turning it on. Yes, should be on.
% --- Outputs from this function are returned to the command line.