-
Notifications
You must be signed in to change notification settings - Fork 6
/
GIV_GUI_initialize.m
1256 lines (1016 loc) · 56.6 KB
/
GIV_GUI_initialize.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
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
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
function GIV_GUI_initialize()
%
%
%This function starts off the main image velocity calculation code. It will
%open a graphical user interface where the different input values can be
%entered, and then run the functions to calcuate velocities for each image
%pair inputted.
%
%
%Note this can take a long time (hours) for very large datasets, it is
%sometimes worth testing it with smaller datasets to begin with (and/or
%using low temporal oversampling values).
%
%Most of this very long file is simply setting the location of the boxes,
%etc. Portions were generated automatically using MATLAB's app builder. You
%can tweak it to improve layout if you like, but I would not recommend
%changing it very much.
%
%Run with no inputs or outputs (just type the word)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% GLACIER IMAGE VELOCIMETRY (GIV) %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Code written by Max Van Wyk de Vries @ University of Minnesota
%Credit to Ben Popken and Andrew Wickert for portions of the toolbox.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Portions of this toolbox are based on a number of codes written by
%previous authors, including matPIV, IMGRAFT, PIVLAB, M_Map and more.
%Credit and thanks are due to the authors of these toolboxes, and for
%sharing their codes online. See the user manual for a full list of third
%party codes used here. Accordingly, you are free to share, edit and
%add to this GIV code. Please give us credit if you do, and share your code
%with the same conditions as this.
% Read the associated paper here:
% doi.org/10.5194/tc-15-2115-2021
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Version 1.0, Spring-Summer 2021%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Feel free to contact me at [email protected]%
%% Make sure to add functions to matlab path so that they are accessible
if ~isdeployed
addpath(genpath(pwd));
end
%Create array to hold all the components in
GUIinputs = [];
%% This portion of the code generated the GUI and input boxes. It is not very interesting.
% Create UIFigure and hide until all components are created
GUIFigure = uifigure('Visible', 'off');
GUIFigure.Position = [100 100 656 736];
GUIFigure.Name = 'GLACIER IMAGE VELOCIMETRY';
% Create TabGroup
TabGroup = uitabgroup(GUIFigure);
TabGroup.Position = [1 194 660 543];
% Create REQUIREDINPUTSTab
REQUIREDINPUTSTab = uitab(TabGroup);
REQUIREDINPUTSTab.Title = ' REQUIRED INPUTS ';
% Create PathtoimagesfolderEditFieldLabel
PathtoimagesfolderEditFieldLabel = uilabel(REQUIREDINPUTSTab);
PathtoimagesfolderEditFieldLabel.HorizontalAlignment = 'right';
PathtoimagesfolderEditFieldLabel.FontName = 'Cambria';
PathtoimagesfolderEditFieldLabel.Position = [209 305 113 22];
PathtoimagesfolderEditFieldLabel.Text = 'Path to images folder';
% Create PathtoimagesfolderEditField
PathtoimagesfolderEditField = uieditfield(REQUIREDINPUTSTab, 'text');
PathtoimagesfolderEditField.Position = [337 305 100 22];
PathtoimagesfolderEditField.Value = 'C:/EXAMPLE/PATH/TO/IMAGES';
% Create Image
Image = uiimage(REQUIREDINPUTSTab);
Image.Position = [146 355 347 154];
Image.ImageSource = 'logo.png';
% Create BASICINPUTSREQUIREDLabel
BASICINPUTSREQUIREDLabel = uilabel(REQUIREDINPUTSTab);
BASICINPUTSREQUIREDLabel.FontName = 'Cambria';
BASICINPUTSREQUIREDLabel.FontSize = 15;
BASICINPUTSREQUIREDLabel.FontWeight = 'bold';
BASICINPUTSREQUIREDLabel.Position = [236 344 191 22];
BASICINPUTSREQUIREDLabel.Text = 'BASIC INPUTS (REQUIRED)';
% Create MinimumLatitudeLabel
MinimumLatitudeLabel = uilabel(REQUIREDINPUTSTab);
MinimumLatitudeLabel.HorizontalAlignment = 'right';
MinimumLatitudeLabel.FontName = 'Cambria';
MinimumLatitudeLabel.Position = [213 271 109 22];
MinimumLatitudeLabel.Text = 'Minimum Latitude ';
% Create MinimumLatitudeEditField
MinimumLatitudeEditField = uieditfield(REQUIREDINPUTSTab, 'numeric');
MinimumLatitudeEditField.Position = [337 271 100 22];
MinimumLatitudeEditField.Value = -50.9640;
% Create MaximumLatitudeEditFieldLabel
MaximumLatitudeEditFieldLabel = uilabel(REQUIREDINPUTSTab);
MaximumLatitudeEditFieldLabel.HorizontalAlignment = 'right';
MaximumLatitudeEditFieldLabel.FontName = 'Cambria';
MaximumLatitudeEditFieldLabel.Position = [212 237 110 22];
MaximumLatitudeEditFieldLabel.Text = 'Maximum Latitude ';
% Create MaximumLatitudeEditField
MaximumLatitudeEditField = uieditfield(REQUIREDINPUTSTab, 'numeric');
MaximumLatitudeEditField.Position = [337 237 100 22];
MaximumLatitudeEditField.Value = -50.8920;
% Create MinimumLongitudeEditFieldLabel
MinimumLongitudeEditFieldLabel = uilabel(REQUIREDINPUTSTab);
MinimumLongitudeEditFieldLabel.HorizontalAlignment = 'right';
MinimumLongitudeEditFieldLabel.FontName = 'Cambria';
MinimumLongitudeEditFieldLabel.Position = [207 205 115 22];
MinimumLongitudeEditFieldLabel.Text = 'Minimum Longitude ';
% Create MinimumLongitudeEditField
MinimumLongitudeEditField = uieditfield(REQUIREDINPUTSTab, 'numeric');
MinimumLongitudeEditField.Position = [337 205 100 22];
MinimumLongitudeEditField.Value = -73.7460;
% Create MaximumLongitudeEditFieldLabel
MaximumLongitudeEditFieldLabel = uilabel(REQUIREDINPUTSTab);
MaximumLongitudeEditFieldLabel.HorizontalAlignment = 'right';
MaximumLongitudeEditFieldLabel.FontName = 'Cambria';
MaximumLongitudeEditFieldLabel.Position = [208 170 114 22];
MaximumLongitudeEditFieldLabel.Text = 'Maximum Longitude ';
% Create MaximumLongitudeEditField
MaximumLongitudeEditField = uieditfield(REQUIREDINPUTSTab, 'numeric');
MaximumLongitudeEditField.Position = [337 170 100 22];
MaximumLongitudeEditField.Value = -73.4730;
% Create ParralelizeCodeLabel
geotiffinputLabel = uilabel(REQUIREDINPUTSTab);
geotiffinputLabel.FontName = 'Cambria';
geotiffinputLabel.Position = [515 250 110 22];
geotiffinputLabel.Text = 'geoTiff input?';
% Create geotiffinput
geotiffinputSwitch = uiswitch(REQUIREDINPUTSTab, 'slider');
geotiffinputSwitch.Items = {'No', 'Yes'};
geotiffinputSwitch.FontName = 'Cambria';
geotiffinputSwitch.Position = [525 220 110 22];
geotiffinputSwitch.Value = 'Yes';
% Create TimeoversamplingfactorEditFieldLabel
TimeoversamplingfactorEditFieldLabel = uilabel(REQUIREDINPUTSTab);
TimeoversamplingfactorEditFieldLabel.HorizontalAlignment = 'right';
TimeoversamplingfactorEditFieldLabel.FontName = 'Cambria';
TimeoversamplingfactorEditFieldLabel.Position = [185 134 137 22];
TimeoversamplingfactorEditFieldLabel.Text = 'Time oversampling factor';
% Create TimeoversamplingfactorEditField
TimeoversamplingfactorEditField = uieditfield(REQUIREDINPUTSTab, 'numeric');
TimeoversamplingfactorEditField.Position = [337 134 100 22];
TimeoversamplingfactorEditField.Value = 1;
% Create ParralelizecodeSwitch
ParralelizecodeSwitch = uiswitch(REQUIREDINPUTSTab, 'slider');
ParralelizecodeSwitch.Items = {'No', 'Yes'};
ParralelizecodeSwitch.FontName = 'Cambria';
ParralelizecodeSwitch.Position = [309 15 45 20];
ParralelizecodeSwitch.Value = 'Yes';
% Create FilenametosaveasEditFieldLabel
FilenametosaveasEditFieldLabel = uilabel(REQUIREDINPUTSTab);
FilenametosaveasEditFieldLabel.HorizontalAlignment = 'right';
FilenametosaveasEditFieldLabel.FontName = 'Cambria';
FilenametosaveasEditFieldLabel.Position = [215 99 107 22];
FilenametosaveasEditFieldLabel.Text = 'File name to save as';
% Create FilenametosaveasEditField
FilenametosaveasEditField = uieditfield(REQUIREDINPUTSTab, 'text');
FilenametosaveasEditField.Position = [337 99 100 22];
FilenametosaveasEditField.Value = 'Glacier Velocities 1';
% Create ParralelizeCodeLabel
ParralelizeCodeLabel = uilabel(REQUIREDINPUTSTab);
ParralelizeCodeLabel.Position = [282 48 101 22];
ParralelizeCodeLabel.FontName = 'Cambria';
ParralelizeCodeLabel.Text = 'Parralelize Code?';
% Create SelectButton
SelectButton = uibutton(REQUIREDINPUTSTab, 'push');
SelectButton.BackgroundColor = [0.8 0.8 0.8];
SelectButton.FontName = 'Cambria';
SelectButton.FontWeight = 'bold';
SelectButton.Position = [517 305 100 23];
SelectButton.Text = 'Select';
SelectButton.ButtonPushedFcn = @(btn,event) plotButtonPushed1(btn,GUIinputs);
% Create orLabel
orLabel = uilabel(REQUIREDINPUTSTab);
orLabel.FontName = 'Cambria';
orLabel.Position = [468 305 25 22];
orLabel.Text = 'or';
% Create AdvancedInputsTab
AdvancedInputsTab = uitab(TabGroup);
AdvancedInputsTab.Title = ' Advanced Inputs ';
% Create Image_2
Image_2 = uiimage(AdvancedInputsTab);
Image_2.Position = [146 355 347 154];
Image_2.ImageSource = 'logo.png';
% Create TabGroup2
TabGroup2 = uitabgroup(AdvancedInputsTab);
TabGroup2.Position = [1 1 659 368];
% Create TemplatematchingTab
TemplatematchingTab = uitab(TabGroup2);
TemplatematchingTab.Title = ' Template matching ';
% Create Switch
Switch = uiswitch(TemplatematchingTab, 'slider');
Switch.Items = {'Single Pass', 'Multipass'};
Switch.FontName = 'Cambria';
Switch.Position = [308 311 45 20];
Switch.Value = 'Multipass';
% Create SignaltonoiseratioEditFieldLabel
SignaltonoiseratioEditFieldLabel = uilabel(TemplatematchingTab);
SignaltonoiseratioEditFieldLabel.HorizontalAlignment = 'right';
SignaltonoiseratioEditFieldLabel.FontName = 'Cambria';
SignaltonoiseratioEditFieldLabel.Position = [208 215 106 22];
SignaltonoiseratioEditFieldLabel.Text = 'Signal to noise ratio';
% Create SignaltonoiseratioEditField
SignaltonoiseratioEditField = uieditfield(TemplatematchingTab, 'numeric');
SignaltonoiseratioEditField.Position = [329 215 100 22];
SignaltonoiseratioEditField.Value = 5;
% Create PeakratioEditFieldLabel
PeakratioEditFieldLabel = uilabel(TemplatematchingTab);
PeakratioEditFieldLabel.HorizontalAlignment = 'right';
PeakratioEditFieldLabel.FontName = 'Cambria';
PeakratioEditFieldLabel.Position = [208 170 106 22];
PeakratioEditFieldLabel.Text = 'Peak ratio';
% Create PeakratioEditFieldField
PeakratioEditFieldField = uieditfield(TemplatematchingTab, 'numeric');
PeakratioEditFieldField.Position = [329 170 100 22];
PeakratioEditFieldField.Value = 1.3;
% % Create MultipassoptionsLabel
% MultipassoptionsLabel = uilabel(TemplatematchingTab);
% MultipassoptionsLabel.FontName = 'Cambria';
% MultipassoptionsLabel.Position = [447 259 97 22];
% MultipassoptionsLabel.Text = 'Multipass options';
%
% % Create WindowmatchoverlapEditFieldLabel
% WindowmatchoverlapEditFieldLabel = uilabel(TemplatematchingTab);
% WindowmatchoverlapEditFieldLabel.HorizontalAlignment = 'right';
% WindowmatchoverlapEditFieldLabel.FontName = 'Cambria';
% WindowmatchoverlapEditFieldLabel.Position = [387 210 124 22];
% WindowmatchoverlapEditFieldLabel.Text = 'Window match overlap';
%
% % Create WindowmatchoverlapEditField
% WindowmatchoverlapEditField = uieditfield(TemplatematchingTab, 'numeric');
% WindowmatchoverlapEditField.Position = [526 210 100 22];
% WindowmatchoverlapEditField.Value = 0.5;
%
% % Create MatchwindowsizeEditFieldLabel
% MatchwindowsizeEditFieldLabel = uilabel(TemplatematchingTab);
% MatchwindowsizeEditFieldLabel.HorizontalAlignment = 'right';
% MatchwindowsizeEditFieldLabel.FontName = 'Cambria';
% MatchwindowsizeEditFieldLabel.Position = [408 170 103 22];
% MatchwindowsizeEditFieldLabel.Text = 'Match window size';
%
% % Create MatchwindowsizeEditField
% MatchwindowsizeEditField = uieditfield(TemplatematchingTab, 'numeric');
% MatchwindowsizeEditField.FontName = 'Cambria';
% MatchwindowsizeEditField.Position = [526 170 100 22];
% MatchwindowsizeEditField.Value = 64;
%
%
%
%
% % Create SinglepassoptionsLabel
% SinglepassoptionsLabel = uilabel(TemplatematchingTab);
% SinglepassoptionsLabel.FontName = 'Cambria';
% SinglepassoptionsLabel.Position = [89 259 103 22];
% SinglepassoptionsLabel.Text = 'Single pass options';
% Create IdealresolutionofoutputdataEditFieldLabel
IdealresolutionofoutputdataEditFieldLabel = uilabel(TemplatematchingTab);
IdealresolutionofoutputdataEditFieldLabel.HorizontalAlignment = 'right';
IdealresolutionofoutputdataEditFieldLabel.FontName = 'Cambria';
IdealresolutionofoutputdataEditFieldLabel.Position = [152 259 161 22];
IdealresolutionofoutputdataEditFieldLabel.Text = 'Ideal resolution of output data';
% Create IdealresolutionofoutputdataEditField
IdealresolutionofoutputdataEditField = uieditfield(TemplatematchingTab, 'numeric');
IdealresolutionofoutputdataEditField.Position = [328 259 100 22];
IdealresolutionofoutputdataEditField.Value = 50;
% % Create SearchwindowSizeEditFieldLabel
% SearchwindowSizeEditFieldLabel = uilabel(TemplatematchingTab);
% SearchwindowSizeEditFieldLabel.HorizontalAlignment = 'right';
% SearchwindowSizeEditFieldLabel.FontName = 'Cambria';
% SearchwindowSizeEditFieldLabel.Position = [77 170 107 22];
% SearchwindowSizeEditFieldLabel.Text = 'Search window Size';
%
% % Create SearchwindowSizeEditField
% SearchwindowSizeEditField = uieditfield(TemplatematchingTab, 'numeric');
% SearchwindowSizeEditField.Position = [199 170 100 22];
% SearchwindowSizeEditField.Value = 30;
%
% % Create MinimumsearchareaEditFieldLabel
% MinimumsearchareaEditFieldLabel = uilabel(TemplatematchingTab);
% MinimumsearchareaEditFieldLabel.HorizontalAlignment = 'right';
% MinimumsearchareaEditFieldLabel.FontName = 'Cambria';
% MinimumsearchareaEditFieldLabel.Position = [68 132 116 22];
% MinimumsearchareaEditFieldLabel.Text = 'Minimum search area';
%
% % Create MinimumsearchareaEditField
% MinimumsearchareaEditField = uieditfield(TemplatematchingTab, 'numeric');
% MinimumsearchareaEditField.Position = [199 132 100 22];
% MinimumsearchareaEditField.Value = 50;
% Create DateoptionsTab
DateoptionsTab = uitab(TabGroup2);
DateoptionsTab.Title = ' Date options ';
% Create MinimumYearEditFieldLabel
MinimumYearEditFieldLabel = uilabel(DateoptionsTab);
MinimumYearEditFieldLabel.HorizontalAlignment = 'right';
MinimumYearEditFieldLabel.FontName = 'Cambria';
MinimumYearEditFieldLabel.Position = [245 288 85 22];
MinimumYearEditFieldLabel.Text = 'Minimum Year ';
% Create MinimumYearEditField
MinimumYearEditField = uieditfield(DateoptionsTab, 'numeric');
MinimumYearEditField.Position = [345 288 100 22];
MinimumYearEditField.Value = 1900;
% Create MaximumYearEditFieldLabel
MaximumYearEditFieldLabel = uilabel(DateoptionsTab);
MaximumYearEditFieldLabel.HorizontalAlignment = 'right';
MaximumYearEditFieldLabel.FontName = 'Cambria';
MaximumYearEditFieldLabel.Position = [243 254 87 22];
MaximumYearEditFieldLabel.Text = 'Maximum Year ';
% Create MaximumYearEditField
MaximumYearEditField = uieditfield(DateoptionsTab, 'numeric');
MaximumYearEditField.Position = [345 254 100 22];
MaximumYearEditField.Value = 2050;
% Create MinimumMonthEditFieldLabel
MinimumMonthEditFieldLabel = uilabel(DateoptionsTab);
MinimumMonthEditFieldLabel.HorizontalAlignment = 'right';
MinimumMonthEditFieldLabel.FontName = 'Cambria';
MinimumMonthEditFieldLabel.Position = [239 222 91 22];
MinimumMonthEditFieldLabel.Text = 'Minimum Month';
% Create MinimumMonthEditField
MinimumMonthEditField = uieditfield(DateoptionsTab, 'numeric');
MinimumMonthEditField.Position = [345 222 100 22];
MinimumMonthEditField.Value = 1;
% Create MaximumMonthEditFieldLabel
MaximumMonthEditFieldLabel = uilabel(DateoptionsTab);
MaximumMonthEditFieldLabel.HorizontalAlignment = 'right';
MaximumMonthEditFieldLabel.FontName = 'Cambria';
MaximumMonthEditFieldLabel.Position = [237 187 93 22];
MaximumMonthEditFieldLabel.Text = 'Maximum Month';
% Create MaximumMonthEditField
MaximumMonthEditField = uieditfield(DateoptionsTab, 'numeric');
MaximumMonthEditField.Position = [345 187 100 22];
MaximumMonthEditField.Value = 12;
% Create MinimumDayEditFieldLabel
MinimumDayEditFieldLabel = uilabel(DateoptionsTab);
MinimumDayEditFieldLabel.HorizontalAlignment = 'right';
MinimumDayEditFieldLabel.FontName = 'Cambria';
MinimumDayEditFieldLabel.Position = [253 152 77 22];
MinimumDayEditFieldLabel.Text = 'Minimum Day';
% Create MinimumDayEditField
MinimumDayEditField = uieditfield(DateoptionsTab, 'numeric');
MinimumDayEditField.Position = [345 152 100 22];
MinimumDayEditField.Value = 1;
% Create MaximumDayEditFieldLabel
MaximumDayEditFieldLabel = uilabel(DateoptionsTab);
MaximumDayEditFieldLabel.HorizontalAlignment = 'right';
MaximumDayEditFieldLabel.FontName = 'Cambria';
MaximumDayEditFieldLabel.Position = [251 117 79 22];
MaximumDayEditFieldLabel.Text = 'Maximum Day';
% Create MaximumDayEditField
MaximumDayEditField = uieditfield(DateoptionsTab, 'numeric');
MaximumDayEditField.Position = [345 117 100 22];
MaximumDayEditField.Value = 31;
% Create MinimumintervalforimagepairsEditFieldLabel
MinimumintervalforimagepairsEditFieldLabel = uilabel(DateoptionsTab);
MinimumintervalforimagepairsEditFieldLabel.HorizontalAlignment = 'right';
MinimumintervalforimagepairsEditFieldLabel.FontName = 'Cambria';
MinimumintervalforimagepairsEditFieldLabel.Position = [153 70 177 22];
MinimumintervalforimagepairsEditFieldLabel.Text = 'Minimum interval for image pairs';
% Create MinimumintervalforimagepairsEditField
MinimumintervalforimagepairsEditField = uieditfield(DateoptionsTab, 'numeric');
MinimumintervalforimagepairsEditField.Position = [345 70 100 22];
MinimumintervalforimagepairsEditField.Value = 0.019;
% Create MaximumintervalforimagepairsEditFieldLabel
MaximumintervalforimagepairsEditFieldLabel = uilabel(DateoptionsTab);
MaximumintervalforimagepairsEditFieldLabel.HorizontalAlignment = 'right';
MaximumintervalforimagepairsEditFieldLabel.FontName = 'Cambria';
MaximumintervalforimagepairsEditFieldLabel.Position = [151 35 179 22];
MaximumintervalforimagepairsEditFieldLabel.Text = 'Maximum interval for image pairs';
% Create MaximumintervalforimagepairsEditField
MaximumintervalforimagepairsEditField = uieditfield(DateoptionsTab, 'numeric');
MaximumintervalforimagepairsEditField.FontName = 'Cambria';
MaximumintervalforimagepairsEditField.Position = [345 35 100 22];
MaximumintervalforimagepairsEditField.Value = 0.75;
% Create ImagefilteringTab
ImagefilteringTab = uitab(TabGroup2);
ImagefilteringTab.Title = ' Image filtering ';
% Create Switch_2
Switch_2 = uiswitch(ImagefilteringTab, 'slider');
Switch_2.Items = {'OFF', 'ON'};
Switch_2.FontName = 'Cambria';
Switch_2.Position = [200 293 45 20];
Switch_2.Value = 'OFF';
% Create ContrastLimitedHistogramEqualisationLabel
ContrastLimitedHistogramEqualisationLabel = uilabel(ImagefilteringTab);
ContrastLimitedHistogramEqualisationLabel.Position = [123 319 220 22];
ContrastLimitedHistogramEqualisationLabel.Text = 'Contrast Limited Histogram Equalisation';
% Create Switch_3
Switch_3 = uiswitch(ImagefilteringTab, 'slider');
Switch_3.Items = {'OFF', 'ON'};
Switch_3.FontName = 'Cambria';
Switch_3.Position = [201 240 45 20];
Switch_3.Value = 'OFF';
% Create HighpassFilterLabel
HighpassFilterLabel = uilabel(ImagefilteringTab);
HighpassFilterLabel.Position = [180 266 85 22];
HighpassFilterLabel.Text = 'Highpass Filter';
% Create Switch_4
Switch_4 = uiswitch(ImagefilteringTab, 'slider');
Switch_4.Items = {'OFF', 'ON'};
Switch_4.FontName = 'Cambria';
Switch_4.Position = [202 191 45 20];
Switch_4.Value = 'OFF';
% Create IntensityCapLabel
IntensityCapLabel = uilabel(ImagefilteringTab);
IntensityCapLabel.Position = [187 215 75 22];
IntensityCapLabel.Text = 'Intensity Cap';
% Create Switch_5
Switch_5 = uiswitch(ImagefilteringTab, 'slider');
Switch_5.Items = {'OFF', 'ON'};
Switch_5.FontName = 'Cambria';
Switch_5.Position = [201 130 45 20];
Switch_5.Value = 'ON';
% Create OrientationFilterLabel
OrientationFilterLabel = uilabel(ImagefilteringTab);
OrientationFilterLabel.Position = [178 154 94 22];
OrientationFilterLabel.Text = 'Orientation Filter';
% Create CLAHEsizeEditFieldLabel
CLAHEsizeEditFieldLabel = uilabel(ImagefilteringTab);
CLAHEsizeEditFieldLabel.HorizontalAlignment = 'right';
CLAHEsizeEditFieldLabel.Position = [384 298 70 22];
CLAHEsizeEditFieldLabel.Text = 'CLAHE size';
% Create CLAHEsizeEditField
CLAHEsizeEditField = uieditfield(ImagefilteringTab, 'numeric');
CLAHEsizeEditField.Position = [469 298 100 22];
CLAHEsizeEditField.Value = 10;
% Create HighpasssizeEditFieldLabel
HighpasssizeEditFieldLabel = uilabel(ImagefilteringTab);
HighpasssizeEditFieldLabel.HorizontalAlignment = 'right';
HighpasssizeEditFieldLabel.Position = [375 245 80 22];
HighpasssizeEditFieldLabel.Text = 'Highpass size';
% Create HighpasssizeEditField
HighpasssizeEditField = uieditfield(ImagefilteringTab, 'numeric');
HighpasssizeEditField.Position = [470 245 100 22];
HighpasssizeEditField.Value = 10;
% Create Switch_10
Switch_10 = uiswitch(ImagefilteringTab, 'slider');
Switch_10.Items = {'OFF', 'ON'};
Switch_10.FontName = 'Cambria';
Switch_10.Position = [202 70 45 20];
Switch_10.Value = 'OFF';
% Create Sobel Filter
Sobel_Filter = uilabel(ImagefilteringTab);
Sobel_Filter.Position = [187 94 75 22];
Sobel_Filter.Text = 'Sobel Filter';
% Create Switch_11
Switch_11 = uiswitch(ImagefilteringTab, 'slider');
Switch_11.Items = {'OFF', 'ON'};
Switch_11.FontName = 'Cambria';
Switch_11.Position = [201 9 45 20];
Switch_11.Value = 'OFF';
% Create OrientationFilterLabel_2
Laplacian_filter = uilabel(ImagefilteringTab);
Laplacian_filter.Position = [178 33 94 22];
Laplacian_filter.Text = 'Laplacian filter';
% Create SavingTab
SavingTab = uitab(TabGroup2);
SavingTab.Title = ' Saving ';
% Create Switch_6
Switch_6 = uiswitch(SavingTab, 'slider');
Switch_6.Items = {'OFF', 'ON'};
Switch_6.FontName = 'Cambria';
Switch_6.Position = [298 275 45 20];
Switch_6.Value = 'ON';
% Create SaveMATLABdataarraysLabel
SaveMATLABdataarraysLabel = uilabel(SavingTab);
SaveMATLABdataarraysLabel.Position = [254 302 153 22];
SaveMATLABdataarraysLabel.Text = 'Save MATLAB data arrays?';
% Create Switch_7
Switch_7 = uiswitch(SavingTab, 'slider');
Switch_7.Items = {'OFF', 'ON'};
Switch_7.FontName = 'Cambria';
Switch_7.Position = [298 198 45 20];
Switch_7.Value = 'ON';
% Create Switch_8
Switch_8 = uiswitch(SavingTab, 'slider');
Switch_8.Items = {'OFF', 'ON'};
Switch_8.FontName = 'Cambria';
Switch_8.Position = [299 19 45 20];
Switch_8.Value = 'ON';
% Create SavegeoreferencedtifimagesLabel
SavegeoreferencedtifimagesLabel = uilabel(SavingTab);
SavegeoreferencedtifimagesLabel.Position = [233 46 178 22];
SavegeoreferencedtifimagesLabel.Text = 'Save georeferenced .tif images?';
% Create SaveimagesofkeyvelocitiesLabel
SaveimagesofkeyvelocitiesLabel = uilabel(SavingTab);
SaveimagesofkeyvelocitiesLabel.Position = [237 229 169 22];
SaveimagesofkeyvelocitiesLabel.Text = 'Save images of key velocities?';
% Create FormatofimagestosaveEditFieldLabel
FormatofimagestosaveEditFieldLabel = uilabel(SavingTab);
FormatofimagestosaveEditFieldLabel.HorizontalAlignment = 'right';
FormatofimagestosaveEditFieldLabel.Position = [147 119 141 22];
FormatofimagestosaveEditFieldLabel.Text = 'Format of images to save';
% Create FormatofimagestosaveEditField
FormatofimagestosaveEditField = uieditfield(SavingTab, 'text');
FormatofimagestosaveEditField.Position = [303 119 100 22];
FormatofimagestosaveEditField.Value = 'png';
% Create OtherTab
OtherTab = uitab(TabGroup2);
OtherTab.Title = ' Other ';
% Create MaximumVelocityEditFieldLabel
MaximumVelocityEditFieldLabel = uilabel(OtherTab);
MaximumVelocityEditFieldLabel.HorizontalAlignment = 'right';
MaximumVelocityEditFieldLabel.FontName = 'Cambria';
MaximumVelocityEditFieldLabel.Position = [222 300 100 22];
MaximumVelocityEditFieldLabel.Text = 'Maximum Velocity';
% Create MaximumVelocityEditField
MaximumVelocityEditField = uieditfield(OtherTab, 'numeric');
MaximumVelocityEditField.Position = [337 300 100 22];
MaximumVelocityEditField.Value = 2500;
% Create Excludedangle1minimumEditFieldLabel
Excludedangle1minimumEditFieldLabel = uilabel(OtherTab);
Excludedangle1minimumEditFieldLabel.HorizontalAlignment = 'right';
Excludedangle1minimumEditFieldLabel.FontName = 'Cambria';
Excludedangle1minimumEditFieldLabel.Position = [58 210 144 22];
Excludedangle1minimumEditFieldLabel.Text = 'Excluded angle 1 minimum';
% Create Excludedangle1minimumEditField
Excludedangle1minimumEditField = uieditfield(OtherTab, 'numeric');
Excludedangle1minimumEditField.Position = [217 210 100 22];
% Create Excludedangle2minimumEditFieldLabel
Excludedangle2minimumEditFieldLabel = uilabel(OtherTab);
Excludedangle2minimumEditFieldLabel.HorizontalAlignment = 'right';
Excludedangle2minimumEditFieldLabel.FontName = 'Cambria';
Excludedangle2minimumEditFieldLabel.Position = [58 174 144 22];
Excludedangle2minimumEditFieldLabel.Text = 'Excluded angle 2 minimum';
% Create Excludedangle2minimumEditField
Excludedangle2minimumEditField = uieditfield(OtherTab, 'numeric');
Excludedangle2minimumEditField.Position = [217 174 100 22];
Excludedangle2minimumEditField.Value = 360;
% Create Excludedangle2maximumEditFieldLabel
Excludedangle2maximumEditFieldLabel = uilabel(OtherTab);
Excludedangle2maximumEditFieldLabel.HorizontalAlignment = 'right';
Excludedangle2maximumEditFieldLabel.FontName = 'Cambria';
Excludedangle2maximumEditFieldLabel.Position = [353 174 146 22];
Excludedangle2maximumEditFieldLabel.Text = 'Excluded angle 2 maximum';
% Create Excludedangle2maximumEditField
Excludedangle2maximumEditField = uieditfield(OtherTab, 'numeric');
Excludedangle2maximumEditField.Position = [514 174 100 22];
Excludedangle2maximumEditField.Value = 360;
% Create Excludedangle1maximumEditFieldLabel
Excludedangle1maximumEditFieldLabel = uilabel(OtherTab);
Excludedangle1maximumEditFieldLabel.HorizontalAlignment = 'right';
Excludedangle1maximumEditFieldLabel.FontName = 'Cambria';
Excludedangle1maximumEditFieldLabel.Position = [353 210 146 22];
Excludedangle1maximumEditFieldLabel.Text = 'Excluded angle 1 maximum';
% Create Excludedangle1maximumEditField
Excludedangle1maximumEditField = uieditfield(OtherTab, 'numeric');
Excludedangle1maximumEditField.Position = [514 210 100 22];
% % % % Create MinimumangleEditFieldLabel
% % % MinimumangleEditFieldLabel = uilabel(OtherTab);
% % % MinimumangleEditFieldLabel.HorizontalAlignment = 'right';
% % % MinimumangleEditFieldLabel.FontName = 'Cambria';
% % % MinimumangleEditFieldLabel.Position = [230 187 85 22];
% % % MinimumangleEditFieldLabel.Text = 'Minimum angle';
% % %
% % % % Create MinimumangleEditField
% % % MinimumangleEditField = uieditfield(OtherTab, 'numeric');
% % % MinimumangleEditField.Position = [330 187 100 22];
% % % MinimumangleEditField.Value = 0;
% % %
% % %
% % % % Create MaximumAngleEditFieldLabel
% % % MaximumAngleEditFieldLabel = uilabel(OtherTab);
% % % MaximumAngleEditFieldLabel.HorizontalAlignment = 'right';
% % % MaximumAngleEditFieldLabel.FontName = 'Cambria';
% % % MaximumAngleEditFieldLabel.Position = [227 151 88 22];
% % % MaximumAngleEditFieldLabel.Text = 'Maximum Angle';
% % %
% % % % Create MaximumAngleEditField
% % % MaximumAngleEditField = uieditfield(OtherTab, 'numeric');
% % % MaximumAngleEditField.Position = [330 151 100 22];
% % % MaximumAngleEditField.Value = 360;
% Create Switch_9
Switch_9 = uiswitch(OtherTab, 'slider');
Switch_9.Items = {'NO', 'YES'};
Switch_9.FontName = 'Cambria';
Switch_9.Position = [316 243 45 20];
Switch_9.Value = 'NO';
% Create FilterbasedonflowdirectionLabel
FilterbasedonflowdirectionLabel = uilabel(OtherTab);
FilterbasedonflowdirectionLabel.Position = [272 270 158 22];
FilterbasedonflowdirectionLabel.Text = 'Filter based on flow direction';
% Create SmoothingofcompositearrayofallvelocitiesDropDownLabel
SmoothingofcompositearrayofallvelocitiesDropDownLabel = uilabel(OtherTab);
SmoothingofcompositearrayofallvelocitiesDropDownLabel.HorizontalAlignment = 'right';
SmoothingofcompositearrayofallvelocitiesDropDownLabel.Position = [103 18 248 22];
SmoothingofcompositearrayofallvelocitiesDropDownLabel.Text = 'Smoothing of composite array of all velocities';
% Create SmoothingofcompositearrayofallvelocitiesDropDown
SmoothingofcompositearrayofallvelocitiesDropDown = uidropdown(OtherTab);
SmoothingofcompositearrayofallvelocitiesDropDown.Items = {'No Smoothing', 'Smoothing in time', 'Smoothing in time and space'};
SmoothingofcompositearrayofallvelocitiesDropDown.Position = [365 18 192 22];
SmoothingofcompositearrayofallvelocitiesDropDown.Value = 'Smoothing in time and space';
% Create NumberofiterationsformonthlyvelocitiesEditFieldLabel
NumberofiterationsformonthlyvelocitiesEditFieldLabel = uilabel(OtherTab);
NumberofiterationsformonthlyvelocitiesEditFieldLabel.HorizontalAlignment = 'right';
NumberofiterationsformonthlyvelocitiesEditFieldLabel.Position = [134 59 231 22];
NumberofiterationsformonthlyvelocitiesEditFieldLabel.Text = 'Number of iterations for monthly velocities';
% Create NumberofiterationsformonthlyvelocitiesEditField
NumberofiterationsformonthlyvelocitiesEditField = uieditfield(OtherTab, 'numeric');
NumberofiterationsformonthlyvelocitiesEditField.Position = [380 59 100 22];
NumberofiterationsformonthlyvelocitiesEditField.Value = 0;
% Create Switch_12
Switch_12 = uiswitch(OtherTab, 'slider');
Switch_12.Items = {'NO', 'YES'};
Switch_12.FontName = 'Cambria';
Switch_12.Position = [321 102 45 20];
Switch_12.Value = 'NO';
% Create NormalizetovelocityofastableregionLabel
NormalizetovelocityofastableregionLabel = uilabel(OtherTab);
NormalizetovelocityofastableregionLabel.Position = [245 130 212 22];
NormalizetovelocityofastableregionLabel.Text = 'Normalize to velocity of a stable region';
% Create GIVAGLACIERVELOCITYCALCULATIONTOOLBOXBYMAXVANWYKDEVRIESLabel
GIVAGLACIERVELOCITYCALCULATIONTOOLBOXBYMAXVANWYKDEVRIESLabel = uilabel(GUIFigure);
GIVAGLACIERVELOCITYCALCULATIONTOOLBOXBYMAXVANWYKDEVRIESLabel.FontName = 'Cambria';
GIVAGLACIERVELOCITYCALCULATIONTOOLBOXBYMAXVANWYKDEVRIESLabel.FontAngle = 'italic';
GIVAGLACIERVELOCITYCALCULATIONTOOLBOXBYMAXVANWYKDEVRIESLabel.Position = [116 26 447 22];
GIVAGLACIERVELOCITYCALCULATIONTOOLBOXBYMAXVANWYKDEVRIESLabel.Text = 'GIV: A GLACIER VELOCITY TOOLBOX BY VAN WYK DE VRIES AND WICKERT';
% Create WWWGIVGLACIERCOMCONTACTMEATVANWY048UMNEDULabel
WWWGIVGLACIERCOMCONTACTMEATVANWY048UMNEDULabel = uilabel(GUIFigure);
WWWGIVGLACIERCOMCONTACTMEATVANWY048UMNEDULabel.FontName = 'Cambria';
WWWGIVGLACIERCOMCONTACTMEATVANWY048UMNEDULabel.FontSize = 10;
WWWGIVGLACIERCOMCONTACTMEATVANWY048UMNEDULabel.FontAngle = 'italic';
WWWGIVGLACIERCOMCONTACTMEATVANWY048UMNEDULabel.Position = [184 6 295 22];
WWWGIVGLACIERCOMCONTACTMEATVANWY048UMNEDULabel.Text = ' CONTACT ME AT [email protected] ';
% Create CALCULATEVELOCITIESButton
CALCULATEVELOCITIESButton = uibutton(GUIFigure, 'push');
CALCULATEVELOCITIESButton.BackgroundColor = [0.302 0.7451 0.9333];
CALCULATEVELOCITIESButton.FontName = 'Cambria';
CALCULATEVELOCITIESButton.FontSize = 25;
CALCULATEVELOCITIESButton.FontWeight = 'bold';
CALCULATEVELOCITIESButton.FontAngle = 'italic';
CALCULATEVELOCITIESButton.FontColor = [0 0.149 1];
CALCULATEVELOCITIESButton.Position = [186 59 310 71];
CALCULATEVELOCITIESButton.Text = 'CALCULATE VELOCITIES';
CALCULATEVELOCITIESButton.ButtonPushedFcn = @(btn,event) plotButtonPushed2 (btn);
% Create LoadsetupButton
LoadsetupButton = uibutton(GUIFigure, 'push');
LoadsetupButton.FontName = 'Cambria';
LoadsetupButton.FontWeight = 'bold';
LoadsetupButton.Position = [26 77 100 34];
LoadsetupButton.Text = 'Load setup';
LoadsetupButton.ButtonPushedFcn = @(btn,event) plotButtonPushed3(btn);
% Create SavesetupButton
SavesetupButton = uibutton(GUIFigure, 'push');
SavesetupButton.BackgroundColor = [0.9412 0.9412 0.9412];
SavesetupButton.FontName = 'Cambria';
SavesetupButton.FontWeight = 'bold';
SavesetupButton.Position = [536 77 100 34];
SavesetupButton.Text = 'Save setup';
SavesetupButton.ButtonPushedFcn = @(btn,event) plotButtonPushed4 (btn);
% Create AnalyseImagePairsButton
AnalyseImagePairsButton = uibutton(GUIFigure, 'push');
AnalyseImagePairsButton.BackgroundColor = [0.302 0.7451 0.9333];
AnalyseImagePairsButton.FontName = 'Cambria';
AnalyseImagePairsButton.FontSize = 18;
AnalyseImagePairsButton.FontWeight = 'bold';
AnalyseImagePairsButton.FontAngle = 'italic';
AnalyseImagePairsButton.Position = [248 142 185 40];
AnalyseImagePairsButton.Text = 'Analyse Image Pairs';
AnalyseImagePairsButton.ButtonPushedFcn = @(btn,event) plotButtonPushed5 (btn);
% Show the figure after all components are created
GUIFigure.Visible = 'on';
%% This portion makes the buttons call the relevant functions.
%For ease, functions are all wrapped in a single GIV_GUI_main,
%which is called here.
% This button press allows you to select the input folder.
function [btn,event,GUIinputs]= plotButtonPushed1(btn,GUIinputs)
a = uigetdir('.');
PathtoimagesfolderEditField.Value = a;
GUIinputs.folder = a;
figure(GUIFigure)
end
%This button runs GIV
function [btn,event]= plotButtonPushed2(btn,GUIinputs)
%Display message to user
logo = imread('GIV_LOGO_SMALL.png');
msgbox({'RUNNING...YOU MAY CLOSE THE INPUTS BOX. IT MAY TAKE A FEW SECONDS TO CLOSE'},...
'GIV is running','custom',logo);
%Combine input into a MATLAB struct array. These are more human
%readable than a simple array, and easier to modify in the
%future.
GUIinputs.folder = PathtoimagesfolderEditField.Value;
GUIinputs.isgeotiff = geotiffinputSwitch.Value;
GUIinputs.minlat = MinimumLatitudeEditField.Value;
GUIinputs.maxlat = MaximumLatitudeEditField.Value;
GUIinputs.minlon = MinimumLongitudeEditField.Value;
GUIinputs.maxlon = MaximumLongitudeEditField.Value;
GUIinputs.temporaloversampling = TimeoversamplingfactorEditField.Value;
GUIinputs.parralelize = ParralelizecodeSwitch.Value;
GUIinputs.name = FilenametosaveasEditField.Value;
if strcmpi(Switch.Value, 'Multipass')
GUIinputs.numpass = 'Multi';
else
GUIinputs.numpass = 'Single';
end
GUIinputs.snr = SignaltonoiseratioEditField.Value;
GUIinputs.pkr = PeakratioEditFieldField.Value;
GUIinputs.windowoverlap = 0.5;
GUIinputs.idealresolution = IdealresolutionofoutputdataEditField.Value;
GUIinputs.searchwindowsize = 30;
GUIinputs.minsearcharea = 50;
GUIinputs.minyear = MinimumYearEditField.Value;
GUIinputs.maxyear = MaximumYearEditField.Value;
GUIinputs.minmonth = MinimumMonthEditField.Value;
GUIinputs.maxmonth = MaximumMonthEditField.Value;
GUIinputs.minday = MinimumDayEditField.Value;
GUIinputs.maxday = MaximumDayEditField.Value;
GUIinputs.mininterval = MinimumintervalforimagepairsEditField.Value;
GUIinputs.maxinterval = MaximumintervalforimagepairsEditField.Value;
if strcmpi(Switch_2.Value, 'ON')
GUIinputs.CLAHE = 1;
else
GUIinputs.CLAHE = 0;
end
if strcmpi(Switch_3.Value, 'ON')
GUIinputs.hipass = 1;
else
GUIinputs.hipass = 0;
end
if strcmpi(Switch_4.Value, 'ON')
GUIinputs.intenscap = 1;
else
GUIinputs.intenscap = 0;
end
if strcmpi(Switch_5.Value, 'ON')
GUIinputs.NAOF = 1;
else
GUIinputs.NAOF = 0;
end
GUIinputs.CLAHEsize = CLAHEsizeEditField.Value;
GUIinputs.hipasssize = HighpasssizeEditField.Value;
if strcmpi(Switch_10.Value, 'ON')
GUIinputs.sobel = 1;
else
GUIinputs.sobel = 0;
end
if strcmpi(Switch_11.Value, 'ON')
GUIinputs.laplacian = 1;
else
GUIinputs.laplacian = 0;
end
if strcmpi(Switch_6.Value, 'ON')
GUIinputs.savearrays = 'Yes'; %'Yes' or 'No'
else
GUIinputs.savearrays = 'No';
end
if strcmpi(Switch_7.Value, 'ON')
GUIinputs.savekeyvel = 'Yes'; %'Yes' or 'No'
else
GUIinputs.savekeyvel = 'No';
end
if strcmpi(Switch_8.Value, 'ON')
GUIinputs.savegeotiff = 'Yes'; %'Yes' or 'No'
else
GUIinputs.savegeotiff = 'No';
end
GUIinputs.imageformat = FormatofimagestosaveEditField.Value;
GUIinputs.maxvel = MaximumVelocityEditField.Value;
GUIinputs.excudedangle1.min = Excludedangle1minimumEditField.Value;
GUIinputs.excudedangle1.max = Excludedangle1maximumEditField.Value;
GUIinputs.excudedangle2.min = Excludedangle2minimumEditField.Value;
GUIinputs.excudedangle2.max = Excludedangle2maximumEditField.Value;
if strcmpi(Switch_12.Value, 'YES')
GUIinputs.stable = 'Yes'; %'Yes' or 'No'
else
GUIinputs.stable = 'No';
end
if strcmpi(Switch_9.Value, 'YES')
GUIinputs.excludeangle = 'Yes'; %'Yes' or 'No'
else
GUIinputs.excludeangle = 'No';
end
if strcmpi(SmoothingofcompositearrayofallvelocitiesDropDown.Value, 'Smoothing in time and space')
GUIinputs.finalsmooth = 'Time and Space';
elseif strcmpi(SmoothingofcompositearrayofallvelocitiesDropDown.Value, 'Smoothing in time')
GUIinputs.finalsmooth = 'Time';
else
GUIinputs.finalsmooth = 'None';
end
GUIinputs.nummonthiter = NumberofiterationsformonthlyvelocitiesEditField.Value;
%Rename this array
inputs = GUIinputs;
%Call the main wrapper function
GIV_GUI_main(inputs)
end
%Load a previously saved inputs file.
function [btn,event]= plotButtonPushed3(btn)
%Prompt user to select file
[fname,load_file] = uigetfile('input files', 'Select an input file you previously saved.');
load(strcat(load_file,'/',fname),'inputs');
%Display message
logo = imread('GIV_LOGO_SMALL.png');
msgbox({'RUNNING...YOU MAY CLOSE THE INPUTS BOX. IT MAY TAKE A FEW SECONDS TO CLOSE'},...
'GIV is running','custom',logo);
%Call main wrapper function
GIV_GUI_main(inputs)
end
%Save an input setup
function [btn,event]= plotButtonPushed4(btn,GUIinputs)
%Combine input into a MATLAB struct array. These are more human
%readable than a simple array, and easier to modify in the
%future.
GUIinputs.folder = PathtoimagesfolderEditField.Value;
GUIinputs.isgeotiff = geotiffinputSwitch.Value;
GUIinputs.minlat = MinimumLatitudeEditField.Value;
GUIinputs.maxlat = MaximumLatitudeEditField.Value;
GUIinputs.minlon = MinimumLongitudeEditField.Value;
GUIinputs.maxlon = MaximumLongitudeEditField.Value;
GUIinputs.temporaloversampling = TimeoversamplingfactorEditField.Value;
GUIinputs.parralelize = ParralelizecodeSwitch.Value;
GUIinputs.name = FilenametosaveasEditField.Value;
if strcmpi(Switch.Value, 'Multipass')