Repository navigation
Expand file tree
/
Copy pathSIdmGUI.m
More file actions
600 lines (463 loc) · 24.1 KB
/
Copy pathSIdmGUI.m
File metadata and controls
600 lines (463 loc) · 24.1 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
function varargout = SIdmGUI(varargin)
% SIDMGUI MATLAB code for SIdmGUI.fig
% SIDMGUI, by itself, creates a new SIDMGUI or raises the existing
% singleton*.
%
% H = SIDMGUI returns the handle to a new SIDMGUI or the handle to
% the existing singleton*.
%
% SIDMGUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SIDMGUI.M with the given input arguments.
%
% SIDMGUI('Property','Value',...) creates a new SIDMGUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before SIdmGUI_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to SIdmGUI_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help SIdmGUI
% Last Modified by GUIDE v2.5 11-May-2022 16:08:12
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @SIdmGUI_OpeningFcn, ...
'gui_OutputFcn', @SIdmGUI_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before SIdmGUI is made visible.
function SIdmGUI_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 SIdmGUI (see VARARGIN)
setappdata(0,'fileName',0);
setappdata(0,'filePath',0);
% Choose default command line output for SIdmGUI
handles.output = hObject;
% get handle to the controller
for i = 1:2:length(varargin)
switch varargin{i}
case 'controller'
handles.controller = varargin{i+1};
otherwise
error('unknown input')
end
end
%pepare fitness axis
setappdata(0,'axes_fitness',handles.axes_fitness);
set(handles.axes_fitness,'NextPlot','add')
xlabel(handles.axes_fitness,'Image #')
ylabel(handles.axes_fitness,'Fitness')
%prepare axis image
setappdata(0,'axes_image_data',handles.axes_image_data);
setappdata(0,'axes_image_best',handles.axes_image_best);
setappdata(0,'axes_image_diff',handles.axes_image_diff);
axis(handles.axes_image_data,'off');
axis(handles.axes_image_best,'off');
axis(handles.axes_image_diff,'off');
%% store user function handle
h2pop = findobj(gcf,'Tag','popupmenu_select_fitness_fun');
func_string = get(h2pop,'String');
val = get(h2pop,'Value');
selected_fitness_function = str2func(func_string{val});
setappdata(0,'selected_fitness_function',selected_fitness_function);
%% Update handles structure
guidata(hObject, handles);
%% add directories to path
fprintf('\n Initializing GUI, adding folder to path')
path_names_to_add = {'DM','Fitness','GA','GUI_utils','Utils',...
'Fitness/MEAN','Fitness/PIQE','Fitness/FWHM'};
path_to_mfile = mfilename('fullpath');
path_to_mfile = fileparts(path_to_mfile);
for this_folder = path_names_to_add
addpath(fullfile(path_to_mfile,cell2mat(this_folder)))
end
%% update user functions
% UIWAIT makes SIdmGUI wait for user response (see UIRESUME)
% uiwait(handles.figure1);
setup_user_functions
% --- Outputs from this function are returned to the command line.
function varargout = SIdmGUI_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes during object creation, after setting all properties.
function etLogFileName_CreateFcn(hObject, eventdata, handles)
% hObject handle to etLogFileName (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in Start.
function Start_Callback(hObject, eventdata, handles)
% hObject handle to Abort (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%handles.controller.startGrabAcquisition();
getappdata(0)
evalin('base','hSI.startLoop')
% --- Executes on button press in Abort.
function Abort_Callback(hObject, eventdata, handles)
% hObject handle to Start (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%handles.controller.abortAcquisition();
evalin('base','hSI.abort')
% --- Executes during object creation, after setting all properties.
function axes_fitness_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes_fitness (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes_fitness
% --- Executes on button press in select_best_ind.
function select_best_ind_Callback(hObject, eventdata, handles)
% hObject handle to select_best_ind (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[fileName,filePath] = uigetfile('*.mat');
%load vector of zernike modes
setappdata(0,'path_to_user_selected_best_ind_file',...
fullfile(filePath,fileName));
guidata(hObject,handles)
% --- Executes on button press in clear.
function clear_Callback(hObject, eventdata, handles)
% hObject handle to clear (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
cla
function edit_generation_number_Callback(hObject, eventdata, handles)
% hObject handle to edit_generation_number (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
generationsNum = str2double(get(hObject,'String'));
setappdata(0,'generationsNum',generationsNum);
guidata(hObject,handles)
% Hints: get(hObject,'String') returns contents of edit_generation_number as text
% str2double(get(hObject,'String')) returns contents of edit_generation_number as a double
% --- Executes during object creation, after setting all properties.
function edit_generation_number_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_generation_number (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
generationsNum = str2double(get(hObject,'String'));
setappdata(0,'generationsNum',generationsNum);
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit_population_size_Callback(hObject, eventdata, handles)
% hObject handle to edit_population_size (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
popSize = str2double(get(hObject,'String'));
setappdata(0,'popSize',popSize);
guidata(hObject,handles)
% Hints: get(hObject,'String') returns contents of edit_population_size as text
% str2double(get(hObject,'String')) returns contents of edit_population_size as a double
% --- Executes during object creation, after setting all properties.
function edit_population_size_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_population_size (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
popSize = str2double(get(hObject,'String'));
setappdata(0,'popSize',popSize);
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit_frames_per_image_Callback(hObject, eventdata, handles)
% hObject handle to edit_frames_per_image (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
framesPerImg = str2double(get(hObject,'String'));
setappdata(0,'framesPerImg',framesPerImg);
guidata(hObject,handles)
% Hints: get(hObject,'String') returns contents of edit_frames_per_image as text
% str2double(get(hObject,'String')) returns contents of edit_frames_per_image as a double
% --- Executes during object creation, after setting all properties.
function edit_frames_per_image_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_frames_per_image (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
framesPerImg = str2double(get(hObject,'String'));
setappdata(0,'framesPerImg',framesPerImg);
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit_channel_num_Callback(hObject, eventdata, handles)
% hObject handle to edit_channel_num (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
channel = str2double(get(hObject,'String'));
setappdata(0,'channel',channel);
guidata(hObject,handles)
% Hints: get(hObject,'String') returns contents of edit_channel_num as text
% str2double(get(hObject,'String')) returns contents of edit_channel_num as a double
% --- Executes during object creation, after setting all properties.
function edit_channel_num_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_channel_num (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
channel = str2double(get(hObject,'String'));
setappdata(0,'channel',channel);
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in popupmenu_select_fitness_fun.
function popupmenu_select_fitness_fun_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_select_fitness_fun (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
func_string = get(hObject,'String');
val = get(hObject,'Value');
selected_fitness_function = str2func(func_string{val});
setappdata(0,'selected_fitness_function',selected_fitness_function);
%% Update handles structure
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function popupmenu_select_fitness_fun_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu_select_fitness_fun (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
setappdata(0,'func','PIQE');
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in updateMirror.
function updateMirror_Callback(hObject, eventdata, handles)
% hObject handle to updateMirror (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[vecName,vecPath] = uigetfile('*.mat');
setappdata(0,'vecName',vecName);
setappdata(0,'vecPath',vecPath);
guidata(hObject,handles)
% --- Executes during object creation, after setting all properties.
function axes_image_data_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes_image_data (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% setappdata(0,handles)
% Hint: place code in OpeningFcn to populate axes_image_data
function edit_treshold_Callback(hObject, eventdata, handles)
% hObject handle to edit_treshold (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
treshold = str2double(get(hObject,'String'));
setappdata(0,'treshold',treshold);
guidata(hObject,handles)
% Hints: get(hObject,'String') returns contents of edit_treshold as text
% str2double(get(hObject,'String')) returns contents of edit_treshold as a double
% --- Executes during object creation, after setting all properties.
function edit_treshold_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_treshold (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
treshold = str2double(get(hObject,'String'));
setappdata(0,'treshold',treshold);
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit_width_Callback(hObject, eventdata, handles)
% hObject handle to edit_width (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
width = str2double(get(hObject,'String'));
setappdata(0,'width',width);
guidata(hObject,handles)
% Hints: get(hObject,'String') returns contents of edit_width as text
% str2double(get(hObject,'String')) returns contents of edit_width as a double
% --- Executes during object creation, after setting all properties.
function edit_width_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_width (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
width = str2double(get(hObject,'String'));
setappdata(0,'width',width);
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit_expected_elements_Callback(hObject, eventdata, handles)
% hObject handle to edit_expected_elements (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
expect_elem = str2double(get(hObject,'String'));
setappdata(0,'expect_elem',expect_elem);
guidata(hObject,handles)
% Hints: get(hObject,'String') returns contents of edit_expected_elements as text
% str2double(get(hObject,'String')) returns contents of edit_expected_elements as a double
% --- Executes during object creation, after setting all properties.
function edit_expected_elements_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_expected_elements (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
expect_elem = str2double(get(hObject,'String'));
setappdata(0,'expect_elem',expect_elem);
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit_image_dim_Callback(hObject, eventdata, handles)
% hObject handle to edit_image_dim (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
image_dim = str2double(get(hObject,'String'));
setappdata(0,'image_dim',image_dim);
guidata(hObject,handles)
% Hints: get(hObject,'String') returns contents of edit_image_dim as text
% str2double(get(hObject,'String')) returns contents of edit_image_dim as a double
% --- Executes during object creation, after setting all properties.
function edit_image_dim_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_image_dim (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
image_dim = str2double(get(hObject,'String'));
setappdata(0,'image_dim',image_dim);
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes during object deletion, before destroying properties.
function uipanel6_DeleteFcn(hObject, eventdata, handles)
% hObject handle to uipanel6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in push_button_select_output_dir.
function push_button_select_output_dir_Callback(hObject, eventdata, handles)
% hObject handle to push_button_select_output_dir (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%startpath is whatever is written in the edit_output_dir
startpath = get(handles.edit_output_dir,'String');
output_dir_name = uigetdir(startpath, 'Select output directory');
if ischar(output_dir_name)
set(handles.edit_output_dir,'String',output_dir_name)
setappdata(0,'output_dir_name',output_dir_name);
end
function edit_output_dir_Callback(hObject, eventdata, handles)
% hObject handle to edit_output_dir (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit_output_dir as text
% str2double(get(hObject,'String')) returns contents of edit_output_dir as a double
% --- Executes during object creation, after setting all properties.
function edit_output_dir_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_output_dir (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit_variance_around_best_selected_ind_Callback(hObject, eventdata, handles)
% hObject handle to edit_variance_around_best_selected_ind (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit_variance_around_best_selected_ind as text
% str2double(get(hObject,'String')) returns contents of edit_variance_around_best_selected_ind as a double
current_val = str2double(get(gcbo,'String'));
set(gcbo,'Value',current_val)
setappdata(0,'variance_around_best_selected_ind',current_val)
% --- Executes during object creation, after setting all properties.
function edit_variance_around_best_selected_ind_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_variance_around_best_selected_ind (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
current_val = str2double(get(gcbo,'String'));
set(gcbo,'Value',current_val)
setappdata(0,'variance_around_best_selected_ind',current_val)
% --- Executes during object creation, after setting all properties.
function select_best_ind_CreateFcn(hObject, eventdata, handles)
% hObject handle to select_best_ind (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
setappdata(0,'path_to_user_selected_best_ind_file','');
% --- Executes on selection change in popupmenu_init_mode.
function popupmenu_init_mode_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_init_mode (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_init_mode contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu_init_mode
%%
init_pop_mode_str = get(gcbo,'String');
init_pop_mode_val = get(gcbo,'Value');
init_pop_mode = init_pop_mode_str{init_pop_mode_val};
setappdata(0,'init_pop_mode',init_pop_mode);
% --- Executes during object creation, after setting all properties.
function popupmenu_init_mode_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu_init_mode (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
init_pop_mode_str = get(gcbo,'String');
init_pop_mode_val = get(gcbo,'Value');
init_pop_mode = init_pop_mode_str{init_pop_mode_val};
setappdata(0,'init_pop_mode',init_pop_mode);
function edit_variance_around_rand_Callback(hObject, eventdata, handles)
% hObject handle to edit_variance_around_rand (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit_variance_around_rand as text
% str2double(get(hObject,'String')) returns contents of edit_variance_around_rand as a double
current_val = str2double(get(gcbo,'String'));
set(gcbo,'Value',current_val)
setappdata(0,'variance_around_rand',current_val)
% --- Executes during object creation, after setting all properties.
function edit_variance_around_rand_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_variance_around_rand (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
current_val = str2double(get(gcbo,'String'));
set(gcbo,'Value',current_val)
setappdata(0,'variance_around_rand',current_val)