-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNDRVI_Menu_Multibanda.m
2625 lines (1931 loc) · 113 KB
/
NDRVI_Menu_Multibanda.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 varargout = NDRVI_Menu_Multibanda(varargin)
% NDRVI_Menu_Multibanda MATLAB code for NDRVI_Menu_Multibanda.fig
% NDRVI_Menu_Multibanda, by itself, creates a new NDRVI_Menu_Multibanda or raises the existing
% singleton*.
%
% H = NDRVI_Menu_Multibanda returns the handle to a new NDRVI_Menu_Multibanda or the handle to
% the existing singleton*.
%
% NDRVI_Menu_Multibanda('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in NDRVI_Menu_Multibanda.M with the given input arguments.
%
% NDRVI_Menu_Multibanda('Property','Value',...) creates a new NDRVI_Menu_Multibanda or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before NDRVI_Menu_Multibanda_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to NDRVI_Menu_Multibanda_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 NDRVI_Menu_Multibanda
% Last Modified by GUIDE v2.5 11-Jul-2014 15:44:52
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @NDRVI_Menu_Multibanda_OpeningFcn, ...
'gui_OutputFcn', @NDRVI_Menu_Multibanda_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 NDRVI_Menu_Multibanda is made visible.
function NDRVI_Menu_Multibanda_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 NDRVI_Menu_Multibanda (see VARARGIN)
% Choose default command line output for NDRVI_Menu_Multibanda
handles.output = hObject;
%% Cargamos el nombre del programa
global program_name;
set(handles.title,'string',program_name);
%% Parte gestion proyectos
if nargin==5
handles.pathProyecto=varargin{1,1};
handles.indiceProyecto=varargin{1,2};
pathProyecto=handles.pathProyecto;
indiceProyecto=handles.indiceProyecto;
save ('ultimoProyecto','pathProyecto','indiceProyecto');
else
load ('ultimoProyecto','pathProyecto','indiceProyecto');
handles.pathProyecto=pathProyecto;
handles.indiceProyecto=indiceProyecto;
end
%% Añadimos las funciones de Indices
%clc;
%matlabpool open 2;
%% Generamos las 6 bandas del programa
handles.Master=Banda;
handles.B1=Banda;
handles.B2=Banda;
handles.B3=Banda;
handles.B4=Banda;
handles.B5=Banda;
%% Ponemos a 0 los radiobuttons
set(handles.radiobutton_dentro_imagen_Master,'value',0);
set(handles.radiobutton_fuera_imagen_Master,'value',0);
set(handles.radiobutton_dentro_imagen_1,'value',0);
set(handles.radiobutton_fuera_imagen_1,'value',0);
set(handles.radiobutton_dentro_imagen_2,'value',0);
set(handles.radiobutton_fuera_imagen_2,'value',0);
set(handles.radiobutton_dentro_imagen_3,'value',0);
set(handles.radiobutton_fuera_imagen_3,'value',0);
set(handles.radiobutton_dentro_imagen_4,'value',0);
set(handles.radiobutton_fuera_imagen_4,'value',0);
set(handles.radiobutton_dentro_imagen_5,'value',0);
set(handles.radiobutton_fuera_imagen_5,'value',0);
%Inicializa los valores de las reflectancias de cada Banda presentes en la
%DB
[Master_db,IR_db_text]=xlsread('c\..\DB_folder\Multibanda_db.xlsx',1); %% posible fallo¿? IR_db_text dond va?
IR_db_size=size(Master_db);
str_list_Master{1}=IR_db_text{1};
str_list_Master{2}=IR_db_text{2};
for i=1:IR_db_size(1)
str_list_Master{i+2}=strcat(num2str(Master_db(i,1)),'/',num2str(Master_db(i,2)));
end
[B1_db,R_db_text]=xlsread('c\..\DB_folder\Multibanda_db.xlsx',2);
R_db_size=size(B1_db);
str_list_B1{1}=R_db_text{1};
str_list_B1{2}=R_db_text{2};
for i=1:R_db_size(1)
str_list_B1{i+2}=strcat(num2str(B1_db(i,1)),'/',num2str(B1_db(i,2)));
end
[B2_db,R_db_text]=xlsread('c\..\DB_folder\Multibanda_db.xlsx',3);
R_db_size=size(B2_db);
str_list_B2{1}=R_db_text{1};
str_list_B2{2}=R_db_text{2};
for i=1:R_db_size(1)
str_list_B2{i+2}=strcat(num2str(B2_db(i,1)),'/',num2str(B2_db(i,2)));
end
[B3_db,R_db_text]=xlsread('c\..\DB_folder\Multibanda_db.xlsx',4);
R_db_size=size(B3_db);
str_list_B3{1}=R_db_text{1};
str_list_B3{2}=R_db_text{2};
for i=1:R_db_size(1)
str_list_B3{i+2}=strcat(num2str(B3_db(i,1)),'/',num2str(B3_db(i,2)));
end
[B4_db,R_db_text]=xlsread('c\..\DB_folder\Multibanda_db.xlsx',5);
R_db_size=size(B4_db);
str_list_B4{1}=R_db_text{1};
str_list_B4{2}=R_db_text{2};
for i=1:R_db_size(1)
str_list_B4{i+2}=strcat(num2str(B4_db(i,1)),'/',num2str(B4_db(i,2)));
end
[B5_db,R_db_text]=xlsread('c\..\DB_folder\Multibanda_db.xlsx',6);
R_db_size=size(B5_db);
str_list_B5{1}=R_db_text{1};
str_list_B5{2}=R_db_text{2};
for i=1:R_db_size(1)
str_list_B5{i+2}=strcat(num2str(B5_db(i,1)),'/',num2str(B5_db(i,2)));
end
%% cargamos los posibles indices
str_list_IV=importdata('c\..\DB_folder\IV_db.xlsx');
%% Fijamos los valores de los popupmenus
set(handles.popupmenu_valores_Master,'string',str_list_Master);
set(handles.popupmenu_valores_1,'string',str_list_B1);
set(handles.popupmenu_valores_2,'string',str_list_B2);
set(handles.popupmenu_valores_3,'string',str_list_B3);
set(handles.popupmenu_valores_4,'string',str_list_B4);
set(handles.popupmenu_valores_5,'string',str_list_B5);
set(handles.popupmenu_IV,'string',str_list_IV);
%% Guardamos en handles los valores
handles.Master.database=Master_db;
handles.B1.database=B1_db;
handles.B2.database=B2_db;
handles.B3.database=B3_db;
handles.B4.database=B4_db;
handles.B5.database=B5_db;
handles.x1_B1=[];
handles.x1_B2=[];
handles.x1_B3=[];
handles.x1_B4=[];
handles.x1_B5=[];
clear IR_db IR_db_size IR_db_text R_db R_db_size R_db_text
%% Borramos la seleccion de color para el mapa final
set(handles.radiobutton_RGB_Gris,'value',0);
set(handles.radiobutton_Jet,'value',0);
set(handles.radiobutton_Rainbow,'value',0);
%% Indice elegido por defecto NDVI
handles.opcionIndice=1;
%% Establecemos los valores de las reflectancias de cada banda
set(handles.edit_ref_blanco_master,'String',num2str(0.9));
set(handles.edit_ref_gris_master,'String',num2str(0.18));
set(handles.edit_ref_negro_master,'String',num2str(0.05));
set(handles.edit_ref_blanco_1,'String',num2str(0.9));
set(handles.edit_ref_gris_1,'String',num2str(0.18));
set(handles.edit_ref_negro_1,'String',num2str(0.05));
set(handles.edit_ref_blanco_2,'String',num2str(0.9));
set(handles.edit_ref_gris_2,'String',num2str(0.18));
set(handles.edit_ref_negro_2,'String',num2str(0.05));
set(handles.edit_ref_blanco_3,'String',num2str(0.9));
set(handles.edit_ref_gris_3,'String',num2str(0.18));
set(handles.edit_ref_negro_3,'String',num2str(0.05));
set(handles.edit_ref_blanco_4,'String',num2str(0.9));
set(handles.edit_ref_gris_4,'String',num2str(0.18));
set(handles.edit_ref_negro_4,'String',num2str(0.05));
set(handles.edit_ref_blanco_5,'String',num2str(0.9));
set(handles.edit_ref_gris_5,'String',num2str(0.18));
set(handles.edit_ref_negro_5,'String',num2str(0.05));
%% Exactamente no se a que se refiere
handles.rgb_g_limits(1)=0; handles.rgb_g_limits(2)=handles.rgb_g_limits(1);
handles.rgb_g_limits(3)=handles.rgb_g_limits(1); handles.rgb_g_limits(4)=handles.rgb_g_limits(1);
handles.rgb_g_limits(5)=handles.rgb_g_limits(1); handles.rgb_g_limits(6)=handles.rgb_g_limits(1);
handles.status_suelo=0;
handles.auxiliar_limits(1)=0; handles.auxiliar_limits(2)=handles.auxiliar_limits(1);
handles.auxiliar_limits(3)=handles.auxiliar_limits(1); handles.auxiliar_limits(4)=handles.auxiliar_limits(1);
handles.auxiliar_limits(5)=handles.auxiliar_limits(1); handles.auxiliar_limits(6)=handles.auxiliar_limits(1);
handles.check_aux(1)=0; handles.check_aux(2)=handles.check_aux(1); handles.check_aux(3)=handles.check_aux(1);
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes NDRVI_Menu_Multibanda wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = NDRVI_Menu_Multibanda_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 menu_editor_Archivo_Callback(hObject, eventdata, handles)
% hObject handle to menu_editor_Archivo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function menu_editor_Archivo_Biblioteca_Callback(hObject, eventdata, handles)
% hObject handle to menu_editor_Archivo_Biblioteca (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
winopen('c\..\DB_folder\BIBLIO_IND_db.xlsx');
% --------------------------------------------------------------------
function menu_editor_Archivo_Volver_Callback(hObject, eventdata, handles)
% hObject handle to menu_editor_Archivo_Volver (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clear all;
close NDRVI_Menu_Multibanda;
NDRVI_Main;
% --------------------------------------------------------------------
function menu_editor_Archivo_Salir_Callback(hObject, eventdata, handles)
% hObject handle to menu_editor_Archivo_Salir (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clear all;
close NDRVI_Menu_Multibanda;
% --------------------------------------------------------------------
function menu_editor_Ayuda_Callback(hObject, eventdata, handles)
% hObject handle to menu_editor_Ayuda (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function menu_editor_Ayuda_Acerca_de_Callback(hObject, eventdata, handles)
% hObject handle to menu_editor_Ayuda_Acerca_de (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
NDRVI_About;
% --- Executes when selected object is changed in uipanel_calibracion_master.
function uipanel_calibracion_master_SelectionChangeFcn(hObject, eventdata, handles)
fuera_imagen_value_Master=get(handles.radiobutton_fuera_imagen_Master,'Value');
% si es 0 es dentro de imagen y 1 es fuera imagen
if fuera_imagen_value_Master==1
% Calibración Master
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*.*'},'Selecciona imagen calibración Master',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'));
% Leemos la imagen y nos quedamos solo con el canal que nos interesa (Tiff tiene 3 canales iguales aunque sea monocroma)
ND=double(imread(strcat(Im_PathName,Im_Name)));
ND_Master=ND(:,:,1);
% Obtenemos el máximo y el mínimo y hacemos el stretching
minimo1=min(min(ND_Master)); %% Doble min pq es matriz
maximo1=max(max(ND_Master)); %% Doble max pq es matriz
ima1=figure;
imshow(ND_Master);
caxis([ minimo1 maximo1]);
title('Marcar primero blanco, luego gris y finalmente negro (banda Master)');
colorbar;
[x,y]= ginput(3);
handles.XY=[x,y];
handles.PathCalibracion=strcat(Im_PathName,Im_Name);
%% Guardamos los valores digitales de los puntos para luego mostrarlos en la UI
maximo= ND_Master( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_Master( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_Master( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_Master=[maximo minimo_g minimo_n];
close(ima1);
clear Im_PathName Im_Name ND ND_IR minimo1 maximo1 ima1 maximo minimo_g minimo_n x y
else
%% Si es dentro de imagen se colocan como 0 los valores digitales de negro blanco y gris
handles.x1_Master(1)=0; handles.x1_Master(2)=handles.x1_Master(1); handles.x1_Master(3)=handles.x1_Master(1);
end
%% Mostramos en la UI los valores digitales de los tres colores
set(handles.edit_calib_blanco_master,'String',handles.x1_Master(1));
set(handles.edit_calib_gris_master,'String',handles.x1_Master(2));
set(handles.edit_calib_negro_master,'String',handles.x1_Master(3));
guidata(hObject, handles);
% --- Executes when selected object is changed in uipanel_calibracion_1.
function uipanel_calibracion_1_SelectionChangeFcn(hObject, eventdata, handles)
% hObject handle to the selected object in uipanel_calibracion_1
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
fuera_imagen_value_B1=get(handles.radiobutton_fuera_imagen_1,'Value');
if fuera_imagen_value_B1==1
%Calibración B1
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagen calibración Banda 1',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'));
ND=double(imread(strcat(Im_PathName,Im_Name)));
ND_B1=ND(:,:,1);
minimo1=min(min(ND_B1));
maximo1=max(max(ND_B1));
ima1=figure;
imshow(ND_B1);
caxis([ minimo1 maximo1]);
title('Marcar primero blanco, luego gris y finalmente negro (banda 1)');
colorbar;
[x,y]= ginput(3);
maximo= ND_B1( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B1( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B1( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B1=[maximo minimo_g minimo_n];
close(ima1);
clear Im_PathName Im_Name ND ND_B1 minimo1 maximo1 ima1 maximo minimo_g minimo_n x y
else
handles.x1_B1(1)=0; handles.x1_B1(2)=handles.x1_B1(1); handles.x1_B1(3)=handles.x1_B1(1);
end
set(handles.edit_calib_blanco_1,'String',handles.x1_B1(1));
set(handles.edit_calib_gris_1,'String',handles.x1_B1(2));
set(handles.edit_calib_negro_1,'String',handles.x1_B1(3));
guidata(hObject, handles);
% --- Executes when selected object is changed in uipanel_calibracion_2.
function uipanel_calibracion_2_SelectionChangeFcn(hObject, eventdata, handles)
% hObject handle to the selected object in uipanel_calibracion_2
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
fuera_imagen_value_B2=get(handles.radiobutton_fuera_imagen_2,'Value');
if fuera_imagen_value_B2==1
%Calibración B2
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagen calibración Banda 2',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'));
ND=double(imread(strcat(Im_PathName,Im_Name)));
ND_B2=ND(:,:,1);
minimo1=min(min(ND_B2));
maximo1=max(max(ND_B2));
ima1=figure;
imshow(ND_B2);
caxis([ minimo1 maximo1]);
title('Marcar primero blanco, luego gris y finalmente negro (banda 2)');
colorbar;
[x,y]= ginput(3);
maximo= ND_B2( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B2( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B2( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B2=[maximo minimo_g minimo_n];
close(ima1);
clear Im_PathName Im_Name ND ND_B2 minimo1 maximo1 ima1 maximo minimo_g minimo_n x y
else
handles.x1_B2(1)=0; handles.x1_B2(2)=handles.x1_B2(1); handles.x1_B2(3)=handles.x1_B2(1);
end
set(handles.edit_calib_blanco_2,'String',handles.x1_B2(1));
set(handles.edit_calib_gris_2,'String',handles.x1_B2(2));
set(handles.edit_calib_negro_2,'String',handles.x1_B2(3));
guidata(hObject, handles);
% --- Executes when selected object is changed in uipanel_calibracion_2.
function uipanel_calibracion_3_SelectionChangeFcn(hObject, eventdata, handles)
% hObject handle to the selected object in uipanel_calibracion_2
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
fuera_imagen_value_B3=get(handles.radiobutton_fuera_imagen_3,'Value');
if fuera_imagen_value_B3==1
%Calibración B3
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagen calibración Banda 3',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'));
ND=double(imread(strcat(Im_PathName,Im_Name)));
ND_B3=ND(:,:,1);
minimo1=min(min(ND_B3));
maximo1=max(max(ND_B3));
ima1=figure;
imshow(ND_B3);
caxis([ minimo1 maximo1]);
title('Marcar primero blanco, luego gris y finalmente negro (banda 3)');
colorbar;
[x,y]= ginput(3);
maximo= ND_B3( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B3( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B3( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B3=[maximo minimo_g minimo_n];
close(ima1);
clear Im_PathName Im_Name ND ND_B3 minimo1 maximo1 ima1 maximo minimo_g minimo_n x y
else
handles.x1_B3(1)=0; handles.x1_B3(2)=handles.x1_B3(1); handles.x1_B3(3)=handles.x1_B3(1);
end
set(handles.edit_calib_blanco_3,'String',handles.x1_B3(1));
set(handles.edit_calib_gris_3,'String',handles.x1_B3(2));
set(handles.edit_calib_negro_3,'String',handles.x1_B3(3));
guidata(hObject, handles);
% --- Executes when selected object is changed in uipanel_calibracion_2.
function uipanel_calibracion_4_SelectionChangeFcn(hObject, eventdata, handles)
% hObject handle to the selected object in uipanel_calibracion_2
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
fuera_imagen_value_B4=get(handles.radiobutton_fuera_imagen_4,'Value');
if fuera_imagen_value_B4==1
%Calibración B2
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagen calibración Banda 4',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'));
ND=double(imread(strcat(Im_PathName,Im_Name)));
ND_B4=ND(:,:,1);
minimo1=min(min(ND_B4));
maximo1=max(max(ND_B4));
ima1=figure;
imshow(ND_B4);
caxis([ minimo1 maximo1]);
title('Marcar primero blanco, luego gris y finalmente negro (banda 4)');
colorbar;
[x,y]= ginput(3);
maximo= ND_B4( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B4( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B4( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B4=[maximo minimo_g minimo_n];
close(ima1);
clear Im_PathName Im_Name ND ND_B4 minimo1 maximo1 ima1 maximo minimo_g minimo_n x y
else
handles.x1_B4(1)=0; handles.x1_B4(2)=handles.x1_B4(1); handles.x1_B4(3)=handles.x1_B4(1);
end
set(handles.edit_calib_blanco_4,'String',handles.x1_B4(1));
set(handles.edit_calib_gris_4,'String',handles.x1_B4(2));
set(handles.edit_calib_negro_4,'String',handles.x1_B4(3));
guidata(hObject, handles);
% --- Executes when selected object is changed in uipanel_calibracion_2.
function uipanel_calibracion_5_SelectionChangeFcn(hObject, eventdata, handles)
% hObject handle to the selected object in uipanel_calibracion_2
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
fuera_imagen_value_B5=get(handles.radiobutton_fuera_imagen_5,'Value');
if fuera_imagen_value_B5==1
%Calibración B5
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagen calibración Banda 5',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'));
ND=double(imread(strcat(Im_PathName,Im_Name)));
ND_B5=ND(:,:,1);
minimo1=min(min(ND_B5));
maximo1=max(max(ND_B5));
ima1=figure;
imshow(ND_B5);
caxis([ minimo1 maximo1]);
title('Marcar primero blanco, luego gris y finalmente negro (banda 5)');
colorbar;
[x,y]= ginput(3);
maximo= ND_B5( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B5( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B5( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B5=[maximo minimo_g minimo_n];
close(ima1);
clear Im_PathName Im_Name ND ND_B5 minimo1 maximo1 ima1 maximo minimo_g minimo_n x y
else
handles.x1_B5(1)=0; handles.x1_B5(2)=handles.x1_B5(1); handles.x1_B5(3)=handles.x1_B5(1);
end
set(handles.edit_calib_blanco_5,'String',handles.x1_B5(1));
set(handles.edit_calib_gris_5,'String',handles.x1_B5(2));
set(handles.edit_calib_negro_5,'String',handles.x1_B5(3));
guidata(hObject, handles);
% --- Executes on selection change in popupmenu_valores_1.
function popupmenu_valores_1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_valores_1 (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_valores_1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu_valores_1
% --- Executes during object creation, after setting all properties.
function popupmenu_valores_1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu_valores_1 (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 popupmenu_valores_Master.
function popupmenu_valores_Master_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_valores_Master (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_valores_Master contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu_valores_Master
% --- Executes during object creation, after setting all properties.
function popupmenu_valores_Master_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu_valores_Master (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 popupmenu_IV.
function popupmenu_IV_Callback(hObject, eventdata, handles)
handles.opcionIndice=get(handles.popupmenu_IV,'Value');
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function popupmenu_IV_CreateFcn(hObject, eventdata, handles)
handles.opcionIndice=1;
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes when selected object is changed in uipanel_colormap.
function uipanel_colormap_SelectionChangeFcn(hObject, eventdata, handles)
% hObject handle to the selected object in uipanel_colormap
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
rgb_gris_value=get(handles.radiobutton_RGB_Gris,'Value');
if rgb_gris_value==1
[handles.rgb_g_limits(1),handles.rgb_g_limits(2),handles.rgb_g_limits(3),handles.rgb_g_limits(4),handles.rgb_g_limits(5),handles.rgb_g_limits(6),handles.status_suelo,...
handles.auxiliar_limits(1),handles.auxiliar_limits(2),handles.auxiliar_limits(3),handles.auxiliar_limits(4),handles.auxiliar_limits(5),handles.auxiliar_limits(6),...
handles.check_aux(1),handles.check_aux(2),handles.check_aux(3)]=...
NDRVI_RGB_Menu(handles.rgb_g_limits(1),handles.rgb_g_limits(2),handles.rgb_g_limits(3),handles.rgb_g_limits(4),handles.rgb_g_limits(5),handles.rgb_g_limits(6),handles.status_suelo,...
handles.auxiliar_limits(1),handles.auxiliar_limits(2),handles.auxiliar_limits(3),handles.auxiliar_limits(4),handles.auxiliar_limits(5),handles.auxiliar_limits(6),...
handles.check_aux(1),handles.check_aux(2),handles.check_aux(3));
end
guidata(hObject, handles);
function edit_ref_blanco_master_Callback(hObject, eventdata, handles)
% hObject handle to edit_ref_blanco_master (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_ref_blanco_master as text
% str2double(get(hObject,'String')) returns contents of edit_ref_blanco_master as a double
% --- Executes during object creation, after setting all properties.
function edit_ref_blanco_master_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_ref_blanco_master (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_ref_gris_master_Callback(hObject, eventdata, handles)
% hObject handle to edit_ref_gris_master (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_ref_gris_master as text
% str2double(get(hObject,'String')) returns contents of edit_ref_gris_master as a double
% --- Executes during object creation, after setting all properties.
function edit_ref_gris_master_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_ref_gris_master (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_ref_negro_master_Callback(hObject, eventdata, handles)
% hObject handle to edit_ref_negro_master (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_ref_negro_master as text
% str2double(get(hObject,'String')) returns contents of edit_ref_negro_master as a double
% --- Executes during object creation, after setting all properties.
function edit_ref_negro_master_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_ref_negro_master (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_ref_blanco_1_Callback(hObject, eventdata, handles)
% hObject handle to edit_ref_blanco_1 (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_ref_blanco_1 as text
% str2double(get(hObject,'String')) returns contents of edit_ref_blanco_1 as a double
% --- Executes during object creation, after setting all properties.
function edit_ref_blanco_1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_ref_blanco_1 (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_ref_gris_1_Callback(hObject, eventdata, handles)
% hObject handle to edit_ref_gris_1 (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_ref_gris_1 as text
% str2double(get(hObject,'String')) returns contents of edit_ref_gris_1 as a double
% --- Executes during object creation, after setting all properties.
function edit_ref_gris_1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_ref_gris_1 (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_ref_negro_1_Callback(hObject, eventdata, handles)
% hObject handle to edit_ref_negro_1 (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_ref_negro_1 as text
% str2double(get(hObject,'String')) returns contents of edit_ref_negro_1 as a double
% --- Executes during object creation, after setting all properties.
function edit_ref_negro_1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_ref_negro_1 (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 checkbox_hist.
function checkbox_hist_Callback(hObject, eventdata, handles)
% hObject handle to checkbox_hist (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 checkbox_hist
% --- Executes on button press in checkbox_cuadricula.
function checkbox_cuadricula_Callback(hObject, eventdata, handles)
% hObject handle to checkbox_cuadricula (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 checkbox_cuadricula
status_cuad=get(handles.checkbox_cuadricula,'Value');
if status_cuad==1
prompt={'Divisiones en X:','Divisiones en Y:'};
dlg_title='Cuadrícula';
num_lines=1;
def={'',''};
answer=inputdlg(prompt,dlg_title,num_lines,def);
handles.cuad_div=str2double(answer);
guidata(hObject, handles);
end
% --- Executes on button press in pushbutton_examinar_master.
function pushbutton_examinar_master_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_examinar_master (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagenes a procesar (Master)',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'),'MultiSelect', 'on');
handles.Master.path=strcat(Im_PathName,Im_Name);
set(handles.text_examinar_Master,'String',handles.Master.path);
clear Im_Name Im_PathName
guidata(hObject, handles);
% --- Executes on button press in pushbutton_examinar_1.
function pushbutton_examinar_1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_examinar_1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagenes a procesar (Banda 1)',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'),'MultiSelect', 'on');
handles.B1.path=strcat(Im_PathName,Im_Name);
set(handles.text_examinar_1,'String',handles.B1.path);
clear Im_Name Im_PathName
guidata(hObject, handles);
% --- Executes on button press in pushbutton_examinar_2.
function pushbutton_examinar_2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_examinar_2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagenes a procesar (Banda 2)',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'),'MultiSelect', 'on');
handles.B2.path=strcat(Im_PathName,Im_Name);
set(handles.text_examinar_2,'String',handles.B2.path);
clear Im_Name Im_PathName
guidata(hObject, handles);
% --- Executes on button press in pushbutton_examinar_3.
function pushbutton_examinar_3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_examinar_3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagenes a procesar (Banda 3)',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'),'MultiSelect', 'on');
handles.B3.path=strcat(Im_PathName,Im_Name);
set(handles.text_examinar_3,'String',handles.B3.path);
clear Im_Name Im_PathName
guidata(hObject, handles);
% --- Executes on button press in pushbutton_examinar_4.
function pushbutton_examinar_4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_examinar_4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagenes a procesar (Banda 4)',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'),'MultiSelect', 'on');
handles.B4.path=strcat(Im_PathName,Im_Name);
set(handles.text_examinar_4,'String',handles.B4.path);
clear Im_Name Im_PathName
guidata(hObject, handles);
% --- Executes on button press in pushbutton_examinar_5.
function pushbutton_examinar_5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_examinar_5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[Im_Name,Im_PathName] = uigetfile({'*tif';'*.jpg';'*.jpeg';'*tiff';'*.*'},'Selecciona imagenes a procesar (Banda 5)',strcat(handles.pathProyecto,'/Tiffs 16 bits para procesar/Per bandes'),'MultiSelect', 'on');
handles.B5.path=strcat(Im_PathName,Im_Name);
set(handles.text_examinar_5,'String',handles.B5.path);
clear Im_Name Im_PathName
guidata(hObject, handles);
%% %% Llamada a funcion externa!
% --- Executes on button press in pushbutton_procesa.
function pushbutton_procesa_Callback(hObject, eventdata, handles)
if get(handles.chkCalibSimple,'Value')==1
%% Opcion de calibrar todas a la vez
% En caso de haber seleccionado la opción de calibrado simple, se evalúan
% el resto de reflectancias
% para ello hay que abrir una imagen de cada banda de la 1 a la 5 con los
% mismos puntos de calibracion que la banda master
% Primero buscamos el path de la imagen. Sabemos que acabará en 1 y tiene
% el mismo nombre que la master:
[pathGeneral,nombreMaster,extension] = fileparts(handles.PathCalibracion);
nombreGeneral=nombreMaster(1:end-1);
pathB1=strcat(pathGeneral,'/',nombreGeneral,num2str(1),extension);
pathB2=strcat(pathGeneral,'/',nombreGeneral,num2str(2),extension);
pathB3=strcat(pathGeneral,'/',nombreGeneral,num2str(3),extension);
pathB4=strcat(pathGeneral,'/',nombreGeneral,num2str(4),extension);
pathB5=strcat(pathGeneral,'/',nombreGeneral,num2str(5),extension);
% Leemos la imagen y nos quedamos solo con el canal que nos interesa (Tiff tiene 3 canales iguales aunque sea monocroma)
x= handles.XY(:,1);
y= handles.XY(:,2);
%Leemos la imagen de la banda correspondiente y obtenemos los valores
%de calibracion usando los mismos puntos que para la banda master
ND=double(imread(pathB1));
ND_B1=ND(:,:,1);
maximo= ND_B1( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B1( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B1( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B1=[maximo minimo_g minimo_n];
% Mostramos en la UI los valores digitales de los tres colores
set(handles.edit_calib_blanco_1,'String',handles.x1_B1(1));
set(handles.edit_calib_gris_1,'String',handles.x1_B1(2));
set(handles.edit_calib_negro_1,'String',handles.x1_B1(3));
ND=double(imread(pathB2));
ND_B2=ND(:,:,1);
maximo= ND_B2( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B2( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B2( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B2=[maximo minimo_g minimo_n];
% Mostramos en la UI los valores digitales de los tres colores
set(handles.edit_calib_blanco_2,'String',handles.x1_B2(1));
set(handles.edit_calib_gris_2,'String',handles.x1_B2(2));
set(handles.edit_calib_negro_2,'String',handles.x1_B2(3));
ND=double(imread(pathB3));
ND_B3=ND(:,:,1);
maximo= ND_B3( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B3( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B3( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B3=[maximo minimo_g minimo_n];
% Mostramos en la UI los valores digitales de los tres colores
set(handles.edit_calib_blanco_3,'String',handles.x1_B3(1));
set(handles.edit_calib_gris_3,'String',handles.x1_B3(2));
set(handles.edit_calib_negro_3,'String',handles.x1_B3(3));
ND=double(imread(pathB4));
ND_B4=ND(:,:,1);
maximo= ND_B4( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B4( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B4( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B4=[maximo minimo_g minimo_n];
% Mostramos en la UI los valores digitales de los tres colores
set(handles.edit_calib_blanco_4,'String',handles.x1_B4(1));
set(handles.edit_calib_gris_4,'String',handles.x1_B4(2));
set(handles.edit_calib_negro_4,'String',handles.x1_B4(3));
ND=double(imread(pathB5));
ND_B5=ND(:,:,1);
maximo= ND_B5( round(y(1,1)) , round(x(1,1)) ); %blanco
minimo_g= ND_B5( round(y(2,1)) , round(x(2,1)) ); %negro/gris
minimo_n= ND_B5( round(y(3,1)) , round(x(3,1)) ); %negro/gris
handles.x1_B5=[maximo minimo_g minimo_n];
% Mostramos en la UI los valores digitales de los tres colores
set(handles.edit_calib_blanco_5,'String',handles.x1_B5(1));
set(handles.edit_calib_gris_5,'String',handles.x1_B5(2));
set(handles.edit_calib_negro_5,'String',handles.x1_B5(3));
end
%% Recogemos las opciones seleccionadas
handles.Master.valores=get(handles.popupmenu_valores_Master,'Value');
handles.B1.valores=get(handles.popupmenu_valores_1,'Value');
handles.B2.valores=get(handles.popupmenu_valores_2,'Value');
handles.B3.valores=get(handles.popupmenu_valores_3,'Value');
handles.B4.valores=get(handles.popupmenu_valores_4,'Value');
handles.B5.valores=get(handles.popupmenu_valores_5,'Value');
handles.Master.dentroIm=get(handles.radiobutton_dentro_imagen_Master,'Value');
handles.Master.fueraIm=get(handles.radiobutton_fuera_imagen_Master,'Value');
handles.B1.dentroIm=get(handles.radiobutton_dentro_imagen_1,'Value');
handles.B1.fueraIm=get(handles.radiobutton_fuera_imagen_1,'Value');
handles.B2.dentroIm=get(handles.radiobutton_dentro_imagen_2,'Value');
handles.B2.fueraIm=get(handles.radiobutton_fuera_imagen_2,'Value');
handles.B3.dentroIm=get(handles.radiobutton_dentro_imagen_3,'Value');
handles.B3.fueraIm=get(handles.radiobutton_fuera_imagen_3,'Value');
handles.B4.dentroIm=get(handles.radiobutton_dentro_imagen_4,'Value');
handles.B4.fueraIm=get(handles.radiobutton_fuera_imagen_4,'Value');
handles.B5.dentroIm=get(handles.radiobutton_dentro_imagen_5,'Value');
handles.B5.fueraIm=get(handles.radiobutton_fuera_imagen_5,'Value');
cmap_rgb_g=get(handles.radiobutton_RGB_Gris,'Value');
cmap_jet=get(handles.radiobutton_Jet,'Value');
cmap_rb=get(handles.radiobutton_Rainbow,'Value');
handles.Master.reflectancias(1)=str2double(get(handles.edit_ref_blanco_master,'String'));
handles.Master.reflectancias(2)=str2double(get(handles.edit_ref_gris_master,'String'));
handles.Master.reflectancias(3)=str2double(get(handles.edit_ref_negro_master,'String'));
handles.B1.reflectancias(1)=str2double(get(handles.edit_ref_blanco_1,'String'));
handles.B1.reflectancias(2)=str2double(get(handles.edit_ref_gris_1,'String'));
handles.B1.reflectancias(3)=str2double(get(handles.edit_ref_negro_1,'String'));
handles.B2.reflectancias(1)=str2double(get(handles.edit_ref_blanco_2,'String'));
handles.B2.reflectancias(2)=str2double(get(handles.edit_ref_gris_2,'String'));
handles.B2.reflectancias(3)=str2double(get(handles.edit_ref_negro_2,'String'));
handles.B3.reflectancias(1)=str2double(get(handles.edit_ref_blanco_3,'String'));
handles.B3.reflectancias(2)=str2double(get(handles.edit_ref_gris_3,'String'));
handles.B3.reflectancias(3)=str2double(get(handles.edit_ref_negro_3,'String'));
handles.B4.reflectancias(1)=str2double(get(handles.edit_ref_blanco_4,'String'));
handles.B4.reflectancias(2)=str2double(get(handles.edit_ref_gris_4,'String'));
handles.B4.reflectancias(3)=str2double(get(handles.edit_ref_negro_4,'String'));
handles.B5.reflectancias(1)=str2double(get(handles.edit_ref_blanco_5,'String'));
handles.B5.reflectancias(2)=str2double(get(handles.edit_ref_gris_5,'String'));
handles.B5.reflectancias(3)=str2double(get(handles.edit_ref_negro_5,'String'));