Changeset 282
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r280 r282 6 6 % 7 7 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 8 % Copyright Joel Sommeria, 20 08, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org.8 % Copyright Joel Sommeria, 2011, LEGI / CNRS-UJF-INPG, sommeria@legi.grenoble-inp.fr 9 9 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 10 10 % This file is part of the toolbox UVMAT. … … 23 23 %TODO: search range 24 24 25 % Last Modified by GUIDE v2.5 18-Nov-2011 1 0:14:2325 % Last Modified by GUIDE v2.5 18-Nov-2011 15:30:17 26 26 % Begin initialization code - DO NOT EDIT 27 27 gui_Singleton = 1; … … 52 52 %list of field numbers to process 53 53 %subdir: subdirectory of the opened netcdf file 54 %ind_opening: operation number advised for beginning (1=c iv1,2=fix1,3=patch1,4=civ2,5=fix2,6=patch2),54 %ind_opening: operation number advised for beginning (1=checkciv1,2=checkfix1,3=checkpatch1,4=checkciv2,5=checkfix2,6=checkpatch2), 55 55 %ind_a_opening ind_b_opening chosen pair from the opened netcdf file 56 56 % Choose default command line output for civ … … 173 173 enable_fix2(handles,0) 174 174 enable_patch2(handles,0) 175 set(handles.C IV1,'Value',0)176 set(handles. FIX1,'Value',0)177 set(handles. PATCH1,'Value',0)178 set(handles.C IV2,'Value',0)179 set(handles. FIX2,'Value',0)180 set(handles. PATCH2,'Value',0)175 set(handles.CheckCiv1,'Value',0) 176 set(handles.CheckFix1,'Value',0) 177 set(handles.CheckPatch1,'Value',0) 178 set(handles.CheckCiv2,'Value',0) 179 set(handles.CheckFix2,'Value',0) 180 set(handles.CheckPatch2,'Value',0) 181 181 %set(handles.frame_subdirciv2,'BackgroundColor',[0.831 0.816 0.784]) 182 182 if isequal(ind_opening,1) 183 set(handles.C IV1,'Value',1)183 set(handles.CheckCiv1,'Value',1) 184 184 enable_civ1(handles,1) 185 185 elseif isequal(ind_opening,2) 186 set(handles. FIX1,'Value',1)186 set(handles.CheckFix1,'Value',1) 187 187 enable_fix1(handles,1) 188 188 elseif isequal(ind_opening,3) 189 set(handles. PATCH1,'Value',1)189 set(handles.CheckPatch1,'Value',1) 190 190 enable_patch1(handles,1) 191 191 elseif isequal(ind_opening,4) 192 set(handles.C IV2,'Value',1)192 set(handles.CheckCiv2,'Value',1) 193 193 enable_civ2(handles,1) 194 194 elseif isequal(ind_opening,5) 195 set(handles. FIX2,'Value',1)195 set(handles.CheckFix2,'Value',1) 196 196 enable_fix2(handles,1) 197 197 set(handles.frame_subdirciv2,'BackgroundColor',[1 1 0]) 198 set(handles. list_pair_civ2,'Enable','On')199 set(handles. list_pair_civ2,'Enable','On')198 set(handles.ListPairCiv2,'Enable','On') 199 set(handles.ListPairCiv2,'Enable','On') 200 200 enable_pair1(handles,'off') 201 201 elseif isequal(ind_opening,6) 202 set(handles. PATCH2,'Value',1)202 set(handles.CheckPatch2,'Value',1) 203 203 enable_patch2(handles,1) 204 204 set(handles.frame_subdirciv2,'BackgroundColor',[1 1 0]) 205 set(handles. list_pair_civ2,'Enable','On')205 set(handles.ListPairCiv2,'Enable','On') 206 206 enable_pair1(handles,'off') 207 207 end … … 319 319 num_j2=stra2num(str_b); 320 320 if isnan(num_j2),num_j2=num_j1;end 321 if isequal(get(handles. compare,'Value'),1)321 if isequal(get(handles.ListCompareMode,'Value'),1) 322 322 browse=[];%initialisation 323 323 else … … 342 342 if ~isempty(Data.CivStage)%test for civ files 343 343 ind_opening=Data.CivStage; 344 set(handles. CivMode,'Value',3)344 set(handles.ListPairMode,'Value',3) 345 345 end 346 346 if ~isempty(Data.absolut_time_T0)%test for civx files 347 set(handles. CivMode,'Value',1)347 set(handles.ListPairMode,'Value',1) 348 348 if isfield(Data,'fix') && isequal(Data.fix,1) 349 349 ind_opening=3; … … 405 405 enable_fix2(handles,0) 406 406 enable_patch2(handles,0) 407 set(handles.C IV1,'Value',0)408 set(handles. FIX1,'Value',0)409 set(handles. PATCH1,'Value',0)410 set(handles.C IV2,'Value',0)411 set(handles. FIX2,'Value',0)412 set(handles. PATCH2,'Value',0)407 set(handles.CheckCiv1,'Value',0) 408 set(handles.CheckFix1,'Value',0) 409 set(handles.CheckPatch1,'Value',0) 410 set(handles.CheckCiv2,'Value',0) 411 set(handles.CheckFix2,'Value',0) 412 set(handles.CheckPatch2,'Value',0) 413 413 % set(handles.frame_subdirciv2,'BackgroundColor',[0.831 0.816 0.784]) 414 414 if isequal(ind_opening,1) 415 set(handles.C IV1,'Value',1)415 set(handles.CheckCiv1,'Value',1) 416 416 enable_civ1(handles,'on') 417 417 elseif isequal(ind_opening,2) 418 set(handles. FIX1,'Value',1)418 set(handles.CheckFix1,'Value',1) 419 419 enable_fix1(handles,'on') 420 420 elseif isequal(ind_opening,3) 421 set(handles. PATCH1,'Value',1)421 set(handles.CheckPatch1,'Value',1) 422 422 enable_patch1(handles) 423 423 elseif isequal(ind_opening,4) 424 set(handles.C IV2,'Value',1)424 set(handles.CheckCiv2,'Value',1) 425 425 enable_civ2(handles,'on') 426 426 elseif isequal(ind_opening,5) 427 427 enable_pair1(handles,'off') 428 set(handles. FIX2,'Value',1)428 set(handles.CheckFix2,'Value',1) 429 429 enable_fix2(handles) 430 430 set(handles.frame_subdirciv2,'BackgroundColor',[1 1 0]) 431 set(handles. list_pair_civ2,'Enable','On')432 set(handles. list_pair_civ2,'Enable','On')431 set(handles.ListPairCiv2,'Enable','On') 432 set(handles.ListPairCiv2,'Enable','On') 433 433 elseif isequal(ind_opening,6) 434 434 enable_pair1(handles,'off') 435 set(handles. PATCH2,'Value',1)435 set(handles.CheckPatch2,'Value',1) 436 436 enable_patch2(handles) 437 437 set(handles.frame_subdirciv2,'BackgroundColor',[1 1 0]) 438 set(handles. list_pair_civ2,'Enable','On')438 set(handles.ListPairCiv2,'Enable','On') 439 439 end 440 440 set(handles.RootName,'UserData',browse);% store information from browser … … 492 492 function display_file_name(hObject, eventdata, handles,filebase) 493 493 %------------------------------------------------------------------------ 494 set(handles. compare,'Visible','on')494 set(handles.ListCompareMode,'Visible','on') 495 495 ext_ima='';%default 496 496 nom_type_ima=[];%default … … 640 640 nom_type_ima='*'; 641 641 ext_ima=ext_imadoc; 642 set(handles. CivMode,'Value',1);643 set(handles. CivMode,'String',{'series(Di)'})642 set(handles.ListPairMode,'Value',1); 643 set(handles.ListPairMode,'String',{'series(Di)'}) 644 644 dt=0.04;%default 645 645 if exist([filebase ext_imadoc],'file')==2 … … 776 776 test_ima_i=numel(nom_type_ima)>1 && isempty(regexp(nom_type_ima(2:end),'\D','once'));%images with single indexing 777 777 if test_ima_i || isequal(nom_type_nc,'_i1-i2')||~(exist('nbfield2','var')&&(nbfield2~=1)) 778 set(handles. CivMode,'Value',1)779 set(handles. CivMode,'String',{'series(Di)'})778 set(handles.ListPairMode,'Value',1) 779 set(handles.ListPairMode,'String',{'series(Di)'}) 780 780 elseif (nbfield==1)% simple series in j 781 set(handles. CivMode,'Value',1)782 set(handles. CivMode,'String',{'series(Dj)'})783 else 784 set(handles. CivMode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice781 set(handles.ListPairMode,'Value',1) 782 set(handles.ListPairMode,'String',{'series(Dj)'}) 783 else 784 set(handles.ListPairMode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice 785 785 if nbfield2 <= 10 786 set(handles. CivMode,'Value',1)% advice 'pair j1-j2' for small burst786 set(handles.ListPairMode,'Value',1)% advice 'pair j1-j2' for small burst 787 787 end 788 788 end … … 830 830 end 831 831 end 832 set(handles. list_subdir_civ1,'Value',1)833 set(handles. list_subdir_civ2,'Value',1)834 set(handles. list_subdir_civ1,'String',[listdir;'new...'])835 set(handles. list_subdir_civ2,'String',[listdir;'new...'])832 set(handles.ListSubdirCiv1,'Value',1) 833 set(handles.ListSubDirCiv2,'Value',1) 834 set(handles.ListSubdirCiv1,'String',[listdir;'new...']) 835 set(handles.ListSubDirCiv2,'String',[listdir;'new...']) 836 836 if isempty(listdir) 837 837 dirname=listdir{1}; … … 845 845 % subdir_civ2=get(handles.subdir_civ2,'String'); 846 846 847 CivMode_Callback(hObject, eventdata, handles)848 849 %------------------------------------------------------------------------ 850 % --- Executes on button press in CivMode.851 function CivMode_Callback(hObject, eventdata, handles)847 ListPairMode_Callback(hObject, eventdata, handles) 848 849 %------------------------------------------------------------------------ 850 % --- Executes on button press in ListPairMode. 851 function ListPairMode_Callback(hObject, eventdata, handles) 852 852 %------------------------------------------------------------------------ 853 853 browse=get(handles.RootName,'UserData'); 854 compare_list=get(handles. compare,'String');855 val=get(handles. compare,'Value');854 compare_list=get(handles.ListCompareMode,'String'); 855 val=get(handles.ListCompareMode,'Value'); 856 856 compare=compare_list{val}; 857 857 if strcmp(compare,'displacement') 858 858 mode='displacement'; 859 859 else 860 mode_list=get(handles. CivMode,'String');860 mode_list=get(handles.ListPairMode,'String'); 861 861 if ischar(mode_list) 862 862 mode_list={mode_list}; 863 863 end 864 mode_value=get(handles. CivMode,'Value');864 mode_value=get(handles.ListPairMode,'Value'); 865 865 mode=mode_list{mode_value}; 866 866 end … … 1000 1000 end 1001 1001 end 1002 set(handles. list_pair_civ1,'UserData',displ_num);1002 set(handles.ListPairCiv1,'UserData',displ_num); 1003 1003 find_netcpair_civ1(hObject, eventdata, handles) 1004 1004 find_netcpair_civ2(hObject, eventdata, handles) 1005 1005 1006 1006 %------------------------------------------------------------------------ 1007 % determine the menu for c iv1 pairs depending on existing netcdf file at the middle of1007 % determine the menu for checkciv1 pairs depending on existing netcdf file at the middle of 1008 1008 % the field series set by first_i, incr, last_i 1009 1009 function find_netcpair_civ1(hObject, eventdata, handles) … … 1014 1014 [filepath,Nme,ext_dir]=fileparts(filebase); 1015 1015 browse=get(handles.RootName,'UserData'); 1016 compare_list=get(handles. compare,'String');1017 val=get(handles. compare,'Value');1016 compare_list=get(handles.ListCompareMode,'String'); 1017 val=get(handles.ListCompareMode,'Value'); 1018 1018 compare=compare_list{val}; 1019 1019 if strcmp(compare,'displacement') 1020 1020 mode='displacement'; 1021 1021 else 1022 mode_list=get(handles. CivMode,'String');1023 mode_value=get(handles. CivMode,'Value');1022 mode_list=get(handles.ListPairMode,'String'); 1023 mode_value=get(handles.ListPairMode,'Value'); 1024 1024 if isempty(mode_list) 1025 1025 return … … 1058 1058 end 1059 1059 dt_unit=1000;%default 1060 displ_num=get(handles. list_pair_civ1,'UserData');1060 displ_num=get(handles.ListPairCiv1,'UserData'); 1061 1061 1062 1062 %eliminate the first pairs inconsistent with the position … … 1073 1073 nbpair=min(200,nbpair);%limit the number of displayed pairs to 200 1074 1074 1075 %look for existing processed pairs involving the field at the middle of the series if c iv1 will not1075 %look for existing processed pairs involving the field at the middle of the series if checkciv1 will not 1076 1076 % be performed, while the result is needed for next steps. 1077 1077 displ_pair={''}; 1078 1078 select=ones(size(1:nbpair));%flag for displayed pairs =1 for display 1079 1079 testpair=0; 1080 % case with no c iv1 operation, netcdf files need to exist for reading1081 if get(handles.C IV1,'Value')==0 %1080 % case with no checkciv1 operation, netcdf files need to exist for reading 1081 if get(handles.CheckCiv1,'Value')==0 % 1082 1082 if ~exist(fullfile(filepath,subdir_civ1,ext_dir),'dir') 1083 1083 msgbox_uvmat('ERROR',['no civ1 file available: subdirectory ' subdir_civ1 ' does not exist']); 1084 set(handles. list_pair_civ1,'String',{});1084 set(handles.ListPairCiv1,'String',{}); 1085 1085 return 1086 1086 end … … 1106 1106 msgbox_uvmat('ERROR',['no civ1 file available for the selected reference index i=' num2str(ref_i) ' and subdirectory ' subdir_civ1]); 1107 1107 end 1108 set(handles. list_pair_civ1,'String',{''});1108 set(handles.ListPairCiv1,'String',{''}); 1109 1109 %COMPLETER CAS STEREO 1110 1110 return … … 1157 1157 displ_pair={'Di=Dj=0'}; 1158 1158 end 1159 set(handles. list_pair_civ1,'String',displ_pair');1159 set(handles.ListPairCiv1,'String',displ_pair'); 1160 1160 ichoice=find(select,1); 1161 1161 if (isempty(ichoice) || ichoice < 1); ichoice=1; end; 1162 initial=get(handles. list_pair_civ1,'Value');%initial choice of pair1162 initial=get(handles.ListPairCiv1,'Value');%initial choice of pair 1163 1163 if initial>nbpair 1164 set(handles. list_pair_civ1,'Value',ichoice);% first valid pair proposed by default in the menu1164 set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu 1165 1165 end 1166 1166 if numel(select)>=initial && ~isequal(select(initial),1) 1167 set(handles. list_pair_civ1,'Value',ichoice);% first valid pair proposed by default in the menu1168 end 1169 1170 %set(handles. list_pair_civ2,'String',displ_pair');1171 initial=get(handles. list_pair_civ2,'Value');1167 set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu 1168 end 1169 1170 %set(handles.ListPairCiv2,'String',displ_pair'); 1171 initial=get(handles.ListPairCiv2,'Value'); 1172 1172 if initial>length(displ_pair')%|~isequal(select(initial),1) 1173 1173 if ichoice <= length(displ_pair') 1174 set(handles. list_pair_civ2,'Value',ichoice);% same pair proposed by default for civ21174 set(handles.ListPairCiv2,'Value',ichoice);% same pair proposed by default for civ2 1175 1175 else 1176 set(handles. list_pair_civ2,'Value',1);% same pair proposed by default for civ21177 end 1178 end 1179 set(handles. list_pair_civ2,'String',displ_pair');1176 set(handles.ListPairCiv2,'Value',1);% same pair proposed by default for civ2 1177 end 1178 end 1179 set(handles.ListPairCiv2,'String',displ_pair'); 1180 1180 set(gcf,'Pointer','arrow') 1181 1181 1182 1182 %------------------------------------------------------------------------ 1183 % determine the menu for c iv2 pairs depending on the existing netcdf file at the1183 % determine the menu for checkciv2 pairs depending on the existing netcdf file at the 1184 1184 %middle of the series set by first_i, incr, last_i 1185 1185 function find_netcpair_civ2(hObject, eventdata, handles) … … 1190 1190 [filepath,Nme,ext_dir]=fileparts(filebase); 1191 1191 browse=get(handles.RootName,'UserData'); 1192 compare_list=get(handles. compare,'String');1193 val=get(handles. compare,'Value');1192 compare_list=get(handles.ListCompareMode,'String'); 1193 val=get(handles.ListCompareMode,'Value'); 1194 1194 compare=compare_list{val}; 1195 1195 if strcmp(compare,'displacement') 1196 1196 mode='displacement'; 1197 1197 else 1198 mode_list=get(handles. CivMode,'String');1198 mode_list=get(handles.ListPairMode,'String'); 1199 1199 if isempty(mode_list) 1200 1200 msgbox_uvmat('ERROR','please enter an input image or netcdf file') 1201 1201 return 1202 1202 end 1203 mode_value=get(handles. CivMode,'Value');1203 mode_value=get(handles.ListPairMode,'Value'); 1204 1204 mode=mode_list{mode_value}; 1205 1205 end … … 1238 1238 % num1=first_i:incr:last_i; 1239 1239 % if isempty(num1) 1240 % set(handles. list_pair_civ2,'Value',1);1241 % set(handles. list_pair_civ2,'String',{''});1240 % set(handles.ListPairCiv2,'Value',1); 1241 % set(handles.ListPairCiv2,'String',{''}); 1242 1242 % return 1243 1243 % end … … 1254 1254 %dt_unit=str2num(get(handles.dt,'String'));% used when there is no image documentation file 1255 1255 %dt_unit=1000; 1256 displ_num=get(handles. list_pair_civ1,'UserData');1256 displ_num=get(handles.ListPairCiv1,'UserData'); 1257 1257 1258 1258 … … 1270 1270 nbpair=min(200,nbpair);%limit the number of displayed pairs to 200 1271 1271 1272 %look for existing processed pairs involving the field at the middle of the series if c iv1 will not1272 %look for existing processed pairs involving the field at the middle of the series if checkciv1 will not 1273 1273 % be performed, while the result is needed for next steps. 1274 1274 displ_pair={''}; %default 1275 1275 select=ones(size(1:nbpair));%default =1 for numbers of displayed pairs 1276 if get(handles.C IV2,'Value')==0 & get(handles.CIV1,'Value')==0 & get(handles.FIX1,'Value')==0 & get(handles.PATCH1,'Value')==0%&...1276 if get(handles.CheckCiv2,'Value')==0 & get(handles.CheckCiv1,'Value')==0 & get(handles.CheckFix1,'Value')==0 & get(handles.CheckPatch1,'Value')==0%&... 1277 1277 if ~exist(fullfile(filepath,subdir_civ2,ext_dir),'dir') 1278 1278 errordlg(['no civ2 file available: subdirectory ' subdir_civ2 ' does not exist']) 1279 set(handles. list_pair_civ2,'Value',1);1280 set(handles. list_pair_civ2,'String',{''});1279 set(handles.ListPairCiv2,'Value',1); 1280 set(handles.ListPairCiv2,'String',{''}); 1281 1281 return 1282 1282 end … … 1300 1300 errordlg(['no civ2 file available for the selected reference index i=' num2str(ref_i) ' and subdirectory ' subdir_civ2]) 1301 1301 end 1302 set(handles. list_pair_civ2,'Value',1);1303 set(handles. list_pair_civ2,'String',{''});1302 set(handles.ListPairCiv2,'Value',1); 1303 set(handles.ListPairCiv2,'String',{''}); 1304 1304 return 1305 1305 end … … 1341 1341 displ_pair={'Di=Dj=0'}; 1342 1342 end 1343 val=get(handles. list_pair_civ2,'Value');1343 val=get(handles.ListPairCiv2,'Value'); 1344 1344 ichoice=find(select,1); 1345 1345 if (isempty(ichoice) || ichoice < 1); ichoice=1; end; 1346 if get(handles.C IV2,'Value')==0 && get(handles.CIV1,'Value')==0 && get(handles.FIX1,'Value')==0 && get(handles.PATCH1,'Value')==01346 if get(handles.CheckCiv2,'Value')==0 && get(handles.CheckCiv1,'Value')==0 && get(handles.CheckFix1,'Value')==0 && get(handles.CheckPatch1,'Value')==0 1347 1347 val=ichoice;% first valid pair proposed by default in the menu 1348 1348 end 1349 1349 if val>length(displ_pair') 1350 set(handles. list_pair_civ2,'Value',1);% first valid pair proposed by default in the menu1351 else 1352 set(handles. list_pair_civ2,'Value',val);1353 end 1354 set(handles. list_pair_civ2,'String',displ_pair');1350 set(handles.ListPairCiv2,'Value',1);% first valid pair proposed by default in the menu 1351 else 1352 set(handles.ListPairCiv2,'Value',val); 1353 end 1354 set(handles.ListPairCiv2,'String',displ_pair'); 1355 1355 set(gcf,'Pointer','arrow') 1356 1356 … … 1359 1359 1360 1360 %------------------------------------------------------------------------ 1361 % --- Executes on selection change in list_pair_civ1.1362 function list_pair_civ1_Callback(hObject, eventdata, handles)1363 %------------------------------------------------------------------------ 1364 %reproduce by default the chosen pair in the c iv2 menu1365 list_pair=get(handles. list_pair_civ1,'String');%get the menu of image pairs1366 index_pair=get(handles. list_pair_civ1,'Value');1367 displ_num=get(handles. list_pair_civ1,'UserData');1361 % --- Executes on selection change in ListPairCiv1. 1362 function ListPairCiv1_Callback(hObject, eventdata, handles) 1363 %------------------------------------------------------------------------ 1364 %reproduce by default the chosen pair in the checkciv2 menu 1365 list_pair=get(handles.ListPairCiv1,'String');%get the menu of image pairs 1366 index_pair=get(handles.ListPairCiv1,'Value'); 1367 displ_num=get(handles.ListPairCiv1,'UserData'); 1368 1368 % num_a=displ_num(1,index_pair); 1369 1369 % num_b=displ_num(2,index_pair); 1370 list_pair2=get(handles. list_pair_civ2,'String');%get the menu of image pairs1370 list_pair2=get(handles.ListPairCiv2,'String');%get the menu of image pairs 1371 1371 if index_pair<=length(list_pair2) 1372 set(handles. list_pair_civ2,'Value',index_pair);1372 set(handles.ListPairCiv2,'Value',index_pair); 1373 1373 end 1374 1374 1375 1375 %update first_i and last_i according to the chosen image pairs 1376 mode_list=get(handles. CivMode,'String');1377 mode_value=get(handles. CivMode,'Value');1376 mode_list=get(handles.ListPairMode,'String'); 1377 mode_value=get(handles.ListPairMode,'Value'); 1378 1378 mode=mode_list{mode_value}; 1379 1379 if isequal(mode,'series(Di)') … … 1406 1406 1407 1407 %------------------------------------------------------------------------ 1408 % --- Executes on selection change in list_pair_civ2.1409 function list_pair_civ2_Callback(hObject, eventdata, handles)1410 %------------------------------------------------------------------------ 1411 index_pair=get(handles. list_pair_civ2,'Value');%get the selected position index in the menu1408 % --- Executes on selection change in ListPairCiv2. 1409 function ListPairCiv2_Callback(hObject, eventdata, handles) 1410 %------------------------------------------------------------------------ 1411 index_pair=get(handles.ListPairCiv2,'Value');%get the selected position index in the menu 1412 1412 1413 1413 %update first_i and last_i according to the chosen image pairs 1414 mode_list=get(handles. CivMode,'String');1415 mode_value=get(handles. CivMode,'Value');1414 mode_list=get(handles.ListPairMode,'String'); 1415 mode_value=get(handles.ListPairMode,'Value'); 1416 1416 mode=mode_list{mode_value}; 1417 1417 if isequal(mode,'series(Di)') … … 1458 1458 display(errormsg) 1459 1459 msgbox_uvmat('ERROR',errormsg) 1460 elseif isfield(handles,'status') %&& ~isequal(get(handles. CivMode,'Value'),3)1460 elseif isfield(handles,'status') %&& ~isequal(get(handles.ListPairMode,'Value'),3) 1461 1461 set(handles.status,'Value',1);%suppress status display 1462 1462 status_Callback(hObject, eventdata, handles) … … 1489 1489 errormsg='';%default 1490 1490 1491 1491 %%read the civ GUI 1492 Param=read_GUI(handles.civ) 1493 Param.Civ1 1494 Param.Fix1 1495 Param.Patch1 1492 1496 %% check the selected list of operations: 1493 1497 operations={'CIV1','FIX1','PATCH1','CIV2','FIX2','PATCH2'}; 1494 box_test (1)=get(handles.CIV1,'Value');1495 box_test(2)=get(handles.FIX1,'Value');1496 box_test(3)=get(handles.PATCH1,'Value');1497 box_test(4)=get(handles.CIV2,'Value');1498 box_test(5)=get(handles.FIX2,'Value');1499 box_test(6)=get(handles.PATCH2,'Value');1498 box_test=[Param.CheckCiv1 Param.CheckFix1 Param.CheckPatch1 Param.CheckCiv2 Param.CheckFix2 Param.CheckPatch2]; 1499 % box_test(2)=get(handles.CheckFix1,'Value'); 1500 % box_test(3)=get(handles.CheckPatch1,'Value'); 1501 % box_test(4)=get(handles.CheckCiv2,'Value'); 1502 % box_test(5)=get(handles.CheckFix2,'Value'); 1503 % box_test(6)=get(handles.CheckPatch2,'Value'); 1500 1504 index_first=find(box_test==1,1); 1501 1505 if isempty(index_first) … … 1513 1517 %% check mask if selecetd 1514 1518 %could be included in get_mask callback ? 1515 if isequal(get(handles. check_Mask,'Value'),1)1519 if isequal(get(handles.CheckMask,'Value'),1) 1516 1520 maskname=get(handles.txt_MaskName,'String'); 1517 1521 if ~exist(maskname,'file') … … 1519 1523 end 1520 1524 end 1521 if isequal(get(handles. get_mask_fix1,'Value'),1)1522 maskname=get(handles. mask_fix1,'String');1525 if isequal(get(handles.CheckMask,'Value'),1) 1526 maskname=get(handles.txt_MaskName,'String'); 1523 1527 if ~exist(maskname,'file') 1524 1528 get_mask_fix1_Callback(hObject, eventdata, handles); 1525 1529 end 1526 1530 end 1527 if isequal(get(handles. check_Mask,'Value'),1)1531 if isequal(get(handles.CheckMask,'Value'),1) 1528 1532 maskname=get(handles.txt_Mask,'String'); 1529 1533 if ~exist(maskname,'file') … … 1531 1535 end 1532 1536 end 1533 if isequal(get(handles. get_mask_fix2,'Value'),1)1537 if isequal(get(handles.CheckMask,'Value'),1) 1534 1538 maskname=get(handles.mask_fix2,'String'); 1535 1539 if ~exist(maskname,'file') … … 1656 1660 display('files OK, processing...') 1657 1661 1658 %% get c iv1 parameters1659 if box_test(1)1662 %% get checkciv1 parameters 1663 if Param.CheckCiv1 1660 1664 param.civ1=read_param_civ1(handles,filecell); 1661 1665 end 1662 1666 1663 %% get fix1 parameters1664 if box_test(2)1667 %% get checkfix1 parameters 1668 if Param.CheckFix1 1665 1669 param.fix1=read_param_fix1(handles,filecell); 1666 1670 end 1667 1671 1668 %% get patch1 parameters1669 if box_test(3)1670 param.Patch1=read_panel(handles. panel_Patch1);1671 %param. patch1=read_param_patch1(handles)1672 end 1673 1674 %% get c iv2 parameters:1675 if box_test(4)1672 %% get checkpatch1 parameters 1673 if Param.CheckPatch1 1674 param.Patch1=read_panel(handles.Patch1); 1675 %param.checkpatch1=read_param_patch1(handles) 1676 end 1677 1678 %% get checkciv2 parameters: 1679 if Param.CheckCiv2 1676 1680 param.civ2=read_param_civ2(handles,cell2mat(filecell.ima1.civ2(1,1))); 1677 1681 end 1678 1682 1679 %% get fix2 parameters1680 if box_test(5)1683 %% get checkfix2 parameters 1684 if Param.CheckFix2 1681 1685 flagindex2(1)=get(handles.vec_Fmin2_2, 'Value'); 1682 1686 flagindex2(2)=get(handles.vec_F3_2, 'Value'); … … 1684 1688 thresh_vec2C=str2double(get(handles.thresh_vec2C,'String'));%threshold on image correlation vec_C 1685 1689 thresh_vel2=str2double(get(handles.thresh_vel2,'String'));%threshold on velocity modulus 1686 test_mask=get(handles. get_mask_fix2,'Value');1690 test_mask=get(handles.CheckMask,'Value'); 1687 1691 nbslice_mask=get(handles.mask_fix2,'UserData'); % get the number of slices (= number of masks) 1688 1692 %%%%%%%%%%%%%COMPLETER LE PROGRAMME FIX AVEC REF FILE ET OPTION inf_sup=2 … … 1693 1697 end 1694 1698 1695 %% get patch2 parameters1696 if box_test(6)==11697 param.Patch2=read_panel(handles. panel_Patch1);1699 %% get checkpatch2 parameters 1700 if Param.CheckPatch2==1 1701 param.Patch2=read_panel(handles.Patch1); 1698 1702 end 1699 1703 … … 1729 1733 1730 1734 % define output file name 1731 if box_test(4)==1 || box_test(5)==1 || box_test(6)==11735 if Param.CheckCiv2==1 || Param.CheckFix2==1 || Param.CheckPatch2==1 1732 1736 OutputFile=filecell.nc.civ2{ifile,j}; 1733 1737 else … … 1737 1741 1738 1742 1739 %C IV11740 if box_test(1)1743 %CheckCiv1 1744 if Param.CheckCiv1 1741 1745 % read image-dependent parameters 1742 1746 param.civ1.filename_ima_a=filecell.ima1.civ1{ifile,j}; … … 1748 1752 1749 1753 % read mask parameters 1750 dummy=get(handles. check_Mask,'Value');1754 dummy=get(handles.CheckMask,'Value'); 1751 1755 if dummy{1} 1752 1756 maskdispl=get(handles.txt_MaskName,'String'); … … 1771 1775 end 1772 1776 1773 % read grid parameters 1774 dummy=get(handles. check_Grid,'Value');1777 % read grid parameters= 1778 dummy=get(handles.CheckGrid,'Value'); 1775 1779 if dummy{1} 1776 1780 param.civ1.gridflag='y'; … … 1814 1818 end 1815 1819 1816 % FIX11817 if box_test(2)1820 % CheckFix1 1821 if Param.CheckFix1 1818 1822 switch CivMode 1819 1823 case 'CivX' … … 1849 1853 end 1850 1854 1851 % PATCH11852 if box_test(3)==11855 %CheckPatch1 1856 if Param.CheckPatch1==1 1853 1857 switch CivMode 1854 1858 case 'CivX' … … 1897 1901 end 1898 1902 end 1899 if box_test(4)==11903 if Param.CheckCiv2==1 1900 1904 param.civ2.filename_ima_a=filecell.ima1.civ2{ifile,j}; 1901 1905 param.civ2.filename_ima_b=filecell.ima2.civ2{ifile,j}; … … 1906 1910 param.civ2.filename_nc1=filecell.nc.civ1{ifile,j}; 1907 1911 param.civ2.filename_nc1(end-2:end)=[]; % remove '.nc' 1908 test_mask=get(handles. check_Mask,'Value');1912 test_mask=get(handles.CheckMask,'Value'); 1909 1913 if test_mask==0 1910 1914 param.civ2.maskname='noFile use default'; … … 1967 1971 end 1968 1972 1969 % FIX21970 if box_test(5)==11971 test_mask=get(handles. get_mask_fix2,'Value');1973 % CheckFix2 1974 if Param.CheckFix2==1 1975 test_mask=get(handles.CheckMask,'Value'); 1972 1976 if test_mask==0 1973 1977 maskname=''; %no mask used … … 2012 2016 end 2013 2017 2014 % PATCH22015 if box_test(6)==12018 %CheckPatch2 2019 if Param.CheckPatch2==1 2016 2020 switch CivMode 2017 2021 case 'CivX' … … 2110 2114 case 'Matlab' 2111 2115 drawnow 2112 if box_test(1)==12116 if Param.CheckCiv1==1 2113 2117 Param.Civ1=param.civ1; 2114 2118 end 2115 if box_test(2)==12119 if Param.CheckFix1==1 2116 2120 fix1.WarnFlags=[]; 2117 if get(handles. vec_Fmin2,'Value')2121 if get(handles.CheckFmin2,'Value') 2118 2122 fix1.WarnFlags=[fix1.WarnFlags -2]; 2119 2123 end 2120 if get(handles. vec_F3,'Value')2124 if get(handles.CheckF3,'Value') 2121 2125 fix1.WarnFlags=[fix1.WarnFlags 3]; 2122 2126 end … … 2127 2131 fix1.LowerBoundVel=thresh_vel1; 2128 2132 end 2129 if get(handles. get_mask_fix1,'Value')2133 if get(handles.CheckMask,'Value') 2130 2134 fix1.MaskName=maskname; 2131 2135 end 2132 2136 Param.Fix1=fix1; 2133 2137 end 2134 if box_test(3)==12138 if Param.CheckPatch1==1 2135 2139 if strcmp(compare,'stereo PIV') 2136 2140 filebase_A=filecell.filebase; … … 2145 2149 end 2146 2150 end 2147 if box_test(4)==12151 if Param.CheckCiv2==1 2148 2152 Param.Civ2=param.civ2; 2149 2153 end 2150 if box_test(5)==12154 if Param.CheckFix2==1 2151 2155 fix2.WarnFlags=[]; 2152 2156 if get(handles.vec_Fmin2_2,'Value') … … 2165 2169 fix2.LowerBoundVel=thresh_vel2; 2166 2170 end 2167 if get(handles. get_mask_fix2,'Value')2171 if get(handles.CheckMask,'Value') 2168 2172 fix2.MaskName=maskname; 2169 2173 end 2170 2174 Param.Fix2=fix2; 2171 2175 end 2172 if box_test(6)==12176 if Param.CheckPatch2==1 2173 2177 if strcmp(compare,'stereo PIV') 2174 2178 filebase_A=filecell.filebase; … … 2379 2383 % --- determine the list of filenames and indices needed for launch_job 2380 2384 function [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2,compare]=... 2381 set_civ_filenames(handles,ref_i,ref_j, box_test)2385 set_civ_filenames(handles,ref_i,ref_j,checkbox) 2382 2386 %------------------------------------------------------------------------ 2383 2387 filecell=[];%default … … 2395 2399 2396 2400 browse=get(handles.RootName,'UserData'); 2397 compare_list=get(handles. compare,'String');2398 val=get(handles. compare,'Value');2401 compare_list=get(handles.ListCompareMode,'String'); 2402 val=get(handles.ListCompareMode,'Value'); 2399 2403 compare=compare_list{val}; 2400 2404 if strcmp(compare,'displacement') 2401 2405 mode='displacement'; 2402 2406 else 2403 mode_list=get(handles. CivMode,'String');2404 mode_value=get(handles. CivMode,'Value');2407 mode_list=get(handles.ListPairMode,'String'); 2408 mode_value=get(handles.ListPairMode,'Value'); 2405 2409 mode=mode_list{mode_value}; 2406 2410 end … … 2415 2419 [num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2]=... 2416 2420 find_pair_indices(handles,ref_i,ref_j,mode); 2417 %determine the new filebase for 'displacement' CivMode (comparison of two series)2421 %determine the new filebase for 'displacement' ListPairMode (comparison of two series) 2418 2422 filebase_B=filebase;% root name of the second field series for stereo 2419 2423 if strcmp(compare,'displacement') || strcmp(compare,'stereo PIV') … … 2452 2456 nbfield=length(num1_civ1); 2453 2457 nbslice=length(num_a_civ1); 2454 if box_test(2)==1% fix1 performed2458 if checkbox(2)==1% fix1 performed 2455 2459 ref=get(handles.ref_fix1,'UserData');%read data on the ref file stored by get_ref_fix1_Callback 2456 2460 if ~isempty(ref) … … 2505 2509 end 2506 2510 2507 %determine reference files for fix2:2508 if box_test(5)==1% fix2 performed2511 %determine reference files for checkfix2: 2512 if checkbox(5)==1% fix2 performed 2509 2513 ref=get(handles.ref_fix2,'UserData'); 2510 2514 if ~isempty(ref) … … 2577 2581 2578 2582 %check the existence of the netcdf and image files involved 2579 % %%%%%%%%%%%% case C IV1 activated %%%%%%%%%%%%%2580 if box_test(1)==1;2583 % %%%%%%%%%%%% case CheckCiv1 activated %%%%%%%%%%%%% 2584 if checkbox(1)==1; 2581 2585 detect=1; 2582 2586 vers=0; … … 2723 2727 end 2724 2728 2725 %%%%%%%%%%%%% fix1 or patch1 activated but nociv1 %%%%%%%%%%%%%2726 elseif ( box_test(2)==1 || box_test(3)==1);2729 %%%%%%%%%%%%% checkfix1 or checkpatch1 activated but no checkciv1 %%%%%%%%%%%%% 2730 elseif (checkbox(2)==1 || checkbox(3)==1); 2727 2731 for ifile=1:nbfield 2728 2732 for j=1:nbslice … … 2757 2761 end 2758 2762 2759 %%%%%%%%%%%%% if c iv2 performed with pairs different thanciv1 %%%%%%%%%%%%%2763 %%%%%%%%%%%%% if checkciv2 performed with pairs different than checkciv1 %%%%%%%%%%%%% 2760 2764 testdiff=0; 2761 if ( box_test(4)==1)&&...2762 ((get(handles. list_pair_civ1,'Value')~=get(handles.list_pair_civ2,'Value'))||~strcmp(subdir_civ2,subdir_civ1))2765 if (checkbox(4)==1)&&... 2766 ((get(handles.ListPairCiv1,'Value')~=get(handles.ListPairCiv2,'Value'))||~strcmp(subdir_civ2,subdir_civ1)) 2763 2767 testdiff=1; 2764 2768 detect=1; … … 2839 2843 %cd(currentdir);%come back to the current working directory 2840 2844 2841 %%%%%%%%%%%%% if c iv2 results are obtained or used %%%%%%%%%%%%%2842 if box_test(4)==1 || box_test(5)==1 || box_test(6)==1 %civ22843 %check source netcdf file of c iv1 estimates2844 if box_test(1)==0; %no civ1 performed2845 %%%%%%%%%%%%% if checkciv2 results are obtained or used %%%%%%%%%%%%% 2846 if checkbox(4)==1 || checkbox(5)==1 || checkbox(6)==1 %civ2 2847 %check source netcdf file of checkciv1 estimates 2848 if checkbox(1)==0; %no civ1 performed 2845 2849 for ifile=1:nbfield 2846 2850 for j=1:nbslice … … 2854 2858 end 2855 2859 if ~testdiff % civ2 or patch2 are written in the same file as civ1 2856 if box_test(4)==0 ; %check the existence of civ2 if it is not calculated2860 if checkbox(4)==0 ; %check the existence of civ2 if it is not calculated 2857 2861 Data=nc2struct(filename,'ListGlobalAttribute','CivStage','civ2'); 2858 2862 if ~isempty(Data.CivStage) && Data.CivStage<4 %test for civ files … … 2865 2869 return 2866 2870 end 2867 elseif box_test(3)==0; %check the existence of patch if it is not calculated2871 elseif checkbox(3)==0; %check the existence of patch if it is not calculated 2868 2872 Data=nc2struct(filename,'ListGlobalAttribute','CivStage','patch'); 2869 2873 if ~isempty(Data.CivStage) … … 2900 2904 2901 2905 detect=1; 2902 % while detect==1%creates a new subdir if the netcdf files already contain c iv2 data2906 % while detect==1%creates a new subdir if the netcdf files already contain checkciv2 data 2903 2907 for ifile=1:nbfield 2904 2908 for j=1:nbslice … … 2909 2913 end 2910 2914 end 2911 %get first image names for c iv22912 if box_test(1)==1 & isequal(num1_civ1,num1_civ2)& isequal(num_a_civ1,num_a_civ2)2915 %get first image names for checkciv2 2916 if checkbox(1)==1 && isequal(num1_civ1,num1_civ2) && isequal(num_a_civ1,num_a_civ2) 2913 2917 filecell.ima1.civ2=filecell.ima1.civ1; 2914 elseif box_test(4)==12918 elseif checkbox(4)==1 2915 2919 for ifile=1:nbfield 2916 2920 for j=1:nbslice … … 2928 2932 end 2929 2933 2930 %get second image names for c iv22931 if box_test(1)==1 & isequal(num2_civ1,num2_civ2)& isequal(num_b_civ1,num_b_civ2)2934 %get second image names for checkciv2 2935 if checkbox(1)==1 && isequal(num2_civ1,num2_civ2) && isequal(num_b_civ1,num_b_civ2) 2932 2936 filecell.ima2.civ2=filecell.ima2.civ1; 2933 elseif box_test(4)==12937 elseif checkbox(4)==1 2934 2938 for ifile=1:nbfield 2935 2939 for j=1:nbslice … … 2947 2951 end 2948 2952 end 2949 if ( box_test(5)==1 || box_test(6)==1 ) && box_test(4)==0% need to read an existing netcdf civ2 file2953 if (checkbox(5) || checkbox(6)) && ~checkbox(4) % need to read an existing netcdf civ2 file 2950 2954 if ~testdiff 2951 2955 filecell.nc.civ2=filecell.nc.civ1;% file already checked … … 2979 2983 %%%%%%%%%%%%% if stereo fields are calculated by PATCH %%%%%%%%%%%%% 2980 2984 if strcmp(compare,'stereo PIV') 2981 if box_test(3)==1&& isequal(get(handles.test_stereo1,'Value'),1)2985 if checkbox(3) && isequal(get(handles.test_stereo1,'Value'),1) 2982 2986 for ifile=1:nbfield 2983 2987 for j=1:nbslice … … 2988 2992 end 2989 2993 end 2990 if box_test(6)==1 && isequal(get(handles.check_Stereo,'Value'),1)2994 if checkbox(6) && isequal(get(handles.CheckStereo,'Value'),1) 2991 2995 for ifile=1:nbfield 2992 2996 for j=1:nbslice … … 3066 3070 % npy=npxy(1); 3067 3071 % npx=npxy(2); 3068 if box_test(1)==1%if civ1 is performed3072 if checkbox(1) %if civ1 is performed 3069 3073 h = waitbar(0,'copy images to the .png format for civ1');% display a wait bar 3070 3074 for ifile=1:nbfield … … 3087 3091 close(h) 3088 3092 end 3089 if box_test(4)==1%if civ2 is performed3093 if checkbox(4) %if civ2 is performed 3090 3094 h = waitbar(0,'copy images to the .png format for civ2');% display a wait bar 3091 3095 for ifile=1:nbfield … … 3116 3120 %------------------------------------------------------------------------ 3117 3121 3118 list_civ1=get(handles. list_pair_civ1,'String');3119 index_civ1=get(handles. list_pair_civ1,'Value');3122 list_civ1=get(handles.ListPairCiv1,'String'); 3123 index_civ1=get(handles.ListPairCiv1,'Value'); 3120 3124 str_civ1=list_civ1{index_civ1};%string defining the image pairs for civ1 3121 3125 if isempty(str_civ1)||isequal(str_civ1,'') … … 3123 3127 return 3124 3128 end 3125 list_civ2=get(handles. list_pair_civ2,'String');3126 index_civ2=get(handles. list_pair_civ2,'Value');3129 list_civ2=get(handles.ListPairCiv2,'String'); 3130 index_civ2=get(handles.ListPairCiv2,'Value'); 3127 3131 if index_civ2>length(list_civ2) 3128 3132 list_civ2=list_civ1; … … 3188 3192 end 3189 3193 elseif isequal(mode,'pair j1-j2') %case of bursts (png_old or png_2D) 3190 displ_num=get(handles. list_pair_civ1,'UserData');3194 displ_num=get(handles.ListPairCiv1,'UserData'); 3191 3195 num1_civ1=ref_i; 3192 3196 num2_civ1=ref_i; … … 3244 3248 3245 3249 %------------------------------------------------------------------------ 3246 % --- Executes on button press in C IV1.3247 function C IV1_Callback(hObject, eventdata, handles)3248 %------------------------------------------------------------------------ 3249 state=get(handles.C IV1,'Value');3250 % --- Executes on button press in CheckCiv1. 3251 function CheckCiv1_Callback(hObject, eventdata, handles) 3252 %------------------------------------------------------------------------ 3253 state=get(handles.CheckCiv1,'Value'); 3250 3254 enable_civ1(handles,state) 3251 3255 if state … … 3255 3259 3256 3260 %------------------------------------------------------------------------ 3257 % --- Executes on button press in FIX1.3258 function FIX1_Callback(hObject, eventdata, handles)3259 %------------------------------------------------------------------------ 3260 enable_fix1(handles,get(handles. FIX1,'Value'))3261 3262 %------------------------------------------------------------------------ 3263 % --- Executes on button press in PATCH1.3264 function PATCH1_Callback(hObject, eventdata, handles)3265 %------------------------------------------------------------------------ 3266 enable_patch1(handles,get(handles. PATCH1,'Value'))3267 3268 %------------------------------------------------------------------------ 3269 % --- Executes on button press in C IV2.3270 function C IV2_Callback(hObject, eventdata, handles)3271 %------------------------------------------------------------------------ 3272 state=get(handles.C IV2,'Value');3261 % --- Executes on button press in CheckFix1. 3262 function CheckFix1_Callback(hObject, eventdata, handles) 3263 %------------------------------------------------------------------------ 3264 enable_fix1(handles,get(handles.CheckFix1,'Value')) 3265 3266 %------------------------------------------------------------------------ 3267 % --- Executes on button press in CheckPatch1. 3268 function CheckPatch1_Callback(hObject, eventdata, handles) 3269 %------------------------------------------------------------------------ 3270 enable_patch1(handles,get(handles.CheckPatch1,'Value')) 3271 3272 %------------------------------------------------------------------------ 3273 % --- Executes on button press in CheckCiv2. 3274 function CheckCiv2_Callback(hObject, eventdata, handles) 3275 %------------------------------------------------------------------------ 3276 state=get(handles.CheckCiv2,'Value'); 3273 3277 enable_civ2(handles,state) 3274 3278 if state … … 3278 3282 3279 3283 %------------------------------------------------------------------------ 3280 % --- Executes on button press in FIX2.3281 function FIX2_Callback(hObject, eventdata, handles)3282 %------------------------------------------------------------------------ 3283 state=get(handles. FIX2,'Value');3284 % --- Executes on button press in CheckFix2. 3285 function CheckFix2_Callback(hObject, eventdata, handles) 3286 %------------------------------------------------------------------------ 3287 state=get(handles.CheckFix2,'Value'); 3284 3288 enable_fix2(handles,state) 3285 3289 if state … … 3288 3292 3289 3293 %------------------------------------------------------------------------ 3290 % --- Executes on button press in PATCH2.3291 function PATCH2_Callback(hObject, eventdata, handles)3292 %------------------------------------------------------------------------ 3293 state=get(handles. PATCH2,'Value');3294 % --- Executes on button press in CheckPatch2. 3295 function CheckPatch2_Callback(hObject, eventdata, handles) 3296 %------------------------------------------------------------------------ 3297 state=get(handles.CheckPatch2,'Value'); 3294 3298 enable_patch2(handles,state) 3295 3299 if state … … 3316 3320 3317 3321 %------------------------------------------------------------------------ 3318 % --- Executes on button press in SearchRange: determine the search range isx,isy3322 % --- Executes on button press in SearchRange: determine the search range num_Sx,num_Sy 3319 3323 function SearchRange_Callback(hObject, eventdata, handles) 3320 3324 %------------------------------------------------------------------------ … … 3338 3342 3339 3343 %------------------------------------------------------------------------ 3340 % --- determine the search range isx,isy and shift3344 % --- determine the search range num_Sx,num_Sy and shift 3341 3345 function get_search_range(hObject, eventdata, handles) 3342 3346 umin=str2double(get(handles.umin,'String')); … … 3360 3364 end 3361 3365 if ~(isnan(umin)||isnan(umax)||isnan(vmin)||isnan(vmax)) 3362 list_pair=get(handles. list_pair_civ1,'String');%get the menu of image pairs3363 index=get(handles. list_pair_civ1,'Value');3364 displ_num=get(handles. list_pair_civ1,'UserData');3366 list_pair=get(handles.ListPairCiv1,'String');%get the menu of image pairs 3367 index=get(handles.ListPairCiv1,'Value'); 3368 displ_num=get(handles.ListPairCiv1,'UserData'); 3365 3369 time=get(handles.ImaDoc,'UserData'); %get the set of times 3366 3370 pxcm_xy=get(handles.SearchRange,'UserData'); 3367 3371 pxcmx=pxcm_xy(1); 3368 3372 pxcmy=pxcm_xy(2); 3369 mode_list=get(handles. CivMode,'String');3370 mode_value=get(handles. CivMode,'Value');3373 mode_list=get(handles.ListPairMode,'String'); 3374 mode_value=get(handles.ListPairMode,'Value'); 3371 3375 mode=mode_list{mode_value}; 3372 3376 if isequal (mode, 'series(Di)' ) … … 3390 3394 end 3391 3395 dt=time(num2,num_b)-time(num1,num_a); 3392 ibx=str2double(get(handles. ibx,'String'));3393 iby=str2double(get(handles. iby,'String'));3396 ibx=str2double(get(handles.num_Bx,'String')); 3397 iby=str2double(get(handles.num_By,'String')); 3394 3398 umin=dt*pxcmx*umin; 3395 3399 umax=dt*pxcmx*umax; … … 3402 3406 isy=(vmax+2-shifty)*2+iby; 3403 3407 isy=2*ceil(isy/2)+1; 3404 set(handles. shiftx,'String',num2str(shiftx));3405 set(handles. shifty,'String',num2str(shifty));3406 set(handles. isx,'String',num2str(isx));3407 set(handles. isy,'String',num2str(isy));3408 end 3409 3410 %------------------------------------------------------------------------ 3411 % --- Executes on carriage return on the subdir c iv1 edit window3408 set(handles.num_Shiftx,'String',num2str(shiftx)); 3409 set(handles.num_Shifty,'String',num2str(shifty)); 3410 set(handles.num_Sx,'String',num2str(isx)); 3411 set(handles.num_Sy,'String',num2str(isy)); 3412 end 3413 3414 %------------------------------------------------------------------------ 3415 % --- Executes on carriage return on the subdir checkciv1 edit window 3412 3416 function subdir_civ1_Callback(hObject, eventdata, handles) 3413 3417 %------------------------------------------------------------------------ 3414 3418 subdir=get(handles.subdir_civ1,'String'); 3415 3419 set(handles.subdir_civ2,'String',subdir);% set civ2 directory the same as civ1 by default 3416 menu_str=get(handles. list_subdir_civ1,'String');% read the list of subdirectories for update3420 menu_str=get(handles.ListSubdirCiv1,'String');% read the list of subdirectories for update 3417 3421 ichoice=find(strcmp(subdir,menu_str),1); 3418 3422 if isempty(ichoice) … … 3421 3425 ilist=ichoice; 3422 3426 end 3423 set(handles. list_subdir_civ1,'Value',ilist)% select the selected subdir in the menu3424 if get(handles.C IV1,'Value')==03427 set(handles.ListSubdirCiv1,'Value',ilist)% select the selected subdir in the menu 3428 if get(handles.CheckCiv1,'Value')==0 3425 3429 find_netcpair_civ1(hObject, eventdata, handles); %update the list of available pairs from netcdf files in the new directory 3426 3430 end 3427 3431 3428 3432 %------------------------------------------------------------------------ 3429 % --- Executes on carriage return on the subdir c iv1 edit window3433 % --- Executes on carriage return on the subdir checkciv1 edit window 3430 3434 function subdir_civ2_Callback(hObject, eventdata, handles) 3431 3435 %------------------------------------------------------------------------ 3432 3436 subdir=get(handles.subdir_civ1,'String'); 3433 menu_str=get(handles. list_subdir_civ2,'String');% read the list of subdirectories for update3437 menu_str=get(handles.ListSubDirCiv2,'String');% read the list of subdirectories for update 3434 3438 ichoice=find(strcmp(subdir,menu_str),1); 3435 3439 if isempty(ichoice) … … 3438 3442 ilist=ichoice; 3439 3443 end 3440 set(handles. list_subdir_civ2,'Value',ilist)% select the selected subdir in the menu3444 set(handles.ListSubDirCiv2,'Value',ilist)% select the selected subdir in the menu 3441 3445 %update the list of available pairs from netcdf files in the new directory 3442 if ~get(handles.C IV2,'Value') && ~get(handles.CIV1,'Value') && ~get(handles.FIX1,'Value') && ~get(handles.PATCH1,'Value')3446 if ~get(handles.CheckCiv2,'Value') && ~get(handles.CheckCiv1,'Value') && ~get(handles.CheckFix1,'Value') && ~get(handles.CheckPatch1,'Value') 3443 3447 find_netcpair_civ2(hObject, eventdata, handles); 3444 3448 end 3445 3449 3446 3450 % %------------------------------------------------------------------------ 3447 % % --- Executes on button press in check_Mask: select box for mask option3451 % % --- Executes on button press in CheckMask: select box for mask option 3448 3452 % function check_Mask_Callback(hObject, eventdata, handles) 3449 3453 % %------------------------------------------------------------------------ 3450 % maskval=get(handles. check_Mask,'Value');3454 % maskval=get(handles.CheckMask,'Value'); 3451 3455 % if isequal(maskval,0) 3452 3456 % set(handles.txt_MaskName,'Visible','off') … … 3458 3462 % if isequal(flag_mask,1) 3459 3463 % mask_displ=[num2str(nbslice_mask) 'mask']; 3460 % elseif get(handles. compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series3464 % elseif get(handles.ListCompareMode,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 3461 3465 % common_path=fileparts(filebase); 3462 3466 % filebase_a=fullfile(common_path,get(handles.RootName_1,'String')); … … 3480 3484 % end 3481 3485 % if isequal(mask_displ,'no mask') 3482 % set(handles. check_Mask,'Value',0)3483 % set(handles. get_mask_fix1,'Value',0)3484 % set(handles. check_Mask,'Value',0)3485 % set(handles. get_mask_fix2,'Value',0)3486 % set(handles.CheckMask,'Value',0) 3487 % set(handles.CheckMask,'Value',0) 3488 % set(handles.CheckMask,'Value',0) 3489 % set(handles.CheckMask,'Value',0) 3486 3490 % else 3487 % set(handles. get_mask_fix1,'Value',1)3488 % set(handles. get_mask_fix2,'Value',1)3491 % set(handles.CheckMask,'Value',1) 3492 % set(handles.CheckMask,'Value',1) 3489 3493 % end 3490 3494 % set(handles.txt_MaskName,'String',mask_displ) 3491 % set(handles. mask_fix1,'String',mask_displ)3495 % set(handles.txt_MaskName,'String',mask_displ) 3492 3496 % set(handles.txt_Mask,'String',mask_displ) 3493 3497 % set(handles.mask_fix2,'String',mask_displ) 3494 3498 % end 3495 % set(handles. check_Mask,'Value',maskval)%update the civ2 mask with the same option asciv13496 3497 %------------------------------------------------------------------------ 3498 % --- Executes on button press in get_mask_fix1.3499 % set(handles.CheckMask,'Value',maskval)%update the checkciv2 mask with the same option as checkciv1 3500 3501 %------------------------------------------------------------------------ 3502 % --- Executes on button press in CheckMask. 3499 3503 function get_mask_fix1_Callback(hObject, eventdata, handles) 3500 3504 %------------------------------------------------------------------------ 3501 maskval=get(handles. get_mask_fix1,'Value');3505 maskval=get(handles.CheckMask,'Value'); 3502 3506 if isequal(maskval,0) 3503 set(handles. mask_fix1,'String','')3507 set(handles.txt_MaskName,'String','') 3504 3508 else 3505 3509 mask_displ='no mask'; %default … … 3508 3512 if isequal(flag_mask,1) 3509 3513 mask_displ=[num2str(nbslice) 'mask']; 3510 elseif get(handles. compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series3514 elseif get(handles.ListCompareMode,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 3511 3515 filebase_a=get(handles.RootName_1,'String'); 3512 3516 [nbslice_a, flag_mask_a]=get_mask(filebase_a,handles); … … 3527 3531 end 3528 3532 if isequal(mask_displ,'no mask') 3529 set(handles. get_mask_fix1,'Value',0)3530 set(handles. check_Mask,'Value',0)3531 set(handles. get_mask_fix2,'Value',0)3533 set(handles.CheckMask,'Value',0) 3534 set(handles.CheckMask,'Value',0) 3535 set(handles.CheckMask,'Value',0) 3532 3536 else 3533 %set(handles. check_Mask,'Value',1)3534 set(handles. get_mask_fix2,'Value',1)3535 end 3536 set(handles. mask_fix1,'String',mask_displ)3537 %set(handles.CheckMask,'Value',1) 3538 set(handles.CheckMask,'Value',1) 3539 end 3540 set(handles.txt_MaskName,'String',mask_displ) 3537 3541 set(handles.txt_Mask,'String',mask_displ) 3538 3542 set(handles.mask_fix2,'String',mask_displ) … … 3540 3544 3541 3545 %------------------------------------------------------------------------ 3542 % --- Executes on button press in check_Mask: select box for mask option3546 % --- Executes on button press in CheckMask: select box for mask option 3543 3547 function get_mask_civ2_Callback(hObject, eventdata, handles) 3544 3548 %------------------------------------------------------------------------ 3545 maskval=get(handles. check_Mask,'Value');3549 maskval=get(handles.CheckMask,'Value'); 3546 3550 if isequal(maskval,0) 3547 3551 set(handles.txt_Mask,'String','') … … 3552 3556 if isequal(flag_mask,1) 3553 3557 mask_displ=[num2str(nbslice) 'mask']; 3554 elseif get(handles. compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series3558 elseif get(handles.ListCompareMode,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 3555 3559 filebase_a=get(handles.RootName_1,'String'); 3556 3560 [nbslice_a, flag_mask_a]=get_mask(filebase_a,handles); … … 3571 3575 end 3572 3576 if isequal(mask_displ,'no mask') 3573 set(handles. check_Mask,'Value',0)3574 set(handles. get_mask_fix2,'Value',0)3577 set(handles.CheckMask,'Value',0) 3578 set(handles.CheckMask,'Value',0) 3575 3579 else 3576 set(handles. get_mask_fix2,'Value',1)3580 set(handles.CheckMask,'Value',1) 3577 3581 end 3578 3582 set(handles.txt_Mask,'String',mask_displ) … … 3581 3585 3582 3586 %------------------------------------------------------------------------ 3583 % --- Executes on button press in get_mask_fix2.3587 % --- Executes on button press in CheckMask. 3584 3588 function get_mask_fix2_Callback(hObject, eventdata, handles) 3585 3589 %------------------------------------------------------------------------ 3586 maskval=get(handles. get_mask_fix2,'Value');3590 maskval=get(handles.CheckMask,'Value'); 3587 3591 if isequal(maskval,0) 3588 3592 set(handles.mask_fix2,'String','') … … 3593 3597 if isequal(flag_mask,1) 3594 3598 mask_displ=[num2str(nbslice) 'mask']; 3595 elseif get(handles. compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series3599 elseif get(handles.ListCompareMode,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 3596 3600 filebase_a=get(handles.RootName_1,'String'); 3597 3601 [nbslice_a, flag_mask_a]=get_mask(filebase_a,handles); … … 3612 3616 end 3613 3617 if isequal(mask_displ,'no mask') 3614 set(handles. get_mask_fix2,'Value',0)3618 set(handles.CheckMask,'Value',0) 3615 3619 end 3616 3620 set(handles.mask_fix2,'String',mask_displ) … … 3710 3714 3711 3715 %------------------------------------------------------------------------ 3712 % --- Executes on button press in list_subdir_civ1.3713 function list_subdir_civ1_Callback(hObject, eventdata, handles)3714 %------------------------------------------------------------------------ 3715 list_subdir_civ1=get(handles. list_subdir_civ1,'String');3716 val=get(handles. list_subdir_civ1,'Value');3716 % --- Executes on button press in ListSubdirCiv1. 3717 function ListSubdirCiv1_Callback(hObject, eventdata, handles) 3718 %------------------------------------------------------------------------ 3719 list_subdir_civ1=get(handles.ListSubdirCiv1,'String'); 3720 val=get(handles.ListSubdirCiv1,'Value'); 3717 3721 subdir=list_subdir_civ1{val}; 3718 3722 if strcmp(subdir,'new...') … … 3724 3728 3725 3729 %------------------------------------------------------------------------ 3726 % --- Executes on button press in list_subdir_civ2.3727 function list_subdir_civ2_Callback(hObject, eventdata, handles)3728 %------------------------------------------------------------------------ 3729 list_subdir_civ2=get(handles. list_subdir_civ2,'String');3730 val=get(handles. list_subdir_civ2,'Value');3730 % --- Executes on button press in ListSubDirCiv2. 3731 function ListSubDirCiv2_Callback(hObject, eventdata, handles) 3732 %------------------------------------------------------------------------ 3733 list_subdir_civ2=get(handles.ListSubDirCiv2,'String'); 3734 val=get(handles.ListSubDirCiv2,'Value'); 3731 3735 subdir=list_subdir_civ2{val}; 3732 3736 if strcmp(subdir,'new...') … … 3734 3738 end 3735 3739 set(handles.subdir_civ2,'String',subdir); 3736 % set(handles. list_subdir_civ2,'Value',1);3737 3738 3739 %------------------------------------------------------------------------ 3740 % --- Executes on button press in check_Grid.3741 function check_Grid_Callback(hObject, eventdata, handles)3740 % set(handles.ListSubDirCiv2,'Value',1); 3741 3742 3743 %------------------------------------------------------------------------ 3744 % --- Executes on button press in CheckGrid. 3745 function CheckGrid_Callback(hObject, eventdata, handles) 3742 3746 %------------------------------------------------------------------------ 3743 3747 value=get(hObject,'Value'); … … 3784 3788 end 3785 3789 3786 %% if hObject is on the c iv1 frame, duplicate action forciv2 frame3790 %% if hObject is on the checkciv1 frame, duplicate action for checkciv2 frame 3787 3791 PanelName=get(hparent,'tag'); 3788 3792 if strcmp(PanelName,'panel_Civ1') 3789 hchildren=get(handles. panel_Civ2,'children');3793 hchildren=get(handles.Civ2,'children'); 3790 3794 handle_checkbox=findobj(hchildren,'tag','check_Grid'); 3791 3795 handle_txtbox=findobj(hchildren,'tag','txt_GridName'); … … 3801 3805 else 3802 3806 set(handle_checkbox,'Value',0); 3803 set(handles. check_Grid,'Value',0);3807 set(handles.CheckGrid,'Value',0); 3804 3808 set(handle_dx,'Visible','on'); 3805 3809 set(handle_dy,'Visible','on'); … … 3808 3812 end 3809 3813 %------------------------------------------------------------------------ 3810 % --- Executes on button press in check_Mask.3811 function check_Mask_Callback(hObject, eventdata, handles)3814 % --- Executes on button press in CheckMask. 3815 function CheckMask_Callback(hObject, eventdata, handles) 3812 3816 %------------------------------------------------------------------------ 3813 3817 value=get(hObject,'Value'); … … 3820 3824 testmask=1; 3821 3825 else % browse for a mask 3822 filemask=get(handles. check_Mask,'UserData');%look for previous mask name stored as UserData3826 filemask=get(handles.CheckMask,'UserData');%look for previous mask name stored as UserData 3823 3827 if exist(filemask,'file') 3824 3828 filebase=filemask; … … 3830 3834 'Pick a mask file *.png',filebase); 3831 3835 filemask=fullfile(PathName,FileName); 3832 set(handles. check_Mask,'UserData',filemask);%store for future use3836 set(handles.CheckMask,'UserData',filemask);%store for future use 3833 3837 if ~(isempty(FileName)||isempty(PathName)||isequal(FileName,0)||~exist(filemask,'file')) 3834 3838 testmask=1; … … 3844 3848 set(handles.txt_MaskName,'String',filemask) 3845 3849 else 3846 set(handles. check_Mask,'Value',0);3847 set(handles. check_Grid,'Value',0);3850 set(handles.CheckMask,'Value',0); 3851 set(handles.CheckGrid,'Value',0); 3848 3852 set(handles.num_Dx,'Visible','on'); 3849 3853 set(handles.num_Dy,'Visible','on'); … … 3854 3858 3855 3859 %------------------------------------------------------------------------ 3856 % --- Executes on button press in check_Grid.3860 % --- Executes on button press in CheckGrid. 3857 3861 function browse_gridciv2_Callback(hObject, eventdata, handles) 3858 3862 %------------------------------------------------------------------------ 3859 value=get(handles. check_Grid,'Value');3863 value=get(handles.CheckGrid,'Value'); 3860 3864 if value 3861 3865 filebase=get(handles.RootName,'String'); … … 3874 3878 filegrid=fullfile(PathName,FileName); 3875 3879 if isempty(FileName)||isempty(PathName)||isequal(FileName,0)||~exist(filegrid,'file') 3876 set(handles. check_Grid,'Value',0);3880 set(handles.CheckGrid,'Value',0); 3877 3881 set(handles.txt_GridName,'string',''); 3878 3882 set(handles.num_Dx,'Visible','on'); … … 3893 3897 end 3894 3898 3895 % % --- Executes on button press in check_Grid.3899 % % --- Executes on button press in CheckGrid. 3896 3900 % function browse_gridciv2_Callback(hObject, eventdata, handles) 3897 3901 % … … 3938 3942 return 3939 3943 end 3940 set(handles. panel_Civ1,'Visible','on')3941 set(handles. panel_PairIndices,'Visible','on')3944 set(handles.Civ1,'Visible','on') 3945 set(handles.PairIndices,'Visible','on') 3942 3946 % set(handles.frame_civ1,'BackgroundColor',[1 1 0]) 3943 3947 % set(handles.frame_para_civ1,'BackgroundColor',[1 1 0]) 3944 3948 % set(handles.frame_grid_civ1,'BackgroundColor',[1 1 0]) 3945 3949 else 3946 set(handles. panel_Civ1,'Visible','off')3950 set(handles.Civ1,'Visible','off') 3947 3951 % set(handles.frame_civ1,'BackgroundColor',[0.831 0.816 0.784]) 3948 3952 % set(handles.frame_para_civ1,'BackgroundColor',[0.831 0.816 0.784]) 3949 3953 % set(handles.frame_grid_civ1,'BackgroundColor',[0.831 0.816 0.784]) 3950 3954 end 3951 return 3952 set(handles.ibx,'Visible',state)3953 set(handles.iby,'Visible',state)3954 set(handles.isx,'Visible',state)3955 set(handles.isy,'Visible',state)3956 set(handles.shiftx,'Visible',state)3957 set(handles.shifty,'Visible',state)3958 set(handles.rho,'Visible',state)3959 set(handles.num_Dx,'Visible',state)3960 set(handles.num_Dy,'Visible',state)3961 set(handles.SearchRange,'Visible',state)3962 set(handles.u_title,'Visible',state)3963 set(handles.v_title,'Visible',state)3964 set(handles.min_title,'Visible',state)3965 set(handles.max_title,'Visible',state)3966 set(handles.umin,'Visible',state)3967 set(handles.umax,'Visible',state)3968 set(handles.vmin,'Visible',state)3969 set(handles.vmax,'Visible',state)3970 set(handles.txt_GridName,'Visible',state)3971 set(handles.txt_MaskName,'Visible',state)3972 set(handles.check_Grid,'Visible',state)3973 set(handles.check_Mask,'Visible',state)3974 set(handles.parameters,'Visible',state)3975 set(handles.grid,'Visible',state)3976 set(handles.num_Dx,'Visible',state)3977 set(handles.num_Dy,'Visible',state)3978 set(handles.check_Threshold,'Visible',state)3979 if isequal(state,'off')3980 set(handles.MinIma,'Visible','off')3981 set(handles.MaxIma,'Visible','off')3982 set(handles.check_Threshold,'Value',0)3983 end3984 set(handles.dx_civ1_title,'Visible',state)3985 set(handles.dy_civ1_title,'Visible',state)3986 set(handles.ImaThreshold_title,'Visible',state)3987 set(handles.ib_title,'Visible',state)3988 set(handles.is_title,'Visible',state)3989 set(handles.shift_title,'Visible',state)3990 set(handles.rho_title,'Visible',state)3991 set(handles.TestCiv1,'Visible',state)3992 %set(handles. CivMode,'Visible',state)3955 3956 % set(handles.num_Bx,'Visible',state) 3957 % set(handles.num_By,'Visible',state) 3958 % set(handles.num_Sx,'Visible',state) 3959 % set(handles.num_Sy,'Visible',state) 3960 % set(handles.num_Shiftx,'Visible',state) 3961 % set(handles.num_Shifty,'Visible',state) 3962 % set(handles.num_Rho,'Visible',state) 3963 % set(handles.num_Dx,'Visible',state) 3964 % set(handles.num_Dy,'Visible',state) 3965 % set(handles.SearchRange,'Visible',state) 3966 % set(handles.u_title,'Visible',state) 3967 % set(handles.v_title,'Visible',state) 3968 % set(handles.min_title,'Visible',state) 3969 % set(handles.max_title,'Visible',state) 3970 % set(handles.umin,'Visible',state) 3971 % set(handles.umax,'Visible',state) 3972 % set(handles.vmin,'Visible',state) 3973 % set(handles.vmax,'Visible',state) 3974 % set(handles.txt_GridName,'Visible',state) 3975 % set(handles.txt_MaskName,'Visible',state) 3976 % set(handles.CheckGrid,'Visible',state) 3977 % set(handles.CheckMask,'Visible',state) 3978 % set(handles.parameters,'Visible',state) 3979 % set(handles.grid,'Visible',state) 3980 % set(handles.num_Dx,'Visible',state) 3981 % set(handles.num_Dy,'Visible',state) 3982 % set(handles.check_Threshold,'Visible',state) 3983 % if isequal(state,'off') 3984 % set(handles.num_MinIma,'Visible','off') 3985 % set(handles.num_MaxIma,'Visible','off') 3986 % set(handles.check_Threshold,'Value',0) 3987 % end 3988 % set(handles.dx_civ1_title,'Visible',state) 3989 % set(handles.dy_civ1_title,'Visible',state) 3990 % set(handles.ImaThreshold_title,'Visible',state) 3991 % set(handles.ib_title,'Visible',state) 3992 % set(handles.is_title,'Visible',state) 3993 % set(handles.shift_title,'Visible',state) 3994 % set(handles.rho_title,'Visible',state) 3995 % set(handles.TestCiv1,'Visible',state) 3996 %set(handles.ListPairMode,'Visible',state) 3993 3997 3994 3998 %------------------------------------------------------------------------ … … 4008 4012 end 4009 4013 if isequal(state,'on') 4010 set(handles. panel_Fix1,'Visible','on')4014 set(handles.Fix1,'Visible','on') 4011 4015 % set(handles.frame_fix1,'BackgroundColor',[1 1 0]) 4012 4016 else 4013 set(handles. panel_Fix1,'Visible','off')4017 set(handles.Fix1,'Visible','off') 4014 4018 %set(handles.frame_fix1,'BackgroundColor',[0.7 0.7 0.7]) 4015 4019 end 4016 % set(handles.REMOVE,'Visible',state)4017 set(handles.vec_Fmin2,'Visible',state)4018 set(handles.vec_F2,'Visible',state)4019 set(handles.vec_F3,'Visible',state)4020 set(handles.thresh_vecC,'Visible',state)4021 set(handles.thresh_vecC_title,'Visible',state)4022 set(handles.thresh_vel,'Visible',state)4023 set(handles.thresh_vel_text,'Visible',state)4024 set(handles.mask_fix1,'Visible',state)4025 set(handles.get_mask_fix1,'Visible',state)4026 set(handles.get_ref_fix1,'Visible',state)4027 set(handles.ref_fix1,'Visible',state)4028 set(handles.inf_sup1,'Visible',state)4029 set(handles.field_ref1,'Visible',state)4020 % % set(handles.REMOVE,'Visible',state) 4021 % set(handles.CheckFmin2,'Visible',state) 4022 % set(handles.CheckF2,'Visible',state) 4023 % set(handles.CheckF3,'Visible',state) 4024 % set(handles.num_MinCorr,'Visible',state) 4025 % set(handles.thresh_vecC_title,'Visible',state) 4026 % set(handles.num_MaxVel,'Visible',state) 4027 % set(handles.thresh_vel_text,'Visible',state) 4028 % set(handles.txt_MaskName,'Visible',state) 4029 % set(handles.CheckMask,'Visible',state) 4030 % set(handles.get_ref_fix1,'Visible',state) 4031 % set(handles.ref_fix1,'Visible',state) 4032 % set(handles.inf_sup1,'Visible',state) 4033 % set(handles.field_ref1,'Visible',state) 4030 4034 4031 4035 %------------------------------------------------------------------------ … … 4038 4042 return 4039 4043 end 4040 set(handles. panel_Patch1,'Visible','on')4041 else 4042 set(handles. panel_Patch1,'Visible','off')4044 set(handles.Patch1,'Visible','on') 4045 else 4046 set(handles.Patch1,'Visible','off') 4043 4047 end 4044 4048 return … … 4046 4050 set(handles.rho_patch1,'Visible','on') 4047 4051 set(handles.rho_text1,'Visible','on') 4048 if get(handles. CivMode,'Value')==24052 if get(handles.ListPairMode,'Value')==2 4049 4053 set(handles.thresh_patch1,'Visible','on') 4050 4054 set(handles.thresh_text1,'Visible','on') … … 4058 4062 % if ~isempty(patch_newBin) 4059 4063 set(handles.test_interp,'Visible','off'); 4060 stereo_test=get(handles. compare,'Value');4064 stereo_test=get(handles.ListCompareMode,'Value'); 4061 4065 if stereo_test==3 4062 4066 set(handles.test_stereo1,'Visible','on') … … 4096 4100 return 4097 4101 end 4098 set(handles. panel_Civ2,'Visible','on')4099 else 4100 set(handles. panel_Civ2,'Visible','off')4101 end 4102 return 4103 4104 set(handles.ibx_civ2,'Visible',state)4105 set(handles.iby_civ2,'Visible',state)4106 set(handles.decimal,'Visible',state)4107 set(handles.deformation,'Visible',state)4108 set(handles.rho_civ2,'Visible',state)4109 set(handles.num_Dx,'Visible',state)4110 set(handles.num_Dy,'Visible',state)4111 set(handles.check_Grid,'Visible',state)4112 set(handles.check_Mask,'Visible',state)4113 set(handles.parameters,'Visible',state)4114 set(handles.grid,'Visible',state)4115 set(handles.parameters_text,'Visible',state)4116 set(handles.grid_text,'Visible',state)4117 set(handles.txt_GridName,'Visible',state)4118 set(handles.txt_Mask,'Visible',state)4119 set(handles.dx_civ2_title,'Visible',state)4120 set(handles.dy_civ2_title,'Visible',state)4121 set(handles.ibx_civ2_text,'Visible',state)4122 set(handles.rho_civ2_title,'Visible',state)4123 set(handles.ImaThreshold2,'Visible',state)4124 set(handles.ImaThreshold_title2,'Visible',state)4125 if isequal(state,'off')4126 set(handles.MinIma2,'Visible','off')4127 set(handles.MaxIma2,'Visible','off')4128 set(handles.ImaThreshold2,'Value',0)4129 if isequal(get(handles.FIX2,'Value'),0) & isequal(get(handles.PATCH2,'Value'),0)4130 set(handles.list_pair_civ2,'Visible','off')4131 set(handles.subdir_civ2,'Visible','off')4132 set(handles.subdir_civ2_text,'Visible','off')4133 set(handles.dt_unit_civ2,'Visible','off')4134 %set(handles.ref_i_civ2,'Visible','off')4135 set(handles.i_ref_civ2_title,'Visible','off')4136 set(handles.j_ref_civ2_title,'Visible','off')4137 set(handles.ref_j_civ2,'Visible','off')4138 end4139 else4140 set(handles.list_pair_civ2,'Visible','on')4141 set(handles.subdir_civ2,'Visible','on')4142 set(handles.subdir_civ2_text,'Visible','on')4143 set(handles.dt_unit_civ2,'Visible','on')4144 % set(handles.ref_i_civ2,'Visible','on')4145 set(handles.i_ref_civ2_title,'Visible','on')4146 set(handles.j_ref_civ2_title,'Visible','on')4147 set(handles.ref_j_civ2,'Visible','on')4148 end4149 set(handles.rho_civ2_title,'Visible',state)4102 set(handles.Civ2,'Visible','on') 4103 else 4104 set(handles.Civ2,'Visible','off') 4105 end 4106 4107 % 4108 % set(handles.ibx_civ2,'Visible',state) 4109 % set(handles.iby_civ2,'Visible',state) 4110 % set(handles.decimal,'Visible',state) 4111 % set(handles.deformation,'Visible',state) 4112 % set(handles.rho_civ2,'Visible',state) 4113 % set(handles.num_Dx,'Visible',state) 4114 % set(handles.num_Dy,'Visible',state) 4115 % set(handles.CheckGrid,'Visible',state) 4116 % set(handles.CheckMask,'Visible',state) 4117 % set(handles.parameters,'Visible',state) 4118 % set(handles.grid,'Visible',state) 4119 % set(handles.parameters_text,'Visible',state) 4120 % set(handles.grid_text,'Visible',state) 4121 % set(handles.txt_GridName,'Visible',state) 4122 % set(handles.txt_Mask,'Visible',state) 4123 % set(handles.dx_civ2_title,'Visible',state) 4124 % set(handles.dy_civ2_title,'Visible',state) 4125 % set(handles.ibx_civ2_text,'Visible',state) 4126 % set(handles.rho_civ2_title,'Visible',state) 4127 % set(handles.ImaThreshold2,'Visible',state) 4128 % set(handles.ImaThreshold_title2,'Visible',state) 4129 % if isequal(state,'off') 4130 % set(handles.MinIma2,'Visible','off') 4131 % set(handles.MaxIma2,'Visible','off') 4132 % set(handles.ImaThreshold2,'Value',0) 4133 % if isequal(get(handles.CheckFix2,'Value'),0) & isequal(get(handles.CheckPatch2,'Value'),0) 4134 % set(handles.ListPairCiv2,'Visible','off') 4135 % set(handles.subdir_civ2,'Visible','off') 4136 % set(handles.subdir_civ2_text,'Visible','off') 4137 % set(handles.dt_unit_civ2,'Visible','off') 4138 % %set(handles.ref_i_civ2,'Visible','off') 4139 % set(handles.i_ref_civ2_title,'Visible','off') 4140 % set(handles.j_ref_civ2_title,'Visible','off') 4141 % set(handles.ref_j_civ2,'Visible','off') 4142 % end 4143 % else 4144 % set(handles.ListPairCiv2,'Visible','on') 4145 % set(handles.subdir_civ2,'Visible','on') 4146 % set(handles.subdir_civ2_text,'Visible','on') 4147 % set(handles.dt_unit_civ2,'Visible','on') 4148 % % set(handles.ref_i_civ2,'Visible','on') 4149 % set(handles.i_ref_civ2_title,'Visible','on') 4150 % set(handles.j_ref_civ2_title,'Visible','on') 4151 % set(handles.ref_j_civ2,'Visible','on') 4152 % end 4153 % set(handles.rho_civ2_title,'Visible',state) 4150 4154 4151 4155 %------------------------------------------------------------------------ … … 4153 4157 %------------------------------------------------------------------------ 4154 4158 % if isequal(state,'on') 4155 % set(handles. panel_Fix2,'Visible','on')4159 % set(handles.Fix2,'Visible','on') 4156 4160 % 4157 4161 % % set(handles.frame_civ2,'BackgroundColor',[1 1 0]) … … 4166 4170 return 4167 4171 end 4168 set(handles. panel_Fix2,'Visible','on')4169 else 4170 set(handles. panel_Fix2,'Visible','off')4171 end 4172 return 4173 set(handles.frame_fix2,'BackgroundColor',[1 1 0])4174 set(handles.REMOVE2,'Visible','on')4175 set(handles.vec_Fmin2_2,'Visible','on')4176 set(handles.vec_F4,'Visible','on')4177 set(handles.vec_F3_2,'Visible','on')4178 set(handles.thresh_vec2C,'Visible','on')4179 set(handles.thresh_vec2C_text,'Visible','on')4180 set(handles.thresh_vel2,'Visible','on')4181 set(handles.thresh_vel2_text,'Visible','on')4182 set(handles.mask_fix2,'Visible','on')4183 set(handles.get_mask_fix2,'Visible','on')4184 set(handles.list_pair_civ2,'Visible','on')4185 set(handles.subdir_civ2,'Visible','on')4186 set(handles.subdir_civ2_text,'Visible','on')4187 set(handles.get_ref_fix2,'Visible','on')4188 set(handles.ref_fix2,'Visible','on')4189 set(handles.inf_sup2,'Visible','on')4190 set(handles.field_ref2,'Visible','on')4172 set(handles.Fix2,'Visible','on') 4173 else 4174 set(handles.Fix2,'Visible','off') 4175 end 4176 4177 % set(handles.frame_fix2,'BackgroundColor',[1 1 0]) 4178 % set(handles.REMOVE2,'Visible','on') 4179 % set(handles.vec_Fmin2_2,'Visible','on') 4180 % set(handles.vec_F4,'Visible','on') 4181 % set(handles.vec_F3_2,'Visible','on') 4182 % set(handles.thresh_vec2C,'Visible','on') 4183 % set(handles.thresh_vec2C_text,'Visible','on') 4184 % set(handles.thresh_vel2,'Visible','on') 4185 % set(handles.thresh_vel2_text,'Visible','on') 4186 % set(handles.mask_fix2,'Visible','on') 4187 % set(handles.CheckMask,'Visible','on') 4188 % set(handles.ListPairCiv2,'Visible','on') 4189 % set(handles.subdir_civ2,'Visible','on') 4190 % set(handles.subdir_civ2_text,'Visible','on') 4191 % set(handles.get_ref_fix2,'Visible','on') 4192 % set(handles.ref_fix2,'Visible','on') 4193 % set(handles.inf_sup2,'Visible','on') 4194 % set(handles.field_ref2,'Visible','on') 4191 4195 4192 4196 % %------------------------------------------------------------------------ … … 4203 4207 % set(handles.thresh_vel2_text,'Visible','off') 4204 4208 % set(handles.mask_fix2,'Visible','off') 4205 % set(handles. get_mask_fix2,'Visible','off')4209 % set(handles.CheckMask,'Visible','off') 4206 4210 % set(handles.get_ref_fix2,'Visible','off') 4207 4211 % set(handles.ref_fix2,'Visible','off') 4208 4212 % set(handles.inf_sup2,'Visible','off') 4209 4213 % set(handles.field_ref2,'Visible','off') 4210 % if isequal(get(handles.C IV2,'Value'),0) & isequal(get(handles.PATCH2,'Value'),0)4211 % set(handles. list_pair_civ2,'Visible','off')4214 % if isequal(get(handles.CheckCiv2,'Value'),0) & isequal(get(handles.CheckPatch2,'Value'),0) 4215 % set(handles.ListPairCiv2,'Visible','off') 4212 4216 % set(handles.subdir_civ2,'Visible','off') 4213 4217 % set(handles.subdir_civ2_text,'Visible','off') … … 4223 4227 return 4224 4228 end 4225 set(handles. panel_Patch2,'Visible','on')4226 else 4227 set(handles. panel_Patch2,'Visible','off')4229 set(handles.Patch2,'Visible','on') 4230 else 4231 set(handles.Patch2,'Visible','off') 4228 4232 end 4229 4233 % set(handles.frame_patch2,'BackgroundColor',[1 1 0]) … … 4240 4244 % % set(handles.get_gridpatch2,'Visible','on') 4241 4245 % % set(handles.grid_patch2,'Visible','on') 4242 % set(handles. list_pair_civ2,'Visible','on')4246 % set(handles.ListPairCiv2,'Visible','on') 4243 4247 % set(handles.subdir_civ2,'Visible','on') 4244 4248 % set(handles.subdir_civ2_text,'Visible','on') 4245 % stereo_test=get(handles. compare,'Value');4249 % stereo_test=get(handles.ListCompareMode,'Value'); 4246 4250 % if stereo_test==3 4247 % set(handles. check_Stereo,'Visible','on')4251 % set(handles.CheckStereo,'Visible','on') 4248 4252 % end 4249 4253 … … 4251 4255 % function desable_patch2(handles) 4252 4256 % %------------------------------------------------------------------------ 4253 % %set(handles. panel_Patch2,'Visible','off')4257 % %set(handles.checkpatch2,'Visible','off') 4254 4258 % return 4255 4259 % set(handles.frame_patch2,'BackgroundColor',[0.831 0.816 0.784]) … … 4266 4270 % % set(handles.get_gridpatch2,'Visible','off') 4267 4271 % % set(handles.grid_patch2,'Visible','off') 4268 % if isequal(get(handles.C IV2,'Value'),0) & isequal(get(handles.FIX2,'Value'),0)4269 % set(handles. list_pair_civ2,'Visible','off')4272 % if isequal(get(handles.CheckCiv2,'Value'),0) & isequal(get(handles.CheckFix2,'Value'),0) 4273 % set(handles.ListPairCiv2,'Visible','off') 4270 4274 % set(handles.subdir_civ2,'Visible','off') 4271 4275 % set(handles.subdir_civ2_text,'Visible','off') 4272 4276 % end 4273 % set(handles. check_Stereo,'Visible','off')4277 % set(handles.CheckStereo,'Visible','off') 4274 4278 %------------------------------------------------------------------------ 4275 4279 function enable_pair1(handles,state) 4276 4280 %------------------------------------------------------------------------ 4277 4281 set(handles.subdir_civ1,'Visible',state) 4278 set(handles. list_subdir_civ1,'Visible',state)4282 set(handles.ListSubdirCiv1,'Visible',state) 4279 4283 set(handles.SUBDIR_CIV1_txt,'Visible',state) 4280 4284 %set(handles.frame_subdirciv1,'Visible',state) 4281 set(handles. list_pair_civ1,'Visible',state)4285 set(handles.ListPairCiv1,'Visible',state) 4282 4286 set(handles.PairCiv1_title,'Visible',state) 4283 4287 %set(handles.dt_unit,'Visible',state) … … 4285 4289 4286 4290 %------------------------------------------------------------------------ 4287 % --- Read the parameters for c iv1 on the interface4291 % --- Read the parameters for checkciv1 on the interface 4288 4292 function par=read_param_civ1(handles,filecell) 4289 4293 %------------------------------------------------------------------------ 4290 ibx_val=str2double(get(handles. ibx,'String'));4294 ibx_val=str2double(get(handles.num_Bx,'String')); 4291 4295 par.ibx=num2str(ibx_val); 4292 iby_val=str2double(get(handles. iby,'String'));4296 iby_val=str2double(get(handles.num_By,'String')); 4293 4297 par.iby=num2str(iby_val); 4294 isx=get(handles. isx,'String');4295 if isnan(str2double(isx)), isx='41'; set(handles. isx,'String','41'), end; %default4296 if str2double(isx)<ibx_val+8,isx=num2str(ibx_val+8); set(handles. isx,'String',num2str(ibx_val+8)); end4297 isy=get(handles. isy,'String');4298 if isnan(str2double(isy)), isy='41'; set(handles. isy,'String','41'), end;%default4299 if str2double(isy)<iby_val+8,isy=num2str(iby_val+8); set(handles. isy,'String',num2str(iby_val+8)); end4300 par.isx=get(handles. isx,'String');4301 par.isy=get(handles. isy,'String');4302 par.shiftx=get(handles. shiftx,'String');4303 par.shifty=get(handles. shifty,'String');4298 isx=get(handles.num_Sx,'String'); 4299 if isnan(str2double(isx)), isx='41'; set(handles.num_Sx,'String','41'), end; %default 4300 if str2double(isx)<ibx_val+8,isx=num2str(ibx_val+8); set(handles.num_Sx,'String',num2str(ibx_val+8)); end 4301 isy=get(handles.num_Sy,'String'); 4302 if isnan(str2double(isy)), isy='41'; set(handles.num_Sy,'String','41'), end;%default 4303 if str2double(isy)<iby_val+8,isy=num2str(iby_val+8); set(handles.num_Sy,'String',num2str(iby_val+8)); end 4304 par.isx=get(handles.num_Sx,'String'); 4305 par.isy=get(handles.num_Sy,'String'); 4306 par.shiftx=get(handles.num_Shiftx,'String'); 4307 par.shifty=get(handles.num_Shifty,'String'); 4304 4308 if isnan(str2double(par.isx)) 4305 4309 par.isx='41';%default 4306 set(handles. isx,'String','41');4310 set(handles.num_Sx,'String','41'); 4307 4311 end 4308 4312 if isnan(str2double(par.isy)) 4309 4313 par.isy='41'; %default 4310 set(handles. isy,'String','41');4314 set(handles.num_Sy,'String','41'); 4311 4315 end 4312 4316 if isnan(str2double(par.shiftx)) 4313 4317 par.shiftx='0';%default 4314 set(handles. shiftx,'String','0');4318 set(handles.num_Shiftx,'String','0'); 4315 4319 end 4316 4320 if isnan(str2double(par.shifty)) 4317 4321 par.shifty='0'; %default 4318 set(handles. shifty,'String','0');4319 end 4320 par.rho=get(handles. rho,'String');4321 if isequal(get(handles. rho,'Style'),'popupmenu')4322 index=get(handles. rho,'Value');4322 set(handles.num_Shifty,'String','0'); 4323 end 4324 par.rho=get(handles.num_Rho,'String'); 4325 if isequal(get(handles.num_Rho,'Style'),'popupmenu') 4326 index=get(handles.num_Rho,'Value'); 4323 4327 par.rho=par.rho{index}; 4324 4328 end … … 4366 4370 function par=read_param_fix1(handles,filecell) 4367 4371 %------------------------------------------------------------------------ 4368 par.flagindex1(1)=get(handles. vec_Fmin2, 'Value');4369 par.flagindex1(2)=get(handles. vec_F3, 'Value');4370 par.flagindex1(3)=get(handles. vec_F2, 'Value');4371 par.thresh_vecC1=str2double(get(handles. thresh_vecC,'String'));%threshold on image correlation vec_C4372 par.thresh_vel1=str2double(get(handles. thresh_vel,'String'));%threshold on velocity modulus4373 par.test_mask=get(handles. get_mask_fix1,'Value');4374 par.nbslice_mask=get(handles. mask_fix1,'UserData'); % get the number of slices (= number of masks)4372 par.flagindex1(1)=get(handles.CheckFmin2, 'Value'); 4373 par.flagindex1(2)=get(handles.CheckF3, 'Value'); 4374 par.flagindex1(3)=get(handles.CheckF2, 'Value'); 4375 par.thresh_vecC1=str2double(get(handles.num_MinCorr,'String'));%threshold on image correlation vec_C 4376 par.thresh_vel1=str2double(get(handles.num_MaxVel,'String'));%threshold on velocity modulus 4377 par.test_mask=get(handles.CheckMask,'Value'); 4378 par.nbslice_mask=get(handles.txt_MaskName,'UserData'); % get the number of slices (= number of masks) 4375 4379 %%%%%%%%%%%%%COMPLETER LE PROGRAMME FIX 4376 4380 % inf_sup=get(handles.inf_sup1,'Value');80 … … 4389 4393 par.maskname=''; 4390 4394 else 4391 maskdispl=get(handles. mask_fix1,'String');4395 maskdispl=get(handles.txt_MaskName,'String'); 4392 4396 nbslice_mask=str2double(maskdispl(1:end-4)); % 4393 4397 num1_mask=mod(num1_civ1(ifile)-1,nbslice_mask)+1; … … 4516 4520 param.global.Civ1Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx 4517 4521 cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.log' ' ' filename '.civ1.log' '\n' 'chmod g+w ' filename '.civ1.log' '\n' 'chmod g+w ' filename '.nc'];%rename .log as .civ1.log and set the netcdf result file for group user writting 4518 % cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.cmx' ' ' filename '.c iv1.cmx' '\n'];%rename .cmx as .civ1.cmx4522 % cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.cmx' ' ' filename '.checkciv1.cmx' '\n'];%rename .cmx as .checkciv1.cmx 4519 4523 else %Windows system 4520 4524 % flname=regexprep(flname,'\\','\\\\'); 4521 % cmd=[cmd 'copy /Y "' flname '.c iv1.cmx" "' flname '.cmx"\n'];4525 % cmd=[cmd 'copy /Y "' flname '.checkciv1.cmx" "' flname '.cmx"\n']; 4522 4526 % filename=regexprep(filename,'\\','\\\\'); 4523 4527 cmd_CIV1=['copy /Y "' filename '.civ1.cmx" "' filename '.cmx"'];% copy the .civ1.cmx parameter file to .cmx … … 4526 4530 cmd_CIV1=[cmd_CIV1 '\n ' 'copy /Y "' filename '.log' '" "' filename '.civ1.log"']; %preserve the log file as .civ1.log 4527 4531 4528 % cmd_CIV1=[cmd_CIV1 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.c iv1.cmx"'];4529 end 4530 4531 %------------------------------------------------------------------------ 4532 % --- C IV1 Unified4532 % cmd_CIV1=[cmd_CIV1 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.checkciv1.cmx"']; 4533 end 4534 4535 %------------------------------------------------------------------------ 4536 % --- CheckCiv1 Unified 4533 4537 function xml_civ1_parameters=CIV1_CMD_Unified(filename,namelog,par) 4534 4538 %------------------------------------------------------------------------ 4535 4539 %pixels per cm and matrix of the image times, read from the .civ file by uvmat 4536 %global CivBin%name of the executable for c iv1 calculation4540 %global CivBin%name of the executable for checkciv1 calculation 4537 4541 4538 4542 civ1.image1=par.filename_ima_a; … … 4569 4573 4570 4574 %------------------------------------------------------------------------ 4571 % --- C IV2 Unified4575 % --- CheckCiv2 Unified 4572 4576 function civ2=CIV2_CMD_Unified(filename,namelog,par) 4573 4577 %------------------------------------------------------------------------ 4574 4578 %pixels per cm and matrix of the image times, read from the .civ file by uvmat 4575 %global CivBin%name of the executable for c iv1 calculation4579 %global CivBin%name of the executable for checkciv1 calculation 4576 4580 4577 4581 filename=regexprep(filename,'.nc',''); … … 4586 4590 civ2.correlationBoxesSize_Y=par.iby; 4587 4591 civ2.ro=par.rho; 4588 %c iv2.decimalShift=par.decimal;4589 %c iv2.deformation=par.deformation;4592 %checkciv2.decimalShift=par.decimal; 4593 %checkciv2.deformation=par.deformation; 4590 4594 if isequal(par.decimal,'1') 4591 4595 civ2.decimalShift='y'; … … 4623 4627 4624 4628 %------------------------------------------------------------------------ 4625 % --- C IV2 CIV2 CIV2 CIV24629 % --- CheckCiv2 CheckCiv2 CheckCiv2 CheckCiv2 4626 4630 function cmd_CIV2=CIV2_CMD(filename,param) 4627 4631 %------------------------------------------------------------------------ 4628 4632 %pixels per cm and matrix of the image times, read from the .civ file by uvmat 4629 % global civ2Bin sge%name of the executable for c iv1 calculation4633 % global civ2Bin sge%name of the executable for checkciv1 calculation 4630 4634 filename=regexprep(filename,'.nc',''); 4631 4635 if isequal(param.civ2.Dt,'0') … … 4676 4680 cmd_CIV2=[cmd_CIV2 param.global.Civ2Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx 4677 4681 cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.log' ' ' filename '.civ2.log' '\n' 'chmod g+w ' filename '.nc'];%preserve the log file as .civ2.log 4678 % cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.cmx' ' ' filename '.c iv2.cmx' '\n'];%rename .cmx as .civ2.cmx, the result file is named [filename '.nc'] by CIVx4682 % cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.cmx' ' ' filename '.checkciv2.cmx' '\n'];%rename .cmx as .checkciv2.cmx, the result file is named [filename '.nc'] by CIVx 4679 4683 4680 4684 else … … 4683 4687 cmd_CIV2=[cmd_CIV2 '\n "' regexprep(param.global.Civ2Bin,'\\','\\\\') '" -f "' filename '.cmx" >"' filename '.log"' ]; % redirect standard output to the log file 4684 4688 cmd_CIV2=[cmd_CIV2 '\n ' 'copy /Y "' filename '.log' '" "' filename '.civ2.log"']; 4685 % cmd_CIV2=[cmd_CIV2 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.c iv2.cmx"'];4689 % cmd_CIV2=[cmd_CIV2 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.checkciv2.cmx"']; 4686 4690 end 4687 4691 … … 4712 4716 function ref_i_Callback(hObject, eventdata, handles) 4713 4717 %------------------------------------------------------------------------ 4714 mode_list=get(handles. CivMode,'String');4715 mode_value=get(handles. CivMode,'Value');4718 mode_list=get(handles.ListPairMode,'String'); 4719 mode_value=get(handles.ListPairMode,'Value'); 4716 4720 mode=mode_list{mode_value}; 4717 4721 find_netcpair_civ1(hObject, eventdata, handles);% update the menu of pairs depending on the available netcdf files 4718 4722 if isequal(mode,'series(Di)') || ...% we do patch2 only 4719 (get(handles.C IV2,'Value')==0 && get(handles.CIV1,'Value')==0 && get(handles.FIX1,'Value')==0 && get(handles.PATCH1,'Value')==0)4723 (get(handles.CheckCiv2,'Value')==0 && get(handles.CheckCiv1,'Value')==0 && get(handles.CheckFix1,'Value')==0 && get(handles.CheckPatch1,'Value')==0) 4720 4724 find_netcpair_civ2(hObject, eventdata, handles); 4721 4725 end … … 4724 4728 function ref_j_Callback(hObject, eventdata, handles) 4725 4729 %------------------------------------------------------------------------ 4726 mode_list=get(handles. CivMode,'String');4727 mode_value=get(handles. CivMode,'Value');4730 mode_list=get(handles.ListPairMode,'String'); 4731 mode_value=get(handles.ListPairMode,'Value'); 4728 4732 mode=mode_list{mode_value}; 4729 if isequal(get(handles.C IV1,'Value'),0)|| isequal(mode,'series(Dj)')4733 if isequal(get(handles.CheckCiv1,'Value'),0)|| isequal(mode,'series(Dj)') 4730 4734 find_netcpair_civ1(hObject, eventdata, handles);% update the menu of pairs depending on the available netcdf files 4731 4735 end 4732 4736 if isequal(mode,'series(Dj)') || ... 4733 (get(handles.C IV2,'Value')==0 && get(handles.CIV1,'Value')==0 && get(handles.FIX1,'Value')==0 && get(handles.PATCH1,'Value')==0)4737 (get(handles.CheckCiv2,'Value')==0 && get(handles.CheckCiv1,'Value')==0 && get(handles.CheckFix1,'Value')==0 && get(handles.CheckPatch1,'Value')==0) 4734 4738 find_netcpair_civ2(hObject, eventdata, handles); 4735 4739 end … … 4738 4742 function ref_i_civ2_Callback(hObject, eventdata, handles) 4739 4743 %------------------------------------------------------------------------ 4740 mode_list=get(handles. CivMode,'String');4741 mode_value=get(handles. CivMode,'Value');4744 mode_list=get(handles.ListPairMode,'String'); 4745 mode_value=get(handles.ListPairMode,'Value'); 4742 4746 mode=mode_list{mode_value}; 4743 4747 find_netcpair_civ2(hObject, eventdata, handles);% update the menu of pairs depending on the available netcdf files … … 4746 4750 function ref_j_civ2_Callback(hObject, eventdata, handles) 4747 4751 %------------------------------------------------------------------------ 4748 mode_list=get(handles. CivMode,'String');4749 mode_value=get(handles. CivMode,'Value');4752 mode_list=get(handles.ListPairMode,'String'); 4753 mode_value=get(handles.ListPairMode,'Value'); 4750 4754 mode=mode_list{mode_value}; 4751 4755 if isequal(mode,'series(Dj)') … … 4754 4758 4755 4759 %------------------------------------------------------------------------ 4756 % --- Executes on button press in compare.4757 function compare_Callback(hObject, eventdata, handles)4758 %------------------------------------------------------------------------ 4759 test=get(handles. compare,'Value');4760 % --- Executes on button press in ListCompareMode. 4761 function ListCompareMode_Callback(hObject, eventdata, handles) 4762 %------------------------------------------------------------------------ 4763 test=get(handles.ListCompareMode,'Value'); 4760 4764 if test==2 || test==3 % case 'dispalcemen' or 'stereo PIV' 4761 4765 filebase=get(handles.RootName,'String'); … … 4765 4769 set(handles.sub_txt,'Visible','on') 4766 4770 set(handles.RootName_1,'Visible','On');%mkes the second file input window visible 4767 mode_store=get(handles. CivMode,'String');%get the present 'mode'4768 set(handles. compare,'UserData',mode_store);%store the mode display4769 set(handles. CivMode,'Visible','off')4771 mode_store=get(handles.ListPairMode,'String');%get the present 'mode' 4772 set(handles.ListCompareMode,'UserData',mode_store);%store the mode display 4773 set(handles.ListPairMode,'Visible','off') 4770 4774 if test==2 4771 set(handles. CivMode,'Visible','off')4772 set(handles. CivMode,'Value',1) % mode 'civX' selected by default4775 set(handles.ListPairMode,'Visible','off') 4776 set(handles.ListPairMode,'Value',1) % mode 'civX' selected by default 4773 4777 else 4774 set(handles. CivMode,'Visible','on')4775 set(handles. CivMode,'Value',3) % mode 'Matlab' selected for stereo4778 set(handles.ListPairMode,'Visible','on') 4779 set(handles.ListPairMode,'Value',3) % mode 'Matlab' selected for stereo 4776 4780 end 4777 4781 … … 4820 4824 % ref_j=get(handles.ref_j,'string'); 4821 4825 % [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc]=set_civ_filenames(handles,ref_i,ref_j,[1 0 0 0 0 0]); 4822 % A=imread(filecell.ima1.c iv1{1});4826 % A=imread(filecell.ima1.checkciv1{1}); 4823 4827 % A_1=imread(fileinput); 4824 4828 % npxy=size(A); … … 4829 4833 % end 4830 4834 else 4831 set(handles. CivMode,'Visible','on')4835 set(handles.ListPairMode,'Visible','on') 4832 4836 set(handles.RootName_1,'Visible','Off'); 4833 4837 set(handles.sub_txt,'Visible','off') 4834 4838 set(handles.RootName_1,'String',[]); 4835 mode_store=get(handles. compare,'UserData');4836 set(handles. CivMode,'Value',1)4837 set(handles. CivMode,'String',mode_store)4839 mode_store=get(handles.ListCompareMode,'UserData'); 4840 set(handles.ListPairMode,'Value',1) 4841 set(handles.ListPairMode,'String',mode_store) 4838 4842 set(handles.test_stereo1,'Value',0) 4839 set(handles. check_Stereo,'Value',0)4840 set(handles. CivMode,'Value',1) % mode 'civX' selected by default4841 end 4842 if test==3 && get(handles. PATCH1,'Value')4843 set(handles.CheckStereo,'Value',0) 4844 set(handles.ListPairMode,'Value',1) % mode 'civX' selected by default 4845 end 4846 if test==3 && get(handles.CheckPatch1,'Value') 4843 4847 set(handles.test_stereo1,'Visible','on') 4844 4848 else 4845 4849 set(handles.test_stereo1,'Visible','off') 4846 4850 end 4847 if test==3 && get(handles. PATCH2,'Value')4848 set(handles. check_Stereo,'Visible','on')4849 else 4850 set(handles. check_Stereo,'Visible','off')4851 if test==3 && get(handles.CheckPatch2,'Value') 4852 set(handles.CheckStereo,'Visible','on') 4853 else 4854 set(handles.CheckStereo,'Visible','off') 4851 4855 end 4852 4856 mode_Callback(hObject, eventdata, handles) … … 4893 4897 set(handles.field_ref1,'Value',length(menu_field)); 4894 4898 set(handles.inf_sup1,'Value',2); 4895 set(handles. thresh_vel,'String','1');%default threshold4899 set(handles.num_MaxVel,'String','1');%default threshold 4896 4900 set(handles.ref_fix1,'Enable','on') 4897 4901 … … 4979 4983 4980 4984 %------------------------------------------------------------------------ 4981 % --- Executes on button press in check_Stereo.4985 % --- Executes on button press in CheckStereo. 4982 4986 function StereoCheck_Callback(hObject, eventdata, handles) 4983 4987 %------------------------------------------------------------------------ 4984 if isequal(get(handles. check_Stereo,'Value'),0)4988 if isequal(get(handles.CheckStereo,'Value'),0) 4985 4989 set(handles.num_SubdomainSize,'Visible','on') 4986 4990 set(handles.num_SmoothParam,'Visible','on') … … 4995 4999 %------------------------------------------------------------------------ 4996 5000 if isequal(get(handles.check_Threshold,'Value'),1) 4997 set(handles. MinIma,'Visible','on')4998 set(handles. MaxIma,'Visible','on')4999 else 5000 set(handles. MinIma,'Visible','off')5001 set(handles. MaxIma,'Visible','off')5001 set(handles.num_MinIma,'Visible','on') 5002 set(handles.num_MaxIma,'Visible','on') 5003 else 5004 set(handles.num_MinIma,'Visible','off') 5005 set(handles.num_MaxIma,'Visible','off') 5002 5006 end 5003 5007 … … 5097 5101 drawnow 5098 5102 listtype={'civ1','fix1','patch1','civ2','fix2','patch2'}; 5099 box_test(1)=get(handles.CIV1,'Value');5100 box_test(2)=get(handles.FIX1,'Value');5101 box_test(3)=get(handles.PATCH1,'Value');5102 box_test(4)=get(handles.CIV2,'Value');5103 box_test(5)=get(handles.FIX2,'Value');5104 box_test(6)=get(handles.PATCH2,'Value');5103 Param.CheckCiv1=get(handles.CheckCiv1,'Value'); 5104 Param.CheckFix1=get(handles.CheckFix1,'Value'); 5105 Param.CheckPatch1=get(handles.CheckPatch1,'Value'); 5106 Param.CheckCiv2=get(handles.CheckCiv2,'Value'); 5107 Param.CheckFix2=get(handles.CheckFix2,'Value'); 5108 Param.CheckPatch2=get(handles.CheckPatch2,'Value'); 5105 5109 option_civ=find(box_test,1,'last');%last selected option (non-zero index of box_test) 5106 5110 filecell=get(handles.civ,'UserData');%retrieve the list of output files expected for PIV … … 5253 5257 5254 5258 %------------------------------------------------------------------------ 5255 % % --- Executes on button press in CivMode.5259 % % --- Executes on button press in ListPairMode. 5256 5260 % function CivMode_Callback(hObject, eventdata, handles) 5257 5261 % %------------------------------------------------------------------------ 5258 % Listprog=get(handles. CivMode,'String');5259 % index=get(handles. CivMode,'Value');5262 % Listprog=get(handles.ListPairMode,'String'); 5263 % index=get(handles.ListPairMode,'Value'); 5260 5264 % prog=Listprog{index}; 5261 5265 % switch prog … … 5265 5269 % set(handles.num_MaxDiff,'Visible','off') 5266 5270 % set(handles.thresh_text2,'Visible','off') 5267 % set(handles. rho,'Style','edit')5268 % set(handles. rho,'String','1')5271 % set(handles.num_Rho,'Style','edit') 5272 % set(handles.num_Rho,'String','1') 5269 5273 % set(handles.BATCH,'Enable','on') 5270 5274 % case 'CivAll' 5271 % if get(handles. PATCH1,'Value')5275 % if get(handles.CheckPatch1,'Value') 5272 5276 % set(handles.thresh_patch1,'Visible','on') 5273 5277 % set(handles.thresh_text1,'Visible','on') 5274 5278 % end 5275 % set(handles. rho,'Style','edit')5276 % set(handles. rho,'String','1')5279 % set(handles.num_Rho,'Style','edit') 5280 % set(handles.num_Rho,'String','1') 5277 5281 % set(handles.BATCH,'Enable','on') 5278 5282 % case 'CivUvmat' … … 5281 5285 5282 5286 5283 % --- Executes on button press in check_Stereo.5284 function check_Stereo_Callback(hObject, eventdata, handles)5285 % hObject handle to check_Stereo (see GCBO)5287 % --- Executes on button press in CheckStereo. 5288 function CheckStereo_Callback(hObject, eventdata, handles) 5289 % hObject handle to CheckStereo (see GCBO) 5286 5290 % eventdata reserved - to be defined in a future version of MATLAB 5287 5291 % handles structure with handles and user data (see GUIDATA) 5288 5292 5289 % Hint: get(hObject,'Value') returns toggle state of check_Stereo5293 % Hint: get(hObject,'Value') returns toggle state of CheckStereo 5290 5294 5291 5295 … … 5355 5359 set(handles.num_MaxDiff,'Visible','off') 5356 5360 set(handles.thresh_text2,'Visible','off') 5357 set(handles. rho,'Style','edit')5358 set(handles. rho,'String','1')5361 set(handles.num_Rho,'Style','edit') 5362 set(handles.num_Rho,'String','1') 5359 5363 set(handles.BATCH,'Enable','on') 5360 5364 … … 5363 5367 set(handles.Matlab,'checked','on') 5364 5368 set(handles.CivX,'checked','off') 5365 if get(handles. PATCH1,'Value')5369 if get(handles.CheckPatch1,'Value') 5366 5370 set(handles.thresh_patch1,'Visible','on') 5367 5371 set(handles.thresh_text1,'Visible','on') 5368 5372 end 5369 if get(handles. PATCH2,'Value')5373 if get(handles.CheckPatch2,'Value') 5370 5374 set(handles.num_MaxDiff,'Visible','on') 5371 5375 set(handles.thresh_text2,'Visible','on') 5372 5376 end 5373 set(handles. rho,'Style','popupmenu')5374 set(handles. rho,'Value',1)5375 set(handles. rho,'String',{'1';'2'})5377 set(handles.num_Rho,'Style','popupmenu') 5378 set(handles.num_Rho,'Value',1) 5379 set(handles.num_Rho,'String',{'1';'2'}) 5376 5380 set(handles.BATCH,'Enable','off') 5377 5381 … … 5381 5385 hchild=get(handle,'children'); 5382 5386 for ichild=1:numel(hchild) 5383 object_style=get(hchild(ichild),'Style'); 5384 tag=get(hchild(ichild),'tag'); 5385 check_input=1;%default 5386 switch object_style 5387 case 'edit' 5388 switch(tag(1:4)) 5389 case 'num_' 5390 input=str2double(get(hchild(ichild),'String')); 5391 %deal with undefined input: retrieve the default value stored as UserData 5392 if isnan(input) 5393 input=get(hchild(ichild),'UserData'); 5394 set(hchild(ichild),'String',num2str(input)) 5395 end 5396 case 'txt_' 5397 input=get(hchild(ichild),'String'); 5398 end 5399 key=tag(5:end); 5400 case 'checkbox' 5401 input=get(hchild(ichild),'Value'); 5402 key=tag(7:end); 5403 otherwise 5404 check_input=0; 5405 end 5406 if check_input 5407 eval(['struct.' key '=input;']) 5408 end 5409 end 5387 if strcmp(get(hchild(ichild),'Visible'),'on') 5388 object_style=get(hchild(ichild),'Style'); 5389 tag=get(hchild(ichild),'tag'); 5390 check_input=1;%default 5391 switch object_style 5392 case 'edit' 5393 switch(tag(1:4)) 5394 case 'num_' 5395 input=str2double(get(hchild(ichild),'String')); 5396 %deal with undefined input: retrieve the default value stored as UserData 5397 if isnan(input) 5398 input=get(hchild(ichild),'UserData'); 5399 set(hchild(ichild),'String',num2str(input)) 5400 end 5401 case 'txt_' 5402 input=get(hchild(ichild),'String'); 5403 end 5404 key=tag(5:end); 5405 case 'checkbox' 5406 input=get(hchild(ichild),'Value'); 5407 key=tag(7:end); 5408 otherwise 5409 check_input=0; 5410 end 5411 if check_input 5412 eval(['struct.' key '=input;']) 5413 end 5414 end 5415 end
Note: See TracChangeset
for help on using the changeset viewer.