-
Notifications
You must be signed in to change notification settings - Fork 1
/
CS3.m
798 lines (626 loc) · 30.5 KB
/
CS3.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
function varargout = CS3(varargin)
% CS3 MATLAB code for CS3.fig
% CS3, by itself, creates a new CS3 or raises the existing
% singleton*.
%
% H = CS3 returns the handle to a new CS3 or the handle to
% the existing singleton*.
%
% CS3('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CS3.M with the given input arguments.
%
% CS3('Property','Value',...) creates a new CS3 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before CS3_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to CS3_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
% (c) Zengli Yang 2011
% Edit the above text to modify the response to help CS3
% Last Modified by GUIDE v2.5 19-Jun-2011 15:54:21
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @CS3_OpeningFcn, ...
'gui_OutputFcn', @CS3_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 CS3 is made visible.
function CS3_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 CS3 (see VARARGIN)
% Choose default command line output for CS3
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes CS3 wait for user response (see UIRESUME)
%uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = CS3_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;
% --------------------------------------------------------------------
function FileMenu_Callback(hObject, eventdata, handles)
% hObject handle to FileMenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function LoadMenuItem_Callback(hObject, eventdata, handles)
% hObject handle to LoadMenuItem (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename,pathname]=uigetfile('*.jpg;*.gif;*.tif;*.tiff');
if filename~=0
file=strcat(pathname,filename);
cla(handles.axesLoad);cla(handles.axes1);
cla(handles.axes2);cla(handles.axes3);
axes(handles.axesLoad);
img=imread(file);
if size(img,3)~=1
img=img(:,:,1);
end
handles.img=img;
imshow(handles.img,[]);
guidata(hObject,handles);
set(handles.imgPanel,'Visible','on');
end
% --- Executes on button press in pushbuttonStart.
function pushbuttonStart_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonStart (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.pushbuttonSAR2D,'String','2D SAR');
set(handles.waitText,'Visible','on');
pause(0.1);
addpath(strcat(pwd,'/utils'));
axes(handles.axesLoad);
if isreal(handles.img)
imshow(handles.img,[]);
else
imshow(abs(handles.img),[]);
end
handles.pctg1=str2double(get(handles.editPctg1,'String'))*0.01;
handles.pctg2=str2double(get(handles.editPctg2,'String'))*0.01;
handles.pctg3=str2double(get(handles.editPctg3,'String'))*0.01;
contents = cellstr(get(handles.popupXfm1,'String'));
handles.xfm1=contents{get(handles.popupXfm1,'Value')};
handles.xfm2=contents{get(handles.popupXfm2,'Value')};
handles.xfm3=contents{get(handles.popupXfm3,'Value')};
% obtain the block size for local DCT
contents = cellstr(get(handles.popupBlocksize,'String'));
param_input.blocksize=contents{get(handles.popupBlocksize,'Value')};
if ~strcmp(param_input.blocksize,'N/A')
param_input.blocksize=str2double(param_input.blocksize);
else
param_input.blocksize=size(handles.img,1);
end
% obtain the wavelet basis for wavelet
contents = cellstr(get(handles.popupBasis,'String'));
param_input.waveletBasis=contents{get(handles.popupBasis,'Value')};
% obtain the wavelet scale for wavelet
param_input.waveletScale=get(handles.popupScale,'Value')+1;
% obtain the threhsold for bandelet
param_input.tBand=str2double(get(handles.editTBand,'String'));
param_input.sBand=str2double(get(handles.editSBand,'String'));
param_input.maxNBand=str2double(get(handles.editMaxNBand,'String'));
param_input.Jmin=str2double(get(handles.editJmin,'String'));
param_input.single_qt=get(handles.checkboxSingleQT,'Value');
% obtain the parameter for 2D SAR
freq=44.56;
mu=2; % step size for x and y
z1=34; % 34mm, 65mm, 81mm
DN=size(handles.img);
k=2*pi*freq*1e9/3e11; % wavenumber
kx=linspace(-pi/mu,pi/mu,DN(1));
ky=linspace(-pi/mu,pi/mu,DN(2));
kz=zeros(DN);
for u=1:DN(1)
for v=1:DN(2)
kz(u,v)=sqrt(4*k*k-kx(u)*kx(u)-ky(v)*ky(v));
if ~isreal(kz(u,v))
kz(u,v)=0;
end
end
end
handles.kz_exp=exp(1i*kz*z1);
param_input.kz_exp=handles.kz_exp;
% obtain the sampling domain
param_input.saDomain=get(handles.popupSaDomain,'Value');
% obtain the parameter for CS3
param_input.xfmWeight=str2double(get(handles.editXfmWeight,'String'));
param_input.TVWeight=str2double(get(handles.editTVWeight,'String'));
param_input.Itnlim=str2double(get(handles.editItnlim,'String'));
param_input.maxN=str2double(get(handles.editMaxN,'String'));
P=str2double(get(handles.editP,'String'));
% generally, 20 for variable density random sampling;
% 100 for uniform density random sampling.
if isfield(handles,'img')
if handles.pctg1>0 && handles.pctg1<=1 && ~strcmp(handles.xfm1,'N/A')
if ~isfield(param_input,'mask')
pdf = genPDF(size(handles.img),P,handles.pctg1,2,0,0);
param_input.mask = genSampling(pdf,500,2);
end
[img_rec,pctg_rec]=perform_CS(handles.img,handles.xfm1,handles.pctg1,param_input);
axes(handles.axes1);
if isreal(img_rec)
imshow(img_rec,[]);
else
imshow(abs(img_rec),[]);
end
pause(0.1);
handles.img_rec1=img_rec;
set(handles.editPctg1,'String',num2str(pctg_rec*100));
end
if handles.pctg2>0 && handles.pctg2<=1 && ~strcmp(handles.xfm2,'N/A')
if ~isfield(param_input,'mask') || handles.pctg2~=handles.pctg1
pdf = genPDF(size(handles.img),P,handles.pctg2,2,0,0);
param_input.mask = genSampling(pdf,500,2);
end
[img_rec,pctg_rec]=perform_CS(handles.img,handles.xfm2,handles.pctg2,param_input);
axes(handles.axes2);
if isreal(img_rec)
imshow(img_rec,[]);
else
imshow(abs(img_rec),[]);
end
pause(0.1);
handles.img_rec2=img_rec;
set(handles.editPctg2,'String',num2str(pctg_rec*100));
end
if handles.pctg3>0 && handles.pctg3<=1 && ~strcmp(handles.xfm3,'N/A')
if ~isfield(param_input,'mask') || handles.pctg3~=handles.pctg1
pdf = genPDF(size(handles.img),P,handles.pctg3,2,0,0);
param_input.mask = genSampling(pdf,500,2);
end
[img_rec,pctg_rec]=perform_CS(handles.img,handles.xfm3,handles.pctg3,param_input);
axes(handles.axes3);
if isreal(img_rec)
imshow(img_rec,[]);
else
imshow(abs(img_rec),[]);
end
pause(0.1);
handles.img_rec3=img_rec;
set(handles.editPctg3,'String',num2str(pctg_rec*100));
end
end
guidata(hObject,handles);
set(handles.waitText,'Visible','off');
function editPctg_Callback(hObject, eventdata, handles)
% hObject handle to editPctg (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 editPctg as text
% str2double(get(hObject,'String')) returns contents of editPctg as a double
set(handles.editPctg1,'String',get(hObject,'String'));
set(handles.editPctg2,'String',get(hObject,'String'));
set(handles.editPctg3,'String',get(hObject,'String'));
% --- Executes during object creation, after setting all properties.
function editPctg_CreateFcn(hObject, eventdata, handles)
% hObject handle to editPctg (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 editPctg3_Callback(hObject, eventdata, handles)
% hObject handle to editPctg3 (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 editPctg3 as text
% str2double(get(hObject,'String')) returns contents of editPctg3 as
% a double
% --- Executes during object creation, after setting all properties.
function editPctg3_CreateFcn(hObject, eventdata, handles)
% hObject handle to editPctg3 (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 editPctg2_Callback(hObject, eventdata, handles)
% hObject handle to editPctg2 (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 editPctg2 as text
% str2double(get(hObject,'String')) returns contents of editPctg2 as a double
handles.pctg2=str2double(get(hObject,'String'))*0.01;
% --- Executes during object creation, after setting all properties.
function editPctg2_CreateFcn(hObject, eventdata, handles)
% hObject handle to editPctg2 (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 editPctg1_Callback(hObject, eventdata, handles)
% hObject handle to editPctg1 (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 editPctg1 as text
% str2double(get(hObject,'String')) returns contents of editPctg1 as
% a double
% --- Executes during object creation, after setting all properties.
function editPctg1_CreateFcn(hObject, eventdata, handles)
% hObject handle to editPctg1 (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 selection change in popupXfm3.
function popupXfm3_Callback(hObject, eventdata, handles)
% hObject handle to popupXfm3 (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 popupXfm3 contents as cell array
% contents{get(hObject,'Value')} returns selected item from
% popupXfm3
% --- Executes during object creation, after setting all properties.
function popupXfm3_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupXfm3 (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
% --- Executes on selection change in popupXfm2.
function popupXfm2_Callback(hObject, eventdata, handles)
% hObject handle to popupXfm2 (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 popupXfm2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from
% popupXfm2
% --- Executes during object creation, after setting all properties.
function popupXfm2_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupXfm2 (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
% --- Executes on selection change in popupXfm1.
function popupXfm1_Callback(hObject, eventdata, handles)
% hObject handle to popupXfm1 (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 popupXfm1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupXfm1
% --- Executes during object creation, after setting all properties.
function popupXfm1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupXfm1 (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
function editTBand_Callback(hObject, eventdata, handles)
% hObject handle to editTBand (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 editTBand as text
% str2double(get(hObject,'String')) returns contents of editTBand as a double
% --- Executes during object creation, after setting all properties.
function editTBand_CreateFcn(hObject, eventdata, handles)
% hObject handle to editTBand (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 selection change in popupBlocksize.
function popupBlocksize_Callback(hObject, eventdata, handles)
% hObject handle to popupBlocksize (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 popupBlocksize contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupBlocksize
% --- Executes during object creation, after setting all properties.
function popupBlocksize_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupBlocksize (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
% --- Executes on selection change in popupBasis.
function popupBasis_Callback(hObject, eventdata, handles)
% hObject handle to popupBasis (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 popupBasis contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupBasis
% --- Executes during object creation, after setting all properties.
function popupBasis_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupBasis (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
% --- Executes on selection change in popupScale.
function popupScale_Callback(hObject, eventdata, handles)
% hObject handle to popupScale (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 popupScale contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupScale
% --- Executes during object creation, after setting all properties.
function popupScale_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupScale (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
% --------------------------------------------------------------------
function LoadMATItem_Callback(hObject, eventdata, handles)
% hObject handle to LoadMATItem (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename,pathname]=uigetfile('*.mat');
if filename~=0
file=strcat(pathname,filename);
cla(handles.axesLoad);cla(handles.axes1);
cla(handles.axes2);cla(handles.axes3);
axes(handles.axesLoad);
img=importdata(file);
if size(img,3)~=1
img=img(:,:,1);
end
handles.img=img-mean(img(:));
if isreal(img)
imshow(handles.img,[]);
else
imshow(abs(handles.img),[]);
end
guidata(hObject,handles);
set(handles.imgPanel,'Visible','on');
end
% --- Executes on button press in pushbuttonSAR2D.
function pushbuttonSAR2D_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonSAR2D (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
kz_exp = handles.kz_exp;
buttonSAR2D = get(hObject,'String');
if strcmp(buttonSAR2D,'2D SAR')
issar = 1;
set(hObject,'String','2D invSAR');
else
issar = 0;
set(hObject,'String','2D SAR');
end
cla(handles.axesLoad);cla(handles.axes1);
cla(handles.axes2);cla(handles.axes3);
if isfield(handles,'img')
axes(handles.axesLoad);
if issar
img=sar2d(handles.img,kz_exp);
else
img = handles.img;
end
imshow(abs(img),[]);
if handles.pctg1>0 && handles.pctg1<=1 && ~strcmp(handles.xfm1,'N/A')
axes(handles.axes1);
if issar
img=sar2d(handles.img_rec1,kz_exp);
else
img=handles.img_rec1;
end
imshow(abs(img),[]);
end
if handles.pctg2>0 && handles.pctg2<=1 && ~strcmp(handles.xfm2,'N/A')
axes(handles.axes2);
if issar
img=sar2d(handles.img_rec2,kz_exp);
else
img=handles.img_rec2;
end
imshow(abs(img),[]);
end
if handles.pctg3>0 && handles.pctg3<=1 && ~strcmp(handles.xfm3,'N/A')
axes(handles.axes3);
if issar
img=sar2d(handles.img_rec3,kz_exp);
else
img=handles.img_rec3;
end
imshow(abs(img),[]);
end
end
% --- Executes on selection change in popupSaDomain.
function popupSaDomain_Callback(hObject, eventdata, handles)
% hObject handle to popupSaDomain (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 popupSaDomain contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupSaDomain
% --- Executes during object creation, after setting all properties.
function popupSaDomain_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupSaDomain (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
function editXfmWeight_Callback(hObject, eventdata, handles)
% hObject handle to editXfmWeight (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 editXfmWeight as text
% str2double(get(hObject,'String')) returns contents of editXfmWeight as a double
% --- Executes during object creation, after setting all properties.
function editXfmWeight_CreateFcn(hObject, eventdata, handles)
% hObject handle to editXfmWeight (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 editTVWeight_Callback(hObject, eventdata, handles)
% hObject handle to editTVWeight (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 editTVWeight as text
% str2double(get(hObject,'String')) returns contents of editTVWeight as a double
% --- Executes during object creation, after setting all properties.
function editTVWeight_CreateFcn(hObject, eventdata, handles)
% hObject handle to editTVWeight (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 editItnlim_Callback(hObject, eventdata, handles)
% hObject handle to editItnlim (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 editItnlim as text
% str2double(get(hObject,'String')) returns contents of editItnlim as a double
% --- Executes during object creation, after setting all properties.
function editItnlim_CreateFcn(hObject, eventdata, handles)
% hObject handle to editItnlim (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 editMaxN_Callback(hObject, eventdata, handles)
% hObject handle to editMaxN (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 editMaxN as text
% str2double(get(hObject,'String')) returns contents of editMaxN as a double
% --- Executes during object creation, after setting all properties.
function editMaxN_CreateFcn(hObject, eventdata, handles)
% hObject handle to editMaxN (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 editP_Callback(hObject, eventdata, handles)
% hObject handle to editP (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 editP as text
% str2double(get(hObject,'String')) returns contents of editP as a double
% --- Executes during object creation, after setting all properties.
function editP_CreateFcn(hObject, eventdata, handles)
% hObject handle to editP (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 editMaxNBand_Callback(hObject, eventdata, handles)
% hObject handle to editMaxNBand (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 editMaxNBand as text
% str2double(get(hObject,'String')) returns contents of editMaxNBand as a double
% --- Executes during object creation, after setting all properties.
function editMaxNBand_CreateFcn(hObject, eventdata, handles)
% hObject handle to editMaxNBand (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 editJmin_Callback(hObject, eventdata, handles)
% hObject handle to editJmin (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 editJmin as text
% str2double(get(hObject,'String')) returns contents of editJmin as a double
% --- Executes during object creation, after setting all properties.
function editJmin_CreateFcn(hObject, eventdata, handles)
% hObject handle to editJmin (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 checkboxSingleQT.
function checkboxSingleQT_Callback(hObject, eventdata, handles)
% hObject handle to checkboxSingleQT (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkboxSingleQT
function editSBand_Callback(hObject, eventdata, handles)
% hObject handle to editSBand (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 editSBand as text
% str2double(get(hObject,'String')) returns contents of editSBand as a double
% --- Executes during object creation, after setting all properties.
function editSBand_CreateFcn(hObject, eventdata, handles)
% hObject handle to editSBand (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