Changeset 71 for trunk/src/civ.m
- Timestamp:
- Mar 29, 2010, 6:34:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r67 r71 22 22 function varargout = civ(varargin) 23 23 24 % Last Modified by GUIDE v2.5 10-Jan-2010 22:04:4524 % Last Modified by GUIDE v2.5 27-Mar-2010 13:41:11 25 25 % Begin initialization code - DO NOT EDIT 26 26 gui_Singleton = 1; … … 44 44 %------------------------------------------------------------------------ 45 45 % --- Executes just before civ is made visible. 46 function civ_OpeningFcn(hObject, eventdata, handles, varargin)46 function civ_OpeningFcn(hObject, eventdata, handles, param) 47 47 %------------------------------------------------------------------------ 48 48 % This function has no output args, see OutputFcn. … … 65 65 %default initial parameters 66 66 filebase=''; % root file name ('filebase'.civ) 67 %nom_type=[]; % nomenclature type68 67 ext=[]; 69 68 testall=0; 70 69 browse=[]; 71 70 %default input parameters: 71 num1=1; % set of field i numbers 72 num2=2; % set of field i numbers 73 num_a=1; % set of field j numbers (fields a) 74 num_b=1; % second set of field j numbers (fields b) 75 subdir='A'; % subdir for the netcdf result files 76 ind_opening=1; % proposed operation number (1=civ1,2=fix1,3=patch1,4=civ2,5=fix2,6=patch2) 72 77 %load the initial parameters if the interface is started from uvmat 73 if ~isempty(varargin)% the interface is opened from uvmat 74 varcell=varargin{1}; 75 filebase=varcell{1}; 76 nom_type_read=varcell{2}; 77 num1=varcell{3}; 78 num2=varcell{4}; 79 num_a=varcell{5}; 80 num_b=varcell{6}; 81 subdir=varcell{7}; 82 ind_opening=varcell{8}; 83 ext=varcell{11}; 84 else 85 num1=1; % set of field i numbers 86 num2=2; % set of field i numbers 87 num_a=1; % set of field j numbers (fields a) 88 num_b=1; % second set of field j numbers (fields b) 89 subdir='A'; % subdir for the netcdf result files 90 ind_opening=1; % proposed operation number (1=civ1,2=fix1,3=patch1,4=civ2,5=fix2,6=patch2) 91 end 92 93 if exist('ext','var') && length(ext)>1 && (~isempty(imformats(ext(2:end)))||... 94 isequal(lower(ext),'.avi'));%if an image file has been opened by uvmat 95 set(handles.ext_ima,'String',ext) 78 if exist('param','var')&&isstruct(param)% the interface is opened from uvmat 79 filebase=param.RootName; 80 nom_type_read=param.NomType; 81 num1=param.num1; 82 num2=param.num2; 83 num_a=param.num_a; 84 num_b=param.num_b; 85 subdir=param.SubDir; 86 ind_opening=param.IndOpening; 87 ext=param.ImaExt; 88 end 89 if ~isempty(ext) && (~isempty(imformats(ext(2:end)))||... 90 strcmp(lower(ext),'.avi'));%if an image file has been opened by uvmat 91 set(handles.ImaExt,'String',ext) 96 92 if exist('nom_type_read','var') 97 93 browse.nom_type_ima=nom_type_read; % the image nomenclature is stored … … 102 98 end 103 99 end 104 set(handles. displ_filebase,'String',filebase);100 set(handles.RootName,'String',filebase); 105 101 set(handles.ImaDoc,'UserData',testall); 106 102 set(handles.ImaDoc,'String',ext) 107 103 108 104 %read names of the .exe file to adjust the interface according to 109 %available prog 110 %read names of the .exe file 105 %available binaries 111 106 path_uvmat=which('uvmat');% check the path detected for source file uvmat 112 107 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 113 108 errormsg=[];%default error message 114 if isunix115 syst='LINUX';116 else117 syst='WIN';118 end119 109 xmlfile=fullfile(path_UVMAT,'PARAM.xml'); 120 110 if exist(xmlfile,'file') … … 123 113 sparam=convert(t); 124 114 catch 125 errormsg={[' Problem for reading ' xmlfile]; lasterr};115 errormsg={[' Unable to read the file PARAM.xml defining the civx binaries:']; lasterr}; 126 116 end 127 117 else 128 118 errormsg=[xmlfile ' not found: path to civx binaries undefined']; 129 119 end 130 display(syst) 120 131 121 if ~isempty(errormsg) 132 122 msgbox_uvmat('ERROR',errormsg); 133 123 end 134 patch_newBin=''; 135 % todo_patch=''; 136 sge=0; 137 138 if isfield(sparam,'PatchNewBin') 139 patch_newBin=sparam.PatchNewBin; 140 end 141 142 if isfield(sparam,'SGE') 143 sge=str2double(sparam.SGE); 144 end 145 146 test_batch=sge;%default 147 if isfield(sparam,'Todo_path') 148 todo_path=sparam.Todo_path; 149 name_todo=fullfile(todo_path,'TODO.txt'); 150 if exist(name_todo,'file') 151 test_batch=1; 152 end 153 end 124 % patch_newBin=''; 125 test_batch=0;%default: ,no batch mode available 126 if isfield(sparam,'BatchParam') && isfield(sparam.BatchParam,'BatchMode') 127 test_batch=strcmp(sparam.BatchParam.BatchMode,'sge'); %sge is currently the only implemented batch mod 128 end 129 % if isfield(sparam,'PatchNewBin') 130 % patch_newBin=sparam.PatchNewBin; 131 % end 132 % if isfield(sparam,'SGE') 133 % sge=str2double(sparam.SGE); 134 % end 135 % test_batch=sge;%default 154 136 if test_batch==0 155 137 set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])% put the BATCH button in grey (unactivated) … … 228 210 set(handles.ref_i,'String',num2str(num_ref_i)); 229 211 set(handles.ref_j,'String',num2str(num_ref_j)); 212 set(handles.ref_i_civ2,'String',num2str(num_ref_i)); 213 set(handles.ref_j_civ2,'String',num2str(num_ref_j)); 230 214 set(handles.browse_root,'UserData',browse); 231 if ~isempty(varargin)%the interface is opened from uvmat232 displ_filebase_Callback(hObject, eventdata, handles);215 if exist('param','var')%varargin the interface is opened from uvmat 216 RootName_Callback(hObject, eventdata, handles); 233 217 end 234 218 … … 254 238 %------------------------------------------------------------------------ 255 239 %get the input file properties 256 filebase=get(handles. displ_filebase,'String');240 filebase=get(handles.RootName,'String'); 257 241 oldfile=''; %default 258 242 if isempty(filebase)|| isequal(filebase,'')%loads the previously stored file name and set it as default in the file_input box … … 331 315 if length(ext)>1 && (~isempty(imformats(ext([2:end])))||... 332 316 isequal(ext,'.avi')||isequal(ext,'.AVI'));%if an image file has been opened by uvmat 333 set(handles. ext_ima,'String',ext)317 set(handles.ImaExt,'String',ext) 334 318 browse.nom_type_ima=nom_type; 335 319 browse.field_count=num_i1; 336 320 % A=imread(fileinput); 337 321 % npxy=size(A); 338 % set(handles. ext_ima,'UserData',npxy)322 % set(handles.ImaExt,'UserData',npxy) 339 323 end 340 324 set(handles.ImaDoc,'String',ext); … … 368 352 browse.ind_opening=ind_opening; 369 353 end 370 set(handles. displ_filebase,'String',filebase);354 set(handles.RootName,'String',filebase); 371 355 set(handles.ImaDoc,'String',ext); 372 356 if ~isempty(num_i1) … … 379 363 set(handles.first_i,'String',num2str(ref_i)); 380 364 set(handles.last_i,'String',num2str(ref_i)); 381 set(handles.ref_i,'String',num2str(ref_i)); 365 set(handles.ref_i,'String',num2str(ref_i)); 366 set(handles.ref_i_civ2,'String',num2str(ref_i)) 382 367 end 383 368 if isempty(num_j1) 384 369 set(handles.ref_j,'String','1'); 370 set(handles.ref_j_civ2,'String','1'); 385 371 else 386 372 ref_j=num_j1; … … 392 378 set(handles.last_j,'String',num2str(ref_j)); 393 379 set(handles.ref_j,'String',num2str(ref_j)); 380 set(handles.ref_j_civ2,'String',num2str(ref_j)); 394 381 end 395 382 … … 439 426 set(handles.ImaDoc,'UserData',testall); 440 427 441 displ_filebase_Callback(hObject, eventdata, handles);428 RootName_Callback(hObject, eventdata, handles); 442 429 443 430 %------------------------------------------------------------------------ 444 431 function ImaDoc_Callback(hObject, eventdata, handles) 445 432 %------------------------------------------------------------------------ 446 displ_filebase_Callback(hObject, eventdata, handles)433 RootName_Callback(hObject, eventdata, handles) 447 434 448 435 %------------------------------------------------------------------------ 449 436 % --- function activated when a new filebase (image series) is introduced 450 function displ_filebase_Callback(hObject, eventdata, handles)437 function RootName_Callback(hObject, eventdata, handles) 451 438 %------------------------------------------------------------------------ 452 439 global test_batch 453 440 set(handles.compare,'Visible','on') 454 ext_ima=get(handles. ext_ima,'String');441 ext_ima=get(handles.ImaExt,'String'); 455 442 nom_type_ima=[];%default 456 443 field_count=1;%default 457 444 nom_type_nc=[]; 458 445 time=[]; 459 TimeUnit= []; %default460 CoordUnit= [];%default446 TimeUnit='frame'; %default 447 CoordUnit='px';%default 461 448 pxcmx_search=[];%default 462 449 pxcmy_search=[];%default 463 filebase=get(handles. displ_filebase,'String');450 filebase=get(handles.RootName,'String'); 464 451 465 452 ext=get(handles.ImaDoc,'String'); … … 530 517 set(handles.ref_i,'Visible','On')%use a reference index 531 518 set(handles.ref_j,'Visible','On') 532 set(handles.dt,'Visible','Off')533 set(handles.dt_text,'String','')519 % set(handles.dt,'Visible','Off') 520 % set(handles.root_txt,'String','') 534 521 elseif isequal(ext,'.avi') || isequal(ext,'.AVI') 535 522 set(handles.ref_j,'Visible','Off') 536 set(handles.dt,'Visible','Off')537 set(handles.dt_text,'String','ref. ind.')523 % set(handles.dt,'Visible','Off') 524 % set(handles.root_txt,'String','ref. ind.') 538 525 else 539 526 set(handles.ref_i,'Visible','Off') 540 527 set(handles.ref_j,'Visible','Off') 541 set(handles.dt,'Visible','On')542 set(handles.dt_text,'String','dt(ms)=')528 % set(handles.dt,'Visible','On') 529 % set(handles.root_txt,'String','dt(ms)=') 543 530 end 544 531 testima_xml=0; … … 550 537 end 551 538 elseif isequal(ext,'.xml') 552 [XmlData,warntext]=imadoc2struct([filebase '.xml']) ;539 [XmlData,warntext]=imadoc2struct([filebase '.xml']) 553 540 if isfield(XmlData,'Time') 554 541 time=XmlData.Time; … … 562 549 fullname=fullfile(fileparts(filebase),XmlData.Heading.ImageName); %full name (including path) of the first image defined by the xmle file, 563 550 if ~exist(fullname,'file') 564 % testima_xml=1;565 % else566 551 msgbox_uvmat('WARNING',['FirstImage ' fullname ' defined in the xml file does not exist']) 567 552 end 568 553 end 569 if isfield(XmlData,'Camera') 570 if isfield(XmlData.Camera,'TimeUnit') 571 TimeUnit=XmlData.Camera.TimeUnit; 572 end 573 if isfield(XmlData.Camera,'ImageSize') 574 ImageSize=XmlData.Camera.ImageSize; 575 if ~isempty(ImageSize)&& ~isempty(ImageSize) 576 xindex=findstr(ImageSize,'x'); 577 % if length(xindex)>=2 578 % npx=str2num(ImageSize(1:xindex(1)-1)); 579 % npy=str2num(ImageSize(xindex(1)+1:xindex(2)-1)); 580 % end 581 end 582 end 554 if isfield(XmlData,'TimeUnit') 555 TimeUnit=XmlData.TimeUnit; 556 end 557 if isfield(XmlData,'Npx') 558 npx=XmlData.Npx; 559 npy=XmlData.Npy; 583 560 end 584 561 pxcmx_search=1; … … 610 587 elseif error==1, msgbox_uvmat('WARNING','inconsistent number of fields in the .civ file'); 611 588 end 612 % ext_ima='.png';589 % ImaExt='.png'; 613 590 nom_type_ima='png_old'; 614 591 elseif isequal(lower(ext),'.avi') … … 623 600 end 624 601 time=(dt*[0:nbfield-1])';%list of image times 625 set(handles.dt,'String',num2str(dt*1000));%store the time interval between successive images602 %set(handles.dt,'String',num2str(dt*1000));%store the time interval between successive images 626 603 end 627 604 if isempty(time) … … 689 666 first_i=max(field_i+1,1); 690 667 %determine the set of times and possible intervals for CIV 691 dt=(1/1000)*str2num(get(handles.dt,'String'));692 time= (dt*[0:nb_field-1])';668 % dt=(1/1000)*str2num(get(handles.dt,'String')); 669 time=[0:nb_field-1]';% time=file index -1 by default 693 670 set(handles.mode,'String',{'series(Di)'}) 694 671 end … … 703 680 nbfield=size(time,1); 704 681 nbfield2=size(time,2); 705 set(handles.displ_filebase,'UserData',time); %store the set of times 706 if isempty(TimeUnit) 707 set(handles.dt_unit,'String','dt in e-03'); 708 set(handles.TimeUnit,'String',''); 709 else 710 set(handles.dt_unit,'String',['dt in m' TimeUnit]); 711 set(handles.TimeUnit,'String',TimeUnit); 712 end 682 set(handles.RootName,'UserData',time); %store the set of times 683 set(handles.dt_unit,'String',['dt in m' TimeUnit]); 684 set(handles.dt_unit_civ2,'String',['dt in m' TimeUnit]); 685 set(handles.TimeUnit,'String',TimeUnit); 713 686 set(handles.nb_field,'String',num2str(nbfield)); 714 687 set(handles.nb_field2,'String',num2str(nbfield2)); 715 688 end 716 689 end 717 set(handles.CoordUnit,'String', [CoordUnit '/'])690 set(handles.CoordUnit,'String',CoordUnit) 718 691 set(handles.calcul_search,'UserData',[pxcmx_search pxcmy_search]); 719 692 % npxy=[npy npx]; 720 set(handles. ext_ima,'String',ext_ima)693 set(handles.ImaExt,'String',ext_ima) 721 694 set(handles.first_i,'String',num2str(first_i)); 722 695 set(handles.last_i,'String',num2str(last_i));% … … 824 797 ref_i=str2num(get(handles.ref_i,'String')); 825 798 % last_i=str2num(get(handles.last_i,'String')); 826 time=get(handles. displ_filebase,'UserData'); %get the set of times799 time=get(handles.RootName,'UserData'); %get the set of times 827 800 siztime=size(time); 828 801 nbfield=siztime(1); … … 967 940 set(gcf,'Pointer','watch') 968 941 %nomenclature types 969 filebase=get(handles. displ_filebase,'String');942 filebase=get(handles.RootName,'String'); 970 943 [filepath,Nme,ext_dir]=fileparts(filebase); 971 944 browse=get(handles.browse_root,'UserData'); … … 1014 987 ref_j=str2double(get(handles.ref_j,'String')); 1015 988 end 1016 time=get(handles. displ_filebase,'UserData');%get the set of times989 time=get(handles.RootName,'UserData');%get the set of times 1017 990 if isempty(time) 1018 991 time=[0 1]; 1019 992 end 1020 dt_unit=str2double(get(handles.dt,'String'));% used when there is no image documentation file 993 %dt_unit=str2double(get(handles.dt,'String'));% used when there is no image documentation file 994 dt_unit=1000;%default 1021 995 displ_num=get(handles.list_pair_civ1,'UserData'); 1022 996 … … 1074 1048 if testpair 1075 1049 displ_pair{1}=['Di= ' num2str(-floor(browse.incr_pair(1)/2)) '|' num2str(ceil(browse.incr_pair(1)/2))]; 1076 elseif ~isequal(get(handles.dt_text,'String'),'dt(ms)=')1077 for ipair=1:nbpair1078 if select(ipair)1079 if size(time,1)>=ref_i+displ_num(4,ipair) && size(time,2)>=ref_j+displ_num(2,ipair)1080 dt=time(ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair))-time(ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair));%time interval dt1081 displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ' :dt= ' num2str(dt*1000)];1082 end1083 else1084 displ_pair{ipair}='...'; %pair not displayed in the menu1085 end1086 end1050 % elseif ~isequal(get(handles.root_txt,'String'),'dt(ms)=') 1051 % for ipair=1:nbpair 1052 % if select(ipair) 1053 % if size(time,1)>=ref_i+displ_num(4,ipair) && size(time,2)>=ref_j+displ_num(2,ipair) 1054 % dt=time(ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair))-time(ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair));%time interval dt 1055 % displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ' :dt= ' num2str(dt*1000)]; 1056 % end 1057 % else 1058 % displ_pair{ipair}='...'; %pair not displayed in the menu 1059 % end 1060 % end 1087 1061 else 1088 1062 for ipair=1:nbpair … … 1154 1128 set(gcf,'Pointer','watch') 1155 1129 %nomenclature types 1156 filebase=get(handles. displ_filebase,'String');1130 filebase=get(handles.RootName,'String'); 1157 1131 [filepath,Nme,ext_dir]=fileparts(filebase); 1158 1132 browse=get(handles.browse_root,'UserData'); … … 1205 1179 % return 1206 1180 % end 1207 ref_i=str2num(get(handles.ref_i ,'String'));1181 ref_i=str2num(get(handles.ref_i_civ2,'String')); 1208 1182 if isequal(mode,'pair j1-j2')%|isequal(mode,'st_pair j1-j2') 1209 1183 ref_j=0; 1210 1184 else 1211 ref_j=str2num(get(handles.ref_j,'String')); 1212 end 1213 % if isequal(get(handles.dt_text,'String'),'dt(ms)=')%simple series(Di) with equal interval 1214 % ref_i=ceil((first_i+last_i)/2); 1215 % ref_j=1; 1216 % end 1217 % ref_i=browse.num_ref;%field number initially selected by the browser 1218 time=get(handles.displ_filebase,'UserData'); %get the set of times 1185 ref_j=str2num(get(handles.ref_j_civ2,'String')); 1186 end 1187 time=get(handles.RootName,'UserData'); %get the set of times 1219 1188 if isempty(time) 1220 1189 time=[0 1];%default 1221 1190 end 1222 dt_unit=str2num(get(handles.dt,'String'));% used when there is no image documentation file 1191 %dt_unit=str2num(get(handles.dt,'String'));% used when there is no image documentation file 1192 dt_unit=1000; 1223 1193 displ_num=get(handles.list_pair_civ1,'UserData'); 1224 1194 … … 1274 1244 end 1275 1245 if isequal(mode,'series(Di)') % | isequal(mode,'st_series(Di)') 1276 % if ~isequal(get(handles.dt_text,'String'),'dt(ms)=')1277 1246 for ipair=1:nbpair 1278 1247 if select(ipair) … … 1585 1554 % 1586 1555 % %root name 1587 % filebase=get(handles. displ_filebase,'String');1556 % filebase=get(handles.RootName,'String'); 1588 1557 % if isempty(filebase)||isequal(filebase,'') 1589 1558 % msgbox_uvmat('ERROR','no input files') … … 1696 1665 % %RUN FIX1 1697 1666 % if box_test(2)==1 1698 % filebase=get(handles. displ_filebase,'String');1667 % filebase=get(handles.RootName,'String'); 1699 1668 % %names of the civ1 fields 1700 1669 % field1.vel_type='civ1'; … … 1726 1695 % maskname=maskdispl; 1727 1696 % else 1728 % maskbase=[get(handles. displ_filebase,'String') '_' maskdispl]; % mask root name1697 % maskbase=[get(handles.RootName,'String') '_' maskdispl]; % mask root name 1729 1698 % end 1730 1699 % end … … 1757 1726 % maskflag=0; 1758 1727 % else 1759 % maskbase=[get(handles. displ_filebase2,'String') '_' maskdispl]; % mask root name1728 % maskbase=[get(handles.RootName2,'String') '_' maskdispl]; % mask root name 1760 1729 % nbslice_mask=str2num(maskdispl(1:end-4)); % 1761 1730 % num1_mask=mod(num1_civ1(ifile)-1,nbslice_mask)+1; … … 1882 1851 % maskname=maskdispl; 1883 1852 % else 1884 % maskbase=[get(handles. displ_filebase,'String') '_' maskdispl]; % mask root name1853 % maskbase=[get(handles.RootName,'String') '_' maskdispl]; % mask root name 1885 1854 % end 1886 1855 % end … … 1916 1885 % maskflag=0; 1917 1886 % else 1918 % maskbase=[get(handles. displ_filebase2,'String') '_' maskdispl]; % mask root name1887 % maskbase=[get(handles.RootName2,'String') '_' maskdispl]; % mask root name 1919 1888 % nbslice_mask=str2num(maskdispl(1:end-4)); % 1920 1889 % num1_mask=mod(num1_civ2(ifile)-1,nbslice_mask)+1; … … 2077 2046 2078 2047 %root name 2079 filebase=get(handles. displ_filebase,'String');2048 filebase=get(handles.RootName,'String'); 2080 2049 if isempty(filebase)||isequal(filebase,'') 2081 2050 msgbox_uvmat('ERROR','no input files') … … 2198 2167 rankend=min(find(double(wwrest)==10))-1; 2199 2168 filebase=[wwrest(1:rankend) filebase(3:end)]; 2200 set(handles. displ_filebase,'String',filebase);2169 set(handles.RootName,'String',filebase); 2201 2170 end 2202 2171 else … … 2375 2344 % for ifile=1:nbfield 2376 2345 p1text=[];%initiate command text 2377 time=get(handles. displ_filebase,'UserData'); %get the set of times2346 time=get(handles.RootName,'UserData'); %get the set of times 2378 2347 civAll=get(handles.Experimental,'Value'); % Boolean for new civ excution method 2379 2348 for ifile=1:nbfield … … 2824 2793 %------------------------------------------------------------------------ 2825 2794 %get the filename root, nomenclature and numbers 2826 filebase=get(handles. displ_filebase,'String');2795 filebase=get(handles.RootName,'String'); 2827 2796 browse=get(handles.browse_root,'UserData'); 2828 2797 compare_list=get(handles.compare,'String'); … … 2836 2805 mode=mode_list{mode_value}; 2837 2806 end 2838 time=get(handles. displ_filebase,'UserData'); %get the set of times2839 ext_ima=get(handles. ext_ima,'String');2807 time=get(handles.RootName,'UserData'); %get the set of times 2808 ext_ima=get(handles.ImaExt,'String'); 2840 2809 nom_type_nc=browse.nom_type_nc; 2841 2810 nom_type_ima2=browse.nom_type_ima; … … 2851 2820 [Path2,Name2]=fileparts(filebase_B); 2852 2821 Path1=Path2; 2853 Name1=get(handles. displ_filebase2,'String');% root name of the first field series for stereo2822 Name1=get(handles.RootName_1,'String');% root name of the first field series for stereo 2854 2823 filebase_A=fullfile(Path1,Name1); 2855 2824 if length(Name1)>6 … … 3407 3376 end 3408 3377 end 3409 %npxy=get(handles. ext_ima,'UserData');3378 %npxy=get(handles.ImaExt,'UserData'); 3410 3379 % % if numel(npxy)<2 3411 3380 % 3412 % filename=name_generator(filebase_ima1,num1_civ1(1),num_a_civ1(1), ext_ima,nom_type_ima1);3381 % filename=name_generator(filebase_ima1,num1_civ1(1),num_a_civ1(1),ImaExt,nom_type_ima1); 3413 3382 % A=imread(filename); 3414 3383 % npxy=size(A); … … 3509 3478 npx=num2str(sizim(2)); 3510 3479 npy=num2str(sizim(1)); 3511 time=get(handles. displ_filebase,'UserData'); %get the set of times3480 time=get(handles.RootName,'UserData'); %get the set of times 3512 3481 gridname='';%default ='noFile use default' 3513 3482 gridflag='n';%default … … 3538 3507 end 3539 3508 %main loop 3540 filebase=get(handles. displ_filebase,'String');3509 filebase=get(handles.RootName,'String'); 3541 3510 sizcell=size(filecell); 3542 3511 nbfield=sizcell(1); … … 3708 3677 % npx=num2str(sizim(2)); 3709 3678 % npy=num2str(sizim(1)); 3710 % time=get(handles. displ_filebase,'UserData'); %get the set of times3711 % filebase=get(handles. displ_filebase,'String');3679 % time=get(handles.RootName,'UserData'); %get the set of times 3680 % filebase=get(handles.RootName,'String'); 3712 3681 % %grid 3713 3682 % gridname='';%default ='noFile use default' … … 3932 3901 % ref_i=ceil((first_i+last_i)/2); 3933 3902 set(handles.ref_i,'String', num2str(first_i))% reference index for pair dt = first index 3903 set(handles.ref_i_civ2,'String', num2str(first_i))% reference index for pair dt = first index 3934 3904 ref_i_Callback(hObject, eventdata, handles)%refresh dispaly of dt for pairs (in case of non constant dt) 3935 3905 … … 3949 3919 index=get(handles.list_pair_civ1,'Value'); 3950 3920 displ_num=get(handles.list_pair_civ1,'UserData'); 3951 time=get(handles. displ_filebase,'UserData'); %get the set of times3921 time=get(handles.RootName,'UserData'); %get the set of times 3952 3922 pxcm_xy=get(handles.calcul_search,'UserData'); 3953 3923 pxcmx=pxcm_xy(1); … … 4021 3991 else 4022 3992 mask_displ='no mask'; %default 4023 filebase=get(handles. displ_filebase,'String');3993 filebase=get(handles.RootName,'String'); 4024 3994 [ nbslice_mask, flag_mask]=get_mask(filebase,handles); 4025 3995 if isequal(flag_mask,1) … … 4027 3997 elseif get(handles.compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 4028 3998 common_path=fileparts(filebase); 4029 filebase_a=fullfile(common_path,get(handles. displ_filebase2,'String'));3999 filebase_a=fullfile(common_path,get(handles.RootName_1,'String')); 4030 4000 [nbslice_a, flag_mask_a]=get_mask(filebase_a,handles); 4031 4001 if isequal(flag_mask_a,0) || ~isequal(nbslice_a,nbslice_mask) … … 4068 4038 else 4069 4039 mask_displ='no mask'; %default 4070 filebase=get(handles. displ_filebase,'String');4040 filebase=get(handles.RootName,'String'); 4071 4041 [nbslice, flag_mask]=get_mask(filebase,handles); 4072 4042 if isequal(flag_mask,1) 4073 4043 mask_displ=[num2str(nbslice) 'mask']; 4074 4044 elseif get(handles.compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 4075 filebase_a=get(handles. displ_filebase2,'String');4045 filebase_a=get(handles.RootName_1,'String'); 4076 4046 [nbslice_a, flag_mask_a]=get_mask(filebase_a,handles); 4077 4047 if isequal(flag_mask_a,0) | ~isequal(nbslice_a,nbslice) … … 4112 4082 else 4113 4083 mask_displ='no mask'; %default 4114 filebase=get(handles. displ_filebase,'String');4084 filebase=get(handles.RootName,'String'); 4115 4085 [nbslice, flag_mask]=get_mask(filebase,handles); 4116 4086 if isequal(flag_mask,1) 4117 4087 mask_displ=[num2str(nbslice) 'mask']; 4118 4088 elseif get(handles.compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 4119 filebase_a=get(handles. displ_filebase2,'String');4089 filebase_a=get(handles.RootName_1,'String'); 4120 4090 [nbslice_a, flag_mask_a]=get_mask(filebase_a,handles); 4121 4091 if isequal(flag_mask_a,0) | ~isequal(nbslice_a,nbslice) … … 4153 4123 else 4154 4124 mask_displ='no mask'; %default 4155 filebase=get(handles. displ_filebase,'String');4125 filebase=get(handles.RootName,'String'); 4156 4126 [nbslice, flag_mask]=get_mask(filebase,handles); 4157 4127 if isequal(flag_mask,1) 4158 4128 mask_displ=[num2str(nbslice) 'mask']; 4159 4129 elseif get(handles.compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 4160 filebase_a=get(handles. displ_filebase2,'String');4130 filebase_a=get(handles.RootName_1,'String'); 4161 4131 [nbslice_a, flag_mask_a]=get_mask(filebase_a,handles); 4162 4132 if isequal(flag_mask_a,0) | ~isequal(nbslice_a,nbslice) … … 4325 4295 testgrid=0; 4326 4296 if value 4327 filebase=get(handles. displ_filebase,'String');4297 filebase=get(handles.RootName,'String'); 4328 4298 [nbslice, flag_grid]=get_grid(filebase,handles); 4329 4299 if isequal(flag_grid,1) … … 4375 4345 value=get(handles.browse_gridciv2,'Value'); 4376 4346 if value 4377 filebase=get(handles. displ_filebase,'String');4347 filebase=get(handles.RootName,'String'); 4378 4348 [nbslice, flag_grid]=get_grid(filebase,handles); 4379 4349 if isequal(flag_grid,1) … … 4412 4382 % function browse_gridciv2_Callback(hObject, eventdata, handles) 4413 4383 % 4414 % filebase=get(handles. displ_filebase,'String');4384 % filebase=get(handles.RootName,'String'); 4415 4385 % [FileName, PathName, filterindex] = uigetfile( ... 4416 4386 % {'*.grid', ' (*.grid)'; … … 4430 4400 % handles structure with handles and user data (see GUIDATA) 4431 4401 4432 filebase=get(handles. displ_filebase,'String');4402 filebase=get(handles.RootName,'String'); 4433 4403 [FileName, PathName, filterindex] = uigetfile( ... 4434 4404 {'*.grid', ' (*.grid)'; … … 4621 4591 set(handles.subdir_civ2,'Visible','off') 4622 4592 set(handles.subdir_civ2_text,'Visible','off') 4593 set(handles.dt_unit_civ2,'Visible','off') 4594 set(handles.ref_i_civ2,'Visible','off') 4595 set(handles.i_ref_civ2_title,'Visible','off') 4596 set(handles.j_ref_civ2_title,'Visible','off') 4597 set(handles.ref_j_civ2,'Visible','off') 4623 4598 end 4624 4599 else … … 4626 4601 set(handles.subdir_civ2,'Visible','on') 4627 4602 set(handles.subdir_civ2_text,'Visible','on') 4628 end 4603 set(handles.dt_unit_civ2,'Visible','on') 4604 set(handles.ref_i_civ2,'Visible','on') 4605 set(handles.i_ref_civ2_title,'Visible','on') 4606 set(handles.j_ref_civ2_title,'Visible','on') 4607 set(handles.ref_j_civ2,'Visible','on') 4608 end 4609 set(handles.rho_civ2_title,'Visible',state) 4629 4610 4630 4611 %------------------------------------------------------------------------ … … 4725 4706 set(handles.list_pair_civ1,'Visible',state) 4726 4707 set(handles.PAIR_txt,'Visible',state) 4727 %set(handles.dt_display_txt,'Visible',state) 4728 set(handles.dt_unit,'Visible',state) 4708 %set(handles.dt_unit,'Visible',state) 4729 4709 set(handles.PAIR_frame,'Visible',state) 4730 4710 … … 4789 4769 par.npx=num2str(sizim(2)); 4790 4770 par.npy=num2str(sizim(1)); 4791 time=get(handles. displ_filebase,'UserData'); %get the set of times4771 time=get(handles.RootName,'UserData'); %get the set of times 4792 4772 par.gridname=get(handles.grid_civ1,'String'); 4793 4773 par.gridflag='y'; … … 4829 4809 par.npx=num2str(sizim(2)); 4830 4810 par.npy=num2str(sizim(1)); 4831 time=get(handles. displ_filebase,'UserData'); %get the set of times4811 time=get(handles.RootName,'UserData'); %get the set of times 4832 4812 par.gridname=get(handles.grid_civ2,'String'); 4833 4813 par.gridflag='y'; … … 5130 5110 5131 5111 %------------------------------------------------------------------------ 5112 function ref_i_civ2_Callback(hObject, eventdata, handles) 5113 %------------------------------------------------------------------------ 5114 mode_list=get(handles.mode,'String'); 5115 mode_value=get(handles.mode,'Value'); 5116 mode=mode_list{mode_value}; 5117 find_netcpair_civ2(hObject, eventdata, handles);% update the menu of pairs depending on the available netcdf files 5118 5119 %------------------------------------------------------------------------ 5120 function ref_j_civ2_Callback(hObject, eventdata, handles) 5121 %------------------------------------------------------------------------ 5122 mode_list=get(handles.mode,'String'); 5123 mode_value=get(handles.mode,'Value'); 5124 mode=mode_list{mode_value}; 5125 if isequal(mode,'series(Dj)') 5126 find_netcpair_civ2(hObject, eventdata, handles);% update the menu of pairs depending on the available netcdf files 5127 end 5128 5129 %------------------------------------------------------------------------ 5132 5130 % --- Executes on button press in compare. 5133 5131 function compare_Callback(hObject, eventdata, handles) … … 5135 5133 test=get(handles.compare,'Value'); 5136 5134 if test==2 || test==3 5137 filebase=get(handles. displ_filebase,'String');5135 filebase=get(handles.RootName,'String'); 5138 5136 browse=get(handles.browse_root,'Userdata'); 5139 5137 browse.nom_type_ima1=browse.nom_type_ima; 5140 5138 set(handles.browse_root,'UserData',browse); 5141 5139 set(handles.sub_txt,'Visible','on') 5142 set(handles. displ_filebase2,'Visible','On');%mkes the second file input window visible5140 set(handles.RootName_1,'Visible','On');%mkes the second file input window visible 5143 5141 mode_store=get(handles.mode,'String');%get the present 'mode' 5144 5142 set(handles.compare,'UserData',mode_store);%store the mode display … … 5153 5151 ind_opening=1;%default 5154 5152 browse.incr_pair=[0 0]; %default 5155 oldfile=get(handles. displ_filebase,'String');5153 oldfile=get(handles.RootName,'String'); 5156 5154 menu={'*.xml;*.avi;*.AVI;*.nc','(*.xml,*.avi,*.nc)'; ... 5157 5155 '*.xml', '.xml files';'*.avi;*.AVI', '.avi files';'*.nc', '.nc files';... … … 5167 5165 return 5168 5166 end 5169 set(handles. displ_filebase2,'String',name);5167 set(handles.RootName_1,'String',name); 5170 5168 [RootPath,RootFile,field_count,str2,str_a,str_b,xx,nom_type,subdir]=name2display(name); 5171 5169 browse=get(handles.browse_root,'UserData'); … … 5174 5172 5175 5173 %check image extension 5176 if ~strcmp(ext,get(handles. ext_ima,'String'))5174 if ~strcmp(ext,get(handles.ImaExt,'String')) 5177 5175 msgbox_uvmat('ERROR','The two input image series must have the same extenion name') 5178 5176 return … … 5181 5179 %check image size 5182 5180 A=imread(fileinput); 5183 npxy=get(handles. ext_ima,'UserData');5181 npxy=get(handles.ImaExt,'UserData'); 5184 5182 if ~isequal(npxy(1),size(A,1))|| ~isequal(npxy(2),size(A,2)) 5185 5183 msgbox_uvmat('ERROR','The two input image series must have the same size') … … 5188 5186 else 5189 5187 set(handles.mode,'Visible','on') 5190 set(handles. displ_filebase2,'Visible','Off');5188 set(handles.RootName_1,'Visible','Off'); 5191 5189 set(handles.sub_txt,'Visible','off') 5192 set(handles. displ_filebase2,'String',[]);5190 set(handles.RootName_1,'String',[]); 5193 5191 mode_store=get(handles.compare,'UserData'); 5194 5192 set(handles.mode,'String',mode_store) … … 5202 5200 function get_ref_fix1_Callback(hObject, eventdata, handles) 5203 5201 %------------------------------------------------------------------------ 5204 filebase=get(handles. displ_filebase,'String');5202 filebase=get(handles.RootName,'String'); 5205 5203 [FileName, PathName, filterindex] = uigetfile( ... 5206 5204 {'*.nc', ' (*.nc)'; … … 5247 5245 %------------------------------------------------------------------------ 5248 5246 if isequal(get(handles.get_ref_fix2,'Value'),1) 5249 filebase=get(handles. displ_filebase,'String');5247 filebase=get(handles.RootName,'String'); 5250 5248 [FileName, PathName, filterindex] = uigetfile( ... 5251 5249 {'*.nc', ' (*.nc)'; … … 5369 5367 end 5370 5368 5369 5370 5371
Note: See TracChangeset
for help on using the changeset viewer.