- Timestamp:
- Dec 19, 2011, 10:12:56 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r336 r339 183 183 end 184 184 end 185 [RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput); 185 %[RootPath,RootFile,str1,str2,str_a,str_b,FileExt,NomType,subdir]=name2display(fileinput); 186 [~,~,~,i1,i2,j1,j2,FileExt,NomType]=fileparts_uvmat(fileinput); 186 187 % filebase=fullfile(RootPath,RootFile); 187 num_i1=str2double(str1); 188 if isnan(num_i1),num_i1=1;end 189 num_i2=str2double(str2); 190 if isnan(num_i2),num_i2=num_i1;end 191 num_j1=stra2num(str_a); 192 if isnan(num_j1),num_j1=1;end 193 num_j2=stra2num(str_b); 194 if isnan(num_j2),num_j2=num_j1;end 188 if isempty(i1),i1=1;end 189 if isempty(i2),i2=i1;end 190 if isempty(j1),j1=1;end 191 if isempty(j2),j2=j1;end 195 192 if isequal(get(handles.ListCompareMode,'Value'),1) 196 193 browse=[];%initialisation … … 198 195 browse=get(handles.RootName,'UserData'); 199 196 end 200 browse.num_i1= num_i1;201 browse.num_i2= num_i2;202 browse.num_j1= num_j1;203 browse.num_j2= num_j2;204 if length( ext)>1 && (~isempty(imformats(ext(2:end)))||strcmpi(ext,'.avi'));%if an image file has been opened by uvmat205 browse.nom_type_ima= nom_type;206 browse.ext_ima= ext;207 set(handles.ImaExt,'String', ext)208 end 209 set(handles.ImaDoc,'String', ext);197 browse.num_i1=i1; 198 browse.num_i2=i2; 199 browse.num_j1=j1; 200 browse.num_j2=j2; 201 if length(FileExt)>1 && (~isempty(imformats(FileExt(2:end)))||strcmpi(FileExt,'.avi'));%if an image file has been opened by uvmat 202 browse.nom_type_ima=NomType; 203 browse.ext_ima=FileExt; 204 set(handles.ImaExt,'String',FileExt) 205 end 206 set(handles.ImaDoc,'String',FileExt); 210 207 211 208 set(handles.RootName,'UserData',browse);% store information from browser … … 335 332 nom_type_ima='';%default 336 333 nom_type_nc=''; 337 [RootPath,FileName,i1_str,i2_str,j1_str,j2_str,ext_input,nom_type_input,subdir]=name2display(fileinput); 338 RootName=fullfile(RootPath,FileName); 334 [RootPath,RootFile,i1_str,i2_str,j1_str,j2_str,ext_input,nom_type_input,subdir]=name2display(fileinput); 335 %[RootPath,subdir,RootFile,i1,i2,j1,j2,ext_input,nom_type_input]=fileparts_uvmat(fileinput);TODO: use to replace name2display 336 RootName=fullfile(RootPath,RootFile); 339 337 set(handles.RootName,'String',RootName) 340 338 set(handles.RootName,'BackgroundColor',[1 1 0])%paint RootName edit box in yellow to indicate that the file input is proceeding -
trunk/src/fileparts_uvmat.m
r334 r339 38 38 NomType=''; 39 39 40 41 42 40 %% display help and test function in the absence of input arument 43 41 if ~exist('FileInput','var') … … 47 45 end 48 46 47 %% default root name output 49 48 [RootPath,FileName,FileExt]=fileparts(FileInput); 50 RootFile=FileName;%default 51 % switch FileExt 52 % case '.avi' 53 % NomType='*'; 54 % return 55 % case {'.tif','.tiff'} 56 % if exist(FileInput,'file') 57 % info=iminfo(FileInput); 58 % if length(info)>1 59 % NomType='*'; 60 % return 61 % end 62 % end 63 % end 64 65 % \D not a digit 66 % \d digit 67 68 69 %% recursive test on FileName starting from the end 70 % case of pure number 49 RootFile=FileName; 50 51 %% case of input file name which is a pure number 71 52 if ~isnan(str2double(FileName)) 72 53 RootFile=''; … … 74 55 return 75 56 end 57 58 %% recursive test on FileName starting from the end 76 59 % test whether FileName ends with a number or not 77 60 r=regexp(FileName,'.*\D(?<num1>\d+)$','names');% \D = not a digit, \d =digit … … 141 124 i1=str2double(r.num1); 142 125 NomType=[get_type(r.num1) NomType]; 143 r=regexp(RootPath,'\<(?<newrootpath>.+)(\\|/)(?<subdir>[^\\^/]+)(\\|/)*\>','names');144 if ~isempty(r)145 SubDir=r.subdir;146 RootPath=r.newrootpath;147 end148 126 end 149 127 end … … 153 131 RootFile(end)=[]; 154 132 NomType=['_' NomType]; 133 end 134 135 %% extract subdirectory for pairs i1-i2 or j1-j2 (or ab, AB) 136 if ~isempty(i2) || ~isempty(j2) 137 r=regexp(RootPath,'\<(?<newrootpath>.+)(\\|/)(?<subdir>[^\\^/]+)(\\|/)*\>','names'); 138 if ~isempty(r) 139 SubDir=r.subdir; 140 RootPath=r.newrootpath; 141 end 155 142 end 156 143 … … 162 149 % end 163 150 % end 164 165 166 151 167 152 -
trunk/src/find_file_series.m
r334 r339 1 1 %'find_file_series': check the content onf an input field and find the corresponding file series 2 2 %-------------------------------------------------------------------------- 3 % function [ i1,i2,j1,j2,NomType,FileType,Object]=find_file_series(fileinput)3 % function [RootPath,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(fileinput) 4 4 % 5 5 % OUTPUT: 6 % i1,i2,j1,j2: set of i1 indices, respectively i2,j1,j2, of the detected files 6 % RootPath,RootFile: root path and root name detected in fileinput, possibly modified for movies (indexing is then done on image view, not file) 7 % i1_series(ref_i, ref_j,pair),i2_series,j1_series,j2_series: set of indices (i1,i2,j1,j2) sorted by ref index ref_i, ref_j, and pairindex in case of multiple pairs with the same ref 7 8 % NomType: nomenclature type corrected after checking the first file (problem of 0 before the number string) 8 9 % FileType: type of file, = … … 34 35 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 35 36 36 function [ i1,i2,j1,j2,NomType,FileType,Object]=find_file_series(fileinput)37 function [RootPath,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(fileinput) 37 38 %------------------------------------------------------------------------ 38 i1=[];%default39 i2=[];%default40 j1=[];%default41 j2=[];%default42 39 43 40 %% get input root name and nomenclature type 44 41 % [RootPath,RootFile,~,~,~,~,FileExt,NomType,SubDir]=name2display(fileinput); 45 [RootPath,SubDir,RootFile,~, ~,~,~,FileExt,NomType]=fileparts_uvmat(fileinput);42 [RootPath,SubDir,RootFile,~,i2_input,j1_input,j2_input,FileExt,NomType]=fileparts_uvmat(fileinput); 46 43 47 44 %% check for particular file types: images, movies, civ data 48 45 FileType=''; 49 46 Object=[]; 47 i1_series=zeros(1,1,1); 48 i2_series=zeros(1,1,1); 49 j1_series=zeros(1,1,1); 50 j2_series=zeros(1,1,1); 50 51 switch FileExt 51 52 % ancillary files, no field indexing … … 64 65 otherwise 65 66 if ~isempty(FileExt)&& ~isempty(imformats(FileExt(2:end))) 66 imainfo=imfinfo(fileinput); 67 FileType='image'; 68 if length(imainfo) >1 %case of image with multiple frames 69 NomType='*'; 70 FileType='multimage'; 71 i1=1; 72 i2=length(imainfo); 73 [RootPath,RootFile]=fileparts(fileinput); 67 try 68 imainfo=imfinfo(fileinput); 69 FileType='image'; 70 if length(imainfo) >1 %case of image with multiple frames 71 NomType='*'; 72 FileType='multimage'; 73 i1_series=1:length(imainfo); 74 [RootPath,RootFile]=fileparts(fileinput); 75 end 74 76 end 75 77 else … … 88 90 NomType='*'; 89 91 FileType='video'; 90 i1=1; 91 i2=get(Object,'NumberOfFrames'); 92 i1_series=[1:get(Object,'NumberOfFrames')]; 92 93 [RootPath,RootFile]=fileparts(fileinput); 93 94 end 94 95 end 95 96 end 97 98 %% get the list of existing files when relevant 96 99 if strcmp(NomType,'')||strcmp(NomType,'*') 100 if exist(fileinput,'file') 97 101 [RootPath,RootFile]=fileparts(fileinput);% case of constant name (no indexing) 98 %% get the list of existing files 102 else 103 RootPath=''; 104 RootFile=''; 105 end 99 106 else 100 107 if strcmp(SubDir,'') … … 113 120 end 114 121 dirpair=dir([filebasesub detect_string FileExt]); 115 for ifile=1:length(dirpair) 116 % [~,~,str_1,str_2,str_a,str_b]=name2display(dirpair(ifile).name); 117 dirpair(ifile).name 118 [~,~,~,i1_ifile,i2_ifile,j1_ifile,j2_ifile]=fileparts_uvmat(dirpair(ifile).name); 119 if isempty(i1_ifile) 120 i1(ifile)=1; 122 nbpair=numel(dirpair); 123 ref_i_list=zeros(1,nbpair); 124 ref_j_list=zeros(1,nbpair); 125 if nbpair==0% no detected file 126 RootPath=''; 127 RootFile=''; 128 end 129 for ifile=1:nbpair 130 [~,~,~,i1,i2,j1,j2]=fileparts_uvmat(dirpair(ifile).name); 131 % i1_series(ifile)=i1; 132 ref_i=i1; 133 if isempty(i2_input) 134 if ~isempty(i2)% invalid file name if i2 does not exist in the input file 135 break 136 end 121 137 else 122 i1(ifile)=i1_ifile; 123 end 124 if isempty(i2_ifile) 125 i2(ifile)=i1(ifile); 138 ref_i=floor((i1+i2)/2); 139 end 140 ref_j=1; 141 if isempty(j1_input) 142 if ~isempty(j1)% invalid file name if j1 does not exist in the input file 143 break 144 end 126 145 else 127 i2(ifile)=i2_ifile; 128 end 129 end 130 if isempty(j1_ifile) 131 j1(ifile)=1; 132 else 133 j1(ifile)=j1_ifile; 134 end 135 if isempty(j2_ifile) 136 j2(ifile)=j1(ifile); 137 else 138 j2(ifile)=j2_ifile; 139 end 140 end 141 % TODO : sort by reference index 142 % update the NomType from the minimal index detected (to deal with number strings beginning by 0) 143 [~,ifile]=min(i1); 144 %[~,~,~,~,~,~,~,NomType]=name2display(dirpair(ifile).name); 145 if ~isempty(i1) 146 [~,ifile]=min(i1); 146 ref_j=j1; 147 if isempty(j2_input) 148 if ~isempty(j2)% invalid file name if j2 does not exist in the input file 149 break 150 end 151 else 152 ref_j=floor((j1+j2)/2); 153 end 154 end 155 % update the detected index series 156 ref_i_list(ifile)=ref_i; 157 ref_j_list(ifile)=ref_j; 158 nb_pairs=0; 159 if ~isempty(i2_input)|| ~isempty(j2_input) %deals with pairs 160 if size(i1_series,1)>=ref_i && size(i1_series,2)>=ref_j 161 nb_pairs=numel(find(i1_series(ref_i,ref_j,:)~=0)); 162 end 163 end 164 i1_series(ref_i,ref_j,nb_pairs+1)=i1; 165 if ~isempty(i2_input) 166 i2_series(ref_i,ref_j,nb_pairs+1)=i2; 167 end 168 if ~isempty(j1_input) 169 j1_series(ref_i,ref_j,nb_pairs+1)=j1; 170 end 171 if ~isempty(j2_input) 172 j1_series(ref_i,ref_j,nb_pairs+1)=j1; 173 j2_series(ref_i,ref_j,nb_pairs+1)=j2; 174 end 175 end 176 % look for the numerical string of the first files to update the NomType (take into account the 0 before the number) 177 max_j=max(ref_j_list); 178 ref_ij=ref_i_list*max_j+ref_j_list; % ordered by index i, then by j for a given i. 179 [~,ifile]=min(ref_ij(ref_ij>0)); 147 180 [~,~,~,~,~,~,~,~,NomType]=fileparts_uvmat(dirpair(ifile).name); 148 end149 181 end 182 183 %% set to empty array the irrelevant index series 184 if isequal(i1_series,0), i1_series=[]; end 185 if isequal(i2_series,0), i2_series=[]; end 186 if isequal(j1_series,0), j1_series=[]; end 187 if isequal(j2_series,0), j2_series=[]; end 188 189 %% sort pairs by decreasing index differences in case of multiple pairs at the same reference index 190 if size(i2_series,3)>1 %pairs i1 -i2 191 diff_index=abs(i2_series-i1_series); 192 [~,ind_pair]=sort(diff_index,3,'descend'); 193 for ref_i=1:size(i1_series,1) 194 for ref_j=1:size(j1_series,2) 195 i1_series(ref_i,ref_j,:)=i1_series(ref_i,ref_j,ind_pair(ref_i,ref_j,:)); 196 i2_series(ref_i,ref_j,:)=i2_series(ref_i,ref_j,ind_pair(ref_i,ref_j,:)); 197 if ~isempty(j1_series) 198 j1_series(ref_i,ref_j,:)=j1_series(ref_i,ref_j,ind_pair(ref_i,ref_j,:)); 199 end 200 end 201 end 202 elseif size(j2_series,3)>1 %pairs j1 -j2 203 diff_index=abs(j2_series-j1_series); 204 [~,ind_pair]=sort(diff_index,3,'descend'); 205 for ref_i=1:size(i1_series,1) 206 for ref_j=1:size(j1_series,2) 207 i1_series(ref_i,ref_j,:)=i1_series(ref_i,ref_j,ind_pair(ref_i,ref_j,:)); 208 if ~isempty(i2_series) 209 i2_series(ref_i,ref_j,:)=i2_series(ref_i,ref_j,ind_pair(ref_i,ref_j,:)); 210 end 211 j1_series(ref_i,ref_j,:)=j1_series(ref_i,ref_j,ind_pair(ref_i,ref_j,:)); 212 j2_series(ref_i,ref_j,:)=j2_series(ref_i,ref_j,ind_pair(ref_i,ref_j,:)); 213 end 214 end 215 end 216 -
trunk/src/series.m
r332 r339 445 445 return 446 446 end 447 [RootPath,RootFile,i1,str2,str_a,str_b,FileExt,NomType,SubDir]=name2display(fileinput); 447 [RootPath,SubDir,RootFile,i1,i2,j1,j2,FileExt]=fileparts_uvmat(fileinput); 448 448 449 449 450 %% look for min and max indices existing in the file series and update NomType 450 [num_i1,num_i2,num_j1,num_j2,NomType,FileType,Object]=find_file_series(fileinput); 451 if strcmp(NomType,'*') 452 MinIndex_i=1; 453 MinIndex_j=1; 454 nb_field=num_i2; 455 nb_field2=1; 456 else 457 MinIndex_i=min(floor((min(num_i1)+min(num_i2))/2)); 458 MinIndex_j=min(floor((min(num_j1)+min(num_j2))/2)); 459 nb_field=max(floor((max(num_i1)+max(num_i2))/2)); 460 nb_field2=max(floor((max(num_j1)+max(num_j2))/2)); 461 end 462 if isnan(nb_field) 463 nb_field_str='?'; 464 nb_field_str2='?'; 465 else 466 MinIndex_i_str=num2str(MinIndex_i); 467 MinIndex_j_str=num2str(MinIndex_j); 468 nb_field_str=num2str(nb_field); 469 nb_field_str2=num2str(nb_field2); 451 [RootPath,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(fileinput); 452 MinIndex_i=min(i1_series(i1_series>0)); 453 if ~isempty(i2_series) 454 MaxIndex_i=max(i2_series(i2_series>0)); 455 else 456 MaxIndex_i=max(i1_series(i1_series>0)); 457 end 458 MinIndex_j=min(j1_series(j1_series>0)); 459 if ~isempty(j2_series) 460 MaxIndex_j=max(j2_series(j2_series>0)); 461 else 462 MaxIndex_j=max(j1_series(j1_series>0)); 470 463 end 471 464 if addtest% case of insertion of a new series (menu bar option Open_insert) 472 MinIndex_i_cell=[{ MinIndex_i_str} ;get(handles.MinIndex_i,'String')];473 MinIndex_j_cell=[{MinIndex_j_str} ;get(handles.MinIndex_j,'String')];474 nb_field_cell=[{nb_field_str} ;get(handles.nb_field,'String')];475 nb_field2_cell=[{n b_field_str2} ;get(handles.nb_field2,'String')];465 MinIndex_i_cell=[{num2str(MinIndex_i)} ;get(handles.num_MinIndex_i,'String')]; 466 nb_field_cell=[{num2str(MaxIndex_i)} ;get(handles.num_MaxIndex_i,'String')]; 467 MinIndex_j_cell=[{num2str(MinIndex_j)} ;get(handles.num_MinIndex_j,'String')]; 468 nb_field2_cell=[{num2str(MaxIndex_j)} ;get(handles.num_MaxIndex_j,'String')]; 476 469 else % refresh the list (menu bar option Open) 477 MinIndex_i_cell={MinIndex_i_str}; 478 MinIndex_j_cell={MinIndex_j_str}; 479 nb_field_cell={nb_field_str}; 480 nb_field2_cell={nb_field_str2}; 481 end 482 set(handles.MinIndex_i,'String',MinIndex_i_cell); 483 set(handles.MinIndex_j,'String',MinIndex_j_cell); 484 set(handles.nb_field,'String',nb_field_cell); 485 set(handles.nb_field2,'String',nb_field2_cell); 470 MinIndex_i_cell={num2str(MinIndex_i)}; 471 MinIndex_j_cell={num2str(MinIndex_j)}; 472 nb_field_cell={num2str(MaxIndex_i)}; 473 nb_field2_cell={num2str(MaxIndex_j)}; 474 end 475 set(handles.num_MinIndex_i,'String',MinIndex_i_cell); 476 set(handles.num_MinIndex_j,'String',MinIndex_j_cell); 477 set(handles.num_MaxIndex_i,'String',nb_field_cell); 478 set(handles.num_MaxIndex_j,'String',nb_field2_cell); 479 480 set(handles.waitbar_frame,'Units','pixels') 481 pos=get(handles.waitbar_frame,'Position'); 482 xima=0.5:pos(3)-0.5; 483 yima=0.5:pos(4)-0.5; 484 [XIma,YIma]=meshgrid(xima,yima); 485 nb_i=size(i1_series,1); 486 nb_j=size(i1_series,2); 487 ind_i=(0.5:nb_i-0.5)*pos(3)/nb_i; 488 ind_j=(0.5:nb_j-0.5)*pos(4)/nb_j; 489 [Ind_i,Ind_j]=meshgrid(ind_i,ind_j); 490 CData=zeros([size(XIma) 3]); 491 file_ima=double((i1_series(:,:,1)>0)'); 492 if size(file_ima,1)==1 493 file_ima=ones(pos(4),1)*file_ima; 494 end 495 CData(:,:,2)=interp2(Ind_i,Ind_j,file_ima,XIma,YIma,'nearest'); 496 set(handles.waitbar_frame,'CData',CData) 497 set(handles.waitbar_frame,'Units','normalized') 498 % CData(:,1:floor(advance_ratio*size(CData,2)),1:2)=1; 499 % set(hwaitbar,'CData',CData) 500 %update_waitbar(handles.waitbar_frame,[],0) 486 501 487 502 488 503 %% determine reference field indices 489 504 ref_i=1; %default ref_i is a reference frame index used to find existing pairs from PIV 490 if ~isempty( str2num(i1))491 ref_i= str2num(i1);492 if ~isempty( str2num(str2))493 ref_i=floor((ref_i+ str2num(str2))/2);% reference image number corresponding to the file494 SeriesData.browse_Di=str2num(str2)-str2num(i1);505 if ~isempty(i1) 506 ref_i=i1; 507 if ~isempty(i2) 508 ref_i=floor((ref_i+i2)/2);% reference image number corresponding to the file 509 % SeriesData.browse_Di=i2-i1; 495 510 end 496 511 end 497 512 set(handles.ref_i,'String',num2str(ref_i)); 498 set(handles. first_i,'String',num2str(ref_i));499 set(handles. last_i,'String',num2str(ref_i));513 set(handles.num_first_i,'String',num2str(ref_i)); 514 set(handles.num_last_i,'String',num2str(ref_i)); 500 515 ref_j=1; %default ref_j is a reference frame index used to find existing pairs from PIV 501 if ~isempty( str2num(str_a))502 ref_j= str2num(str_a);503 if ~isempty( str2num(str_b))504 ref_j=floor(( str2num(str_a)+str2num(str_b))/2);505 SeriesData.browse_Dj=str2num(str_b)-str2num(str_a);516 if ~isempty(j1) 517 ref_j=j1; 518 if ~isempty(j2) 519 ref_j=floor((j1+j2)/2); 520 % SeriesData.browse_Dj=j2-j1; 506 521 end 507 522 end 508 523 set(handles.ref_j,'String',num2str(ref_j)); 509 set(handles.first_j,'String',num2str(ref_j)) 510 set(handles.last_j,'String',num2str(ref_j)); 511 524 set(handles.num_first_j,'String',num2str(ref_j)) 525 set(handles.num_last_j,'String',num2str(ref_j)); 512 526 TimeUnit=''; %default 513 527 time=[];%default 514 GeometryCalib=[];%default515 nb_field=NaN;%default516 nb_field2=NaN;%default517 SeriesData.PathCampaign=get(handles.PathCampaign,'String');518 528 519 529 % read timing and total frame number from the current file (movie files) !! may be overrid by xml file … … 525 535 % info=aviinfo([FileBase FileExt]); 526 536 % time=(0:1/info.FramesPerSecond:(info.NumFrames-1)/info.FramesPerSecond)'; 527 % n b_field=info.NumFrames;528 % n b_field2=1;537 % num_MaxIndex_i=info.NumFrames; 538 % num_MaxIndex_j=1; 529 539 elseif ~isempty(imformats(FileExt(2:end))) 530 540 testima=1; … … 532 542 % imainfo=imfinfo([FileBase FileExt]); 533 543 % if length(imainfo) >1 %case of image with multiple frames 534 % n b_field=length(imainfo);535 % n b_field2=1;544 % num_MaxIndex_i=length(imainfo); 545 % num_MaxIndex_j=1; 536 546 % end 537 547 % end … … 539 549 testima=1; 540 550 end 541 542 551 543 552 %% fill the list of file series … … 548 557 set(handles.NomType,'Value',1) 549 558 set(handles.FileExt,'Value',1) 550 set(handles.nb_field,'Value',1) 551 set(handles.nb_field2,'Value',1) 552 % append the current file series to the list 559 set(handles.num_MaxIndex_i,'Value',1) 560 set(handles.num_MaxIndex_j,'Value',1) 561 562 % insert the current file series at the head of the list 553 563 if addtest 554 564 SeriesData=get(handles.series,'UserData'); 555 SeriesData.displ_num=[0 0 0 0;SeriesData.displ_num];565 % SeriesData.displ_num=[0 0 0 0;SeriesData.displ_num]; 556 566 SeriesData.CurrentInputFile_1=SeriesData.CurrentInputFile; 567 SeriesData.i1_series=[SeriesData.i1_series;{i1_series}]; 568 SeriesData.i2_series=[SeriesData.i2_series;{i2_series}]; 569 SeriesData.j1_series=[SeriesData.j1_series;{j1_series}]; 570 SeriesData.j2_series=[SeriesData.j2_series;{j2_series}]; 557 571 RootPathCell=[{RootPath}; get(handles.RootPath,'String')] ; 558 572 SubDirCell=[{SubDir}; get(handles.SubDir,'String')]; … … 562 576 FileTypeCell=[{FileType};SeriesData.FileType]; 563 577 set(handles.NomType,'String',[{};get(handles.NomType,'String')]) 578 564 579 % or re-initialise the list of input file series 565 580 else 566 581 SeriesData=[];%re-initialisation 567 SeriesData.displ_num=[0 0 0 0]; 582 % SeriesData.displ_num=[0 0 0 0]; 583 SeriesData.i1_series={i1_series}; 584 SeriesData.i2_series={i2_series}; 585 SeriesData.j1_series={j1_series}; 586 SeriesData.j2_series={j2_series}; 568 587 RootPathCell={RootPath}; 569 588 SubDirCell={SubDir}; … … 650 669 end 651 670 if testtransform && (testcivx || testima) 652 view_TRANSFORM(handles,'on') 653 else 654 view_TRANSFORM(handles,'off') 671 set(handles.FieldTransform,'Visible','on') 672 % view_TRANSFORM(handles,'on') 673 else 674 set(handles.FieldTransform,'Visible','off') 675 % view_TRANSFORM(handles,'off') 655 676 end 656 677 if ~isequal(FileExt,'.nc') && ~isequal(FileExt,'.cdf') && ~testima … … 701 722 end 702 723 703 704 705 724 %% display times 706 725 if addtest … … 720 739 NbSlice=1; 721 740 end 722 set(handles. NbSlice,'String',num2str(NbSlice))741 set(handles.num_NbSlice,'String',num2str(NbSlice)) 723 742 end 724 743 … … 743 762 set(handles.RootPath,'BackgroundColor',[1 1 1]) 744 763 % set(handles.PathCampaign,'String',SeriesData.PathCampaign) 745 last_j_Callback([], [], handles)746 last_i_Callback([], [], handles)764 num_last_j_Callback([], [], handles) 765 num_last_i_Callback([], [], handles) 747 766 748 767 %------------------------------------------------------------------------ … … 761 780 set(handles.NomType,'Value',Val) 762 781 set(handles.FileExt,'Value',Val) 763 set(handles.n b_field,'Value',Val)764 set(handles.n b_field2,'Value',Val)782 set(handles.num_MaxIndex_i,'Value',Val) 783 set(handles.num_MaxIndex_j,'Value',Val) 765 784 set(handles.time_first,'Value',Val) 766 785 set(handles.time_last,'Value',Val) … … 793 812 %function activated when a new filebase (image series) is introduced 794 813 %------------------------------------------------------------ 795 function n b_field_Callback(hObject, eventdata, handles)796 Val=get(handles.n b_field,'Value');814 function num_MaxIndex_i_Callback(hObject, eventdata, handles) 815 Val=get(handles.num_MaxIndex_i,'Value'); 797 816 synchronise_view(handles,Val) 798 817 … … 800 819 %function activated when a new filebase (image series) is introduced 801 820 %------------------------------------------------------------ 802 function n b_field2_Callback(hObject, eventdata, handles)803 Val=get(handles.n b_field2,'Value');821 function num_MaxIndex_j_Callback(hObject, eventdata, handles) 822 Val=get(handles.num_MaxIndex_j,'Value'); 804 823 synchronise_view(handles,Val) 805 824 … … 822 841 function NomType_Callback(hObject, eventdata, handles) 823 842 %------------------------------------------------------------------------ 843 824 844 SeriesData=get(handles.series,'UserData'); 825 845 if isfield(SeriesData,'NomType') … … 828 848 NomTypeCell={}; 829 849 end 830 nbfield2_cell=get(handles.n b_field2,'String');831 val=get(handles.n b_field2,'Value');850 nbfield2_cell=get(handles.num_MaxIndex_j,'String'); 851 val=get(handles.num_MaxIndex_j,'Value'); 832 852 if iscell(nbfield2_cell) 833 853 nbfield2=str2num(nbfield2_cell{val}); … … 835 855 nbfield2=str2num(nbfield2_cell); 836 856 end 837 nbfield_cell=get(handles.n b_field,'String');857 nbfield_cell=get(handles.num_MaxIndex_i,'String'); 838 858 if iscell(nbfield_cell) 839 859 nbfield=str2num(nbfield_cell{val}); … … 842 862 end 843 863 844 set(handles.mode,'Visible','off') % do not show index pairs by default845 set(handles. list_pair_civ,'Visible','off')846 set(handles.ref_i,'Visible','off')847 set(handles.ref_i_text,'Visible','off')864 % set(handles.mode,'Visible','off') % do not show index pairs by default 865 set(handles.Pairs,'Visible','off') 866 % set(handles.ref_i,'Visible','off') 867 % set(handles.ref_i_text,'Visible','off') 848 868 testpair=0; 849 state_j='off';850 869 %set the menus of image pairs and default selection for series 851 870 %list pairs if relevant 852 871 Val=get(handles.NomType,'Value'); 853 872 synchronise_view(handles,Val) 854 if ~isempty(NomTypeCell) 855 NomType=NomTypeCell{Val}; 856 switch NomType 857 case {'_1-2_1', '_1-2'} 858 set(handles.mode,'String',{'series(Di)'}) 859 set(handles.mode,'Value',1); 860 set(handles.mode,'Visible','on') 861 testpair=1; 862 case {'#_ab'} 863 set(handles.mode,'String',{'bursts'}) 864 set(handles.mode,'Value',1); 865 testpair=1; 866 case '_1_1-2' 867 set(handles.mode,'String',{'bursts';'series(Dj)'})%multiple choice 868 if ~isempty(nbfield) && ~isempty(nbfield2) && ((nbfield2>10) || (nbfield==1)) 869 set(handles.mode,'Value',2); 870 else 871 set(handles.mode,'Value',1);% advice 'bursts' for small bursts 872 end 873 set(handles.mode,'Visible','on') 874 testpair=1; 875 end 876 switch NomType 877 case {'_1_1','_1_1-2','_1-2_1','1_ab','01_ab'},% two navigation indices 878 state_j='on'; 879 end 880 end 873 if ~isfield(SeriesData,'j1_series')||isempty(SeriesData.j1_series{Val}) 874 state_j='off'; %no need for j index 875 else 876 state_j='on'; %case of j index 877 end 878 % show index pairs if files exist 879 if isfield(SeriesData,'j1_series')&&(~isempty(SeriesData.i2_series{Val})||~isempty(SeriesData.j2_series{Val})) 880 testpair=1; 881 if ~isempty(SeriesData.i2_series{Val}) %pairs with i index 882 set(handles.mode,'Value',1) 883 set(handles.mode,'String',{'series(Di)'}) 884 else %pairs with j index 885 set(handles.mode,'Value',1) 886 set(handles.mode,'String',{'bursts';'series(Dj)'}) 887 if nbfield2>10 || nbfield==1 888 set(handles.mode,'Value',2); 889 else 890 set(handles.mode,'Value',1); 891 end 892 end 893 set(handles.mode,'Visible','on') 894 else 895 set(handles.mode,'Visible','off') 896 end 897 % if ~isempty(NomTypeCell) 898 % NomType=NomTypeCell{Val}; 899 % switch NomType 900 % case {'_1-2_1', '_1-2'} 901 % set(handles.mode,'String',{'series(Di)'}) 902 % set(handles.mode,'Value',1); 903 % set(handles.mode,'Visible','on') 904 % testpair=1; 905 % case {'#_ab'} 906 % set(handles.mode,'String',{'bursts'}) 907 % set(handles.mode,'Value',1); 908 % testpair=1; 909 % case '_1_1-2' 910 % set(handles.mode,'String',{'bursts';'series(Dj)'})%multiple choice 911 % if ~isempty(nbfield) && ~isempty(nbfield2) && ((nbfield2>10) || (nbfield==1)) 912 % set(handles.mode,'Value',2); 913 % else 914 % set(handles.mode,'Value',1);% advice 'bursts' for small bursts 915 % end 916 % set(handles.mode,'Visible','on') 917 % testpair=1; 918 % end 919 % switch NomType 920 % case {'_1_1','_1_1-2','_1-2_1','1_ab','01_ab'},% two navigation indices 921 % state_j='on'; 922 % end 923 % end 881 924 if testpair 882 925 mode_Callback(hObject, eventdata, handles) … … 884 927 set(handles.NomType,'String',NomTypeCell) 885 928 set(handles.j_txt,'Visible',state_j) 886 set(handles. MinIndex_j,'Visible',state_j)887 set(handles. first_j,'Visible',state_j)888 set(handles. incr_j,'Visible',state_j)889 set(handles. last_j,'Visible',state_j)890 set(handles.n b_field2,'Visible',state_j)929 set(handles.num_MinIndex_j,'Visible',state_j) 930 set(handles.num_first_j,'Visible',state_j) 931 set(handles.num_incr_j,'Visible',state_j) 932 set(handles.num_last_j,'Visible',state_j) 933 set(handles.num_MaxIndex_j,'Visible',state_j) 891 934 end 892 935 … … 896 939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 897 940 function mode_Callback(hObject, eventdata, handles) 941 898 942 SeriesData=get(handles.series,'UserData'); 899 943 mode_list=get(handles.mode,'String'); … … 901 945 mode=mode_list{mode_value}; 902 946 NomType=[]; 903 test_find_pair=0;904 if isfield(SeriesData,'NomType')905 906 907 908 test_find_pair=isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')|| isequal(NomType,'_1-2')|| isequal(NomType,'#_ab');909 end 947 % test_find_pair=0; 948 % if isfield(SeriesData,'NomType') 949 NomTypeCell=SeriesData.NomType; 950 Val=get(handles.NomType,'Value'); 951 NomType=NomTypeCell{Val}; 952 check_pairs=~isempty(SeriesData.i2_series{Val})||~isempty(SeriesData.j2_series{Val}); 953 910 954 time=[]; 911 955 if isfield(SeriesData,'Time') 912 time=SeriesData.Time{1}; %get the set of times956 time=SeriesData.Time{1}; %get the set of times 913 957 end 914 958 siztime=size(time); 915 959 nbfield=siztime(1); 916 960 nbfield2=siztime(2); 917 indchosen=1; %%first pair selected by default961 % indchosen=1; %%first pair selected by default 918 962 if isequal(mode,'bursts') 919 963 enable_i(handles,'On') 920 964 enable_j(handles,'Off') %do not display j index scanning in burst mode (j is fixed by the burst choice) 921 elseif isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')965 elseif ~isempty(SeriesData.j2_series{Val}) 922 966 enable_i(handles,'On') 923 967 enable_j(handles,'On') % allow both i and j index scanning … … 926 970 enable_j(handles,'Off') 927 971 end 928 set(handles.list_pair_civ,'Value',indchosen);%set the default choice of image pairs for civ1972 % set(handles.list_pair_civ,'Value',indchosen);%set the default choice of image pairs for civ1 929 973 set(handles.series,'UserData',SeriesData) 930 974 931 975 %list pairs if relevant 932 if test_find_pair933 find_netcpair_civ(h Object, eventdata, handles,Val)976 if check_pairs 977 find_netcpair_civ(handles,Val) 934 978 end 935 979 … … 937 981 function enable_i(handles,state) 938 982 set(handles.i_txt,'Visible',state) 939 set(handles. first_i,'Visible',state)940 set(handles. last_i,'Visible',state)941 set(handles. incr_i,'Visible',state)942 set(handles.n b_field,'Visible',state)983 set(handles.num_first_i,'Visible',state) 984 set(handles.num_last_i,'Visible',state) 985 set(handles.num_incr_i,'Visible',state) 986 set(handles.num_MaxIndex_i,'Visible',state) 943 987 set(handles.ref_i,'Visible',state) 944 988 set(handles.ref_i_text,'Visible',state) … … 947 991 function enable_j(handles,state) 948 992 set(handles.j_txt,'Visible',state) 949 set(handles. MinIndex_j,'Visible',state)950 set(handles. first_j,'Visible',state)951 set(handles. last_j,'Visible',state)952 set(handles. incr_j,'Visible',state)953 set(handles.n b_field2,'Visible',state)993 set(handles.num_MinIndex_j,'Visible',state) 994 set(handles.num_first_j,'Visible',state) 995 set(handles.num_last_j,'Visible',state) 996 set(handles.num_incr_j,'Visible',state) 997 set(handles.num_MaxIndex_j,'Visible',state) 954 998 set(handles.ref_j,'Visible',state) 955 999 set(handles.ref_j_text,'Visible',state) … … 966 1010 set(handles.Field_text_1,'Visible',state) 967 1011 968 % -----------------------------------969 function view_TRANSFORM(handles,state)970 set(handles.TRANSFORM_frame,'Visible',state)971 set(handles.transform_fct,'Visible',state);972 set(handles.TRANSFORM_title,'Visible',state)1012 % %----------------------------------- 1013 % function view_TRANSFORM(handles,state) 1014 % set(handles.TRANSFORM_frame,'Visible',state) 1015 % set(handles.transform_fct,'Visible',state); 1016 % set(handles.TRANSFORM_title,'Visible',state) 973 1017 974 1018 %-------------------------------------------------------------- … … 976 1020 % with the reference indices ref_i and ref_j 977 1021 %---------------------------------------------------------------- 978 function find_netcpair_civ(h Object, eventdata, handles,Val)1022 function find_netcpair_civ(handles,Val) 979 1023 SeriesData=get(handles.series,'UserData'); 980 1024 % NomTypeCell=get(handles.NomType,'String'); 981 1025 NomTypeCell=SeriesData.NomType; 982 1026 NomType=NomTypeCell{Val}; 983 set(handles.list_pair_civ,'Visible','on') 1027 1028 set(handles.Pairs,'Visible','on')% makes the panel "Pairs' visible 984 1029 %nomenclature types 985 1030 RootPathCell=get(handles.RootPath,'String'); … … 1000 1045 1001 1046 %reads image numbers from the interface 1002 ref_i=str2num(get(handles.ref_i,'String'));1003 ref_j=str2num(get(handles.ref_j,'String'));1004 ref_time=0;1005 nbfield=50;1006 nbfield2=50;%default max number of pairs1047 % ref_i=str2num(get(handles.ref_i,'String')); 1048 % ref_j=str2num(get(handles.ref_j,'String')); 1049 % ref_time=0; 1050 % nbfield=50; 1051 % nbfield2=50;%default max number of pairs 1007 1052 1008 1053 %look for existing processed pairs involving the field at the middle of the series if civ1 will not 1009 1054 % be performed, while the result is needed for next steps. 1010 displ_pair={''}; 1011 displ_num=[]; 1012 ind_exist=0; 1055 1056 % ind_exist=0; 1013 1057 TimeUnit=get(handles.TimeUnit,'String'); 1014 1058 if length(TimeUnit)>=1 … … 1017 1061 dtunit='e-03'; 1018 1062 end 1063 1064 %% NEW 1065 i1_series=SeriesData.i1_series{Val}; 1066 i2_series=SeriesData.i2_series{Val}; 1067 j1_series=SeriesData.j1_series{Val}; 1068 j2_series=SeriesData.j2_series{Val}; 1069 displ_pair={}; 1019 1070 if strcmp(mode,'series(Di)') 1020 for index=1:min(nbfield-1,50) 1021 filename=name_generator(filebase,ref_i-floor(index/2),ref_j,'.nc',NomType,1,ref_i+ceil(index/2),ref_j,subdir); 1022 select=(exist(filename,'file')==2); 1023 if select==1 1024 ind_exist=ind_exist+1; 1025 displ_num(1,ind_exist)=0; 1026 displ_num(2,ind_exist)=0; 1027 displ_num(3,ind_exist)=-floor(index/2); 1028 displ_num(4,ind_exist)=ceil(index/2); 1029 %[cte_detect,vdt,cte_read]=read_netcdf(filename,{'dt','dt2','absolut_time_T0','absolute_time_TO_2'}); 1030 [Cte,var_detect,ichoice]=nc2struct(filename,{}); 1031 if isfield(Cte,'dt2') 1032 dt=Cte.dt2; 1033 elseif isfield(Cte,'dt') 1034 dt=Cte.dt; 1035 end 1036 if isfield(Cte,'absolut_time_TO_2') 1037 ref_time(ind_exist)=Cte.absolut_time_TO_2;%civ2 data used in priority 1038 elseif isfield(Cte,'absolut_time_TO') 1039 ref_time(ind_exist)=Cte.absolut_time_TO;%civ2 data used in priorit 1040 elseif isfield(Cte,'Time') 1041 ref_time(ind_exist)=Cte.Time; 1042 end 1043 displ_pair{ind_exist}=['Di= ' num2str(-floor(index/2)) '|' num2str(ceil(index/2)) ' :dt= ' num2str(dt*1000) dtunit]; 1044 end 1045 end 1046 set(handles.list_pair_civ,'String',[displ_pair';{'Di=*|*'}]); 1047 elseif isequal(mode,'series(Dj)')% series on the j index 1048 for index=1:min(nbfield2-1,50) 1049 filename=name_generator(filebase,ref_i,ref_j-floor(index/2),'.nc',NomType,1,ref_i,ref_j+ceil(index/2),subdir); 1050 select=(exist(filename,'file')==2); 1051 if select==1 1052 ind_exist=ind_exist+1; 1053 displ_num(1,ind_exist)=-floor(index/2); 1054 displ_num(2,ind_exist)=ceil(index/2); 1055 displ_num(3,ind_exist)=0; 1056 displ_num(4,ind_exist)=0; 1057 [Cte,var_detect,ichoice]=nc2struct(filename,{}); 1058 if isfield(Cte,'dt2') 1059 dt=Cte.dt2; 1060 elseif isfield(Cte,'dt') 1061 dt=Cte.dt; 1062 end 1063 if isfield(Cte,'absolut_time_TO_2') 1064 ref_time(ind_exist)=Cte.absolut_time_TO_2;%civ2 data used in priority 1065 elseif isfield(Cte,'absolut_time_TO') 1066 ref_time(ind_exist)=Cte.absolut_time_TO;%civ2 data used in priorit 1067 elseif isfield(Cte,'Time') 1068 ref_time(ind_exist)=Cte.Time; 1069 end 1070 % if cte_detect(2)==1; 1071 % dt=cte_read(2); 1072 % ref_time(ind_exist)=cte_read(4);%civ2 data used in priority 1071 if isempty(i2_series) 1072 msgbox_uvmat('ERROR','no i1-i2 pair available') 1073 return 1074 end 1075 diff_i=i2_series-i1_series; 1076 min_diff=min(diff_i(diff_i>0)); 1077 max_diff=max(diff_i(diff_i>0)); 1078 for ipair=min_diff:max_diff 1079 if numel(diff_i(diff_i==ipair))>0 1080 displ_pair=[displ_pair;{['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ]}]; 1081 end 1082 end 1083 if ~isempty(displ_pair) 1084 displ_pair=[displ_pair;{'Di=*|*'}]; 1085 end 1086 elseif strcmp(mode,'series(Dj)') 1087 if isempty(j2_series) 1088 msgbox_uvmat('ERROR','no j1-j2 pair available') 1089 return 1090 end 1091 diff_j=j2_series-j1_series; 1092 min_diff=min(diff_j(diff_j>0)); 1093 max_diff=max(diff_j(diff_j>0)); 1094 for ipair=min_diff:max_diff 1095 if numel(diff_j(diff_j==ipair))>0 1096 displ_pair=[displ_pair;{['Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ]}]; 1097 end 1098 end 1099 if ~isempty(displ_pair) 1100 displ_pair=[displ_pair;{'Dj=*|*'}]; 1101 end 1102 elseif strcmp(mode,'bursts') 1103 if isempty(j2_series) 1104 msgbox_uvmat('ERROR','no j1-j2 pair available') 1105 return 1106 end 1107 diff_j=j2_series-j1_series; 1108 min_j1=min(j1_series(j1_series>0)); 1109 max_j1=max(j1_series(j1_series>0)); 1110 min_j2=min(j2_series(j2_series>0)); 1111 max_j2=max(j2_series(j2_series>0)); 1112 for pair1=min_j1:min(max_j1,min_j1+20) 1113 for pair2=min_j2:min(max_j2,min_j2+20) 1114 if numel(j1_series(j1_series==pair1))>0 && numel(j2_series(j2_series==pair2))>0 1115 displ_pair=[displ_pair;{['j= ' num2str(pair1) '-' num2str(pair2)]}]; 1116 end 1117 end 1118 end 1119 if ~isempty(displ_pair) 1120 displ_pair=[displ_pair;{'j=*-*'}]; 1121 end 1122 end 1123 1124 %% display list of pairs 1125 displ_pair_list=get(handles.list_pair_civ,'String'); 1126 NewVal=[]; 1127 if ~isempty(displ_pair_list) 1128 Val=get(handles.list_pair_civ,'Value'); 1129 NewVal=find(strcmp(displ_pair_list{Val},displ_pair),1);% look at the previous display in the new menu displ_pâir 1130 end 1131 if ~isempty(NewVal) 1132 set(handles.list_pair_civ,'Value',NewVal) 1133 else 1134 set(handles.list_pair_civ,'Value',1) 1135 end 1136 set(handles.list_pair_civ,'String',displ_pair) 1137 displ_pair 1138 1139 % displ_pair{ind_exist}=['Di= ' num2str(-floor(index/2)) '|' num2str(ceil(index/2)) ' :dt= ' num2str(dt*1000) dtunit]; 1140 % if strcmp(mode,'series(Di)') 1141 % for index=1:min(nbfield-1,50) 1142 % filename=name_generator(filebase,ref_i-floor(index/2),ref_j,'.nc',NomType,1,ref_i+ceil(index/2),ref_j,subdir); 1143 % select=(exist(filename,'file')==2); 1144 % if select==1 1145 % ind_exist=ind_exist+1; 1146 % displ_num(1,ind_exist)=0; 1147 % displ_num(2,ind_exist)=0; 1148 % displ_num(3,ind_exist)=-floor(index/2); 1149 % displ_num(4,ind_exist)=ceil(index/2); 1150 % %[cte_detect,vdt,cte_read]=read_netcdf(filename,{'dt','dt2','absolut_time_T0','absolute_time_TO_2'}); 1151 % [Cte,var_detect,ichoice]=nc2struct(filename,{}); 1152 % if isfield(Cte,'dt2') 1153 % dt=Cte.dt2; 1154 % elseif isfield(Cte,'dt') 1155 % dt=Cte.dt; 1156 % end 1157 % if isfield(Cte,'absolut_time_TO_2') 1158 % ref_time(ind_exist)=Cte.absolut_time_TO_2;%civ2 data used in priority 1159 % elseif isfield(Cte,'absolut_time_TO') 1160 % ref_time(ind_exist)=Cte.absolut_time_TO;%civ2 data used in priorit 1161 % elseif isfield(Cte,'Time') 1162 % ref_time(ind_exist)=Cte.Time; 1163 % end 1164 % displ_pair{ind_exist}=['Di= ' num2str(-floor(index/2)) '|' num2str(ceil(index/2)) ' :dt= ' num2str(dt*1000) dtunit]; 1165 % end 1166 % end 1167 % set(handles.list_pair_civ,'String',[displ_pair';{'Di=*|*'}]); 1168 % elseif isequal(mode,'series(Dj)')% series on the j index 1169 % for index=1:min(nbfield2-1,50) 1170 % filename=name_generator(filebase,ref_i,ref_j-floor(index/2),'.nc',NomType,1,ref_i,ref_j+ceil(index/2),subdir); 1171 % select=(exist(filename,'file')==2); 1172 % if select==1 1173 % ind_exist=ind_exist+1; 1174 % displ_num(1,ind_exist)=-floor(index/2); 1175 % displ_num(2,ind_exist)=ceil(index/2); 1176 % displ_num(3,ind_exist)=0; 1177 % displ_num(4,ind_exist)=0; 1178 % [Cte,var_detect,ichoice]=nc2struct(filename,{}); 1179 % if isfield(Cte,'dt2') 1180 % dt=Cte.dt2; 1181 % elseif isfield(Cte,'dt') 1182 % dt=Cte.dt; 1183 % end 1184 % if isfield(Cte,'absolut_time_TO_2') 1185 % ref_time(ind_exist)=Cte.absolut_time_TO_2;%civ2 data used in priority 1186 % elseif isfield(Cte,'absolut_time_TO') 1187 % ref_time(ind_exist)=Cte.absolut_time_TO;%civ2 data used in priorit 1188 % elseif isfield(Cte,'Time') 1189 % ref_time(ind_exist)=Cte.Time; 1190 % end 1191 % displ_pair{ind_exist}=['Dj= ' num2str(-floor(index/2)) '|' num2str(ceil(index/2)) ' :dt= ' num2str(dt*1000) dtunit]; 1192 % end 1193 % end 1194 % set(handles.list_pair_civ,'String',[displ_pair';{'Dj=*|*'}]); 1195 % elseif isequal(mode,'bursts') %case of bursts 1196 % for numod_a=1:nbfield2-1 %nbfield2 always >=2 for 'bursts' mode 1197 % for numod_b=(numod_a+1):nbfield2 1198 % [filename]=name_generator(filebase,ref_i,numod_a,'.nc',NomType,1,ref_i,numod_b,subdir) 1199 % select=(exist(filename,'file')==2) 1200 % if select==1 1201 % ind_exist=ind_exist+1; 1202 % numlist_a(ind_exist)=numod_a; 1203 % numlist_b(ind_exist)=numod_b; 1204 % Attr=nc2struct(filename,[]); 1205 % isfield(Attr,'absolut_time_T0_2') 1206 % if isfield(Attr,'dt2') 1207 % dt(ind_exist)=Attr.dt2; 1208 % ref_time(ind_exist)=Attr.absolut_time_T0_2; 1209 % elseif isfield(Attr,'dt')& isfield(Attr,'absolut_time_T0') 1210 % dt(ind_exist)=Attr.dt; 1211 % ref_time(ind_exist)=Attr.absolut_time_T0; 1073 1212 % else 1074 % dt=cte_read(1); 1075 % ref_time(ind_exist)=cte_read(3); 1076 % end 1077 displ_pair{ind_exist}=['Dj= ' num2str(-floor(index/2)) '|' num2str(ceil(index/2)) ' :dt= ' num2str(dt*1000) dtunit]; 1078 end 1079 end 1080 set(handles.list_pair_civ,'String',[displ_pair';{'Dj=*|*'}]); 1081 elseif isequal(mode,'bursts') %case of bursts 1082 for numod_a=1:nbfield2-1 %nbfield2 always >=2 for 'bursts' mode 1083 for numod_b=(numod_a+1):nbfield2 1084 [filename]=name_generator(filebase,ref_i,numod_a,'.nc',NomType,1,ref_i,numod_b,subdir) 1085 select=(exist(filename,'file')==2) 1086 if select==1 1087 ind_exist=ind_exist+1; 1088 numlist_a(ind_exist)=numod_a; 1089 numlist_b(ind_exist)=numod_b; 1090 Attr=nc2struct(filename,[]); 1091 isfield(Attr,'absolut_time_T0_2') 1092 if isfield(Attr,'dt2') 1093 dt(ind_exist)=Attr.dt2; 1094 ref_time(ind_exist)=Attr.absolut_time_T0_2; 1095 elseif isfield(Attr,'dt')& isfield(Attr,'absolut_time_T0') 1096 dt(ind_exist)=Attr.dt; 1097 ref_time(ind_exist)=Attr.absolut_time_T0; 1098 else 1099 dt(ind_exist)=NaN;%no information on dt 1100 end 1101 %determine nom_type_ima for pair display (used in num2stra.m) 1102 switch NomType 1103 case {'#ab'} 1104 nom_type_ima='#a'; 1105 case {'#AB'} 1106 nom_type_ima='#A'; 1107 otherwise 1108 nom_type_ima='_1_1'; 1109 end 1110 displ_pair{ind_exist}=['j= ' num2stra(numod_a,nom_type_ima,2) '-' num2stra(numod_b,nom_type_ima,2) ... 1111 ' :dt= ' num2str(dt(ind_exist)*1000)]; 1112 end 1113 end 1114 set(handles.list_pair_civ,'String',[displ_pair';{'j=*-*'}]); 1115 end 1116 if exist('dt','var') & ~isempty(dt) 1117 [dtsort,indsort]=sort(dt); 1118 displ_num(1,:)=numlist_a(indsort); 1119 displ_num(2,:)=numlist_b(indsort); 1120 displ_num(3,:)=0; 1121 displ_num(4,:)=0; 1122 displ_pair=displ_pair(indsort); 1123 ref_time=ref_time(indsort); 1124 end 1125 end 1213 % dt(ind_exist)=NaN;%no information on dt 1214 % end 1215 % %determine nom_type_ima for pair display (used in num2stra.m) 1216 % switch NomType 1217 % case {'#ab'} 1218 % nom_type_ima='#a'; 1219 % case {'#AB'} 1220 % nom_type_ima='#A'; 1221 % otherwise 1222 % nom_type_ima='_1_1'; 1223 % end 1224 % displ_pair{ind_exist}=['j= ' num2stra(numod_a,nom_type_ima,2) '-' num2stra(numod_b,nom_type_ima,2) ... 1225 % ' :dt= ' num2str(dt(ind_exist)*1000)]; 1226 % end 1227 % end 1228 % set(handles.list_pair_civ,'String',[displ_pair';{'j=*-*'}]); 1229 % end 1230 % if exist('dt','var') & ~isempty(dt) 1231 % [dtsort,indsort]=sort(dt); 1232 % displ_num(1,:)=numlist_a(indsort); 1233 % displ_num(2,:)=numlist_b(indsort); 1234 % displ_num(3,:)=0; 1235 % displ_num(4,:)=0; 1236 % displ_pair=displ_pair(indsort); 1237 % ref_time=ref_time(indsort); 1238 % end 1239 % end 1240 if isempty(displ_pair) 1241 msgbox_uvmat('ERROR',['no file available for the selected subdirectory ' subdir]) 1242 end 1243 return 1244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%END FUNCTION 1245 1246 1126 1247 if ind_exist==0 1127 1248 if isequal(mode,'series(Dj)') | isequal(mode,'st_series(Dj)') … … 1138 1259 end 1139 1260 end 1140 1261 return 1262 %TO update 1141 1263 val=get(handles.list_pair_civ,'Value'); 1142 1264 if val > length(displ_pair) … … 1148 1270 SeriesData.ref_time=ref_time; 1149 1271 set(handles.series,'UserData',SeriesData) 1150 list_pair_civ_Callback( hObject, eventdata,handles)1272 list_pair_civ_Callback([],[],handles) 1151 1273 1152 1274 %------------------------------------------------------------- 1153 1275 % --- Executes on selection in list_pair_civ. 1154 function list_pair_civ_Callback(hObject, eventdata,handles)1276 function list_pair_civ_Callback(hObject,eventdata,handles) 1155 1277 %------------------------------------------------------------ 1156 1157 %update first_i and last_i according to the chosen image pairs 1278 return 1279 %%%%%%%% 1280 %update num_first_i and num_last_i according to the chosen image pairs 1158 1281 testupdate=0; 1159 1282 Val=get(handles.RootPath,'Value'); … … 1228 1351 mode=mode_list{mode_value}; 1229 1352 if isequal(mode,'series(Di)') 1230 first_i=str2num(get(handles. first_i,'String'));1231 last_i=str2num(get(handles. last_i,'String'));1232 incr_i=str2num(get(handles. incr_i,'String'));1353 first_i=str2num(get(handles.num_first_i,'String')); 1354 last_i=str2num(get(handles.num_last_i,'String')); 1355 incr_i=str2num(get(handles.num_incr_i,'String')); 1233 1356 num1=first_i:incr_i:last_i; 1234 lastfieldCell=get(handles.n b_field,'String');1357 lastfieldCell=get(handles.num_MaxIndex_i,'String'); 1235 1358 lastfield=str2num(lastfieldCell{1}); 1236 1359 if ~isempty(lastfield) … … 1239 1362 end 1240 1363 if ~isempty(num1) 1241 set(handles. first_i,'String',num2str(num1(1)));1242 set(handles. last_i,'String',num2str(num1(end)));1364 set(handles.num_first_i,'String',num2str(num1(1))); 1365 set(handles.num_last_i,'String',num2str(num1(end))); 1243 1366 end 1244 1367 testupdate=1; 1245 1368 elseif isequal(mode,'series(Dj)') 1246 first_j=str2num(get(handles. first_j,'String'));1247 last_j=str2num(get(handles. last_j,'String'));1248 incr_j=str2num(get(handles. incr_j,'String'));1369 first_j=str2num(get(handles.num_first_j,'String')); 1370 last_j=str2num(get(handles.num_last_j,'String')); 1371 incr_j=str2num(get(handles.num_incr_j,'String')); 1249 1372 num_j=first_j:incr_j:last_j; 1250 lastfieldCell=get(handles.n b_field2,'String');1373 lastfieldCell=get(handles.num_MaxIndex_j,'String'); 1251 1374 if ~isempty(lastfieldCell) 1252 1375 lastfield2=lastfieldCell{1}; … … 1269 1392 function RUN_Callback(hObject, eventdata, handles) 1270 1393 %------------------------------------------------------------------------ 1271 % read root name and field type1394 %% read root name and field type 1272 1395 set(handles.RUN,'BusyAction','queue'); 1273 1396 set(0,'CurrentFigure',handles.series) … … 1280 1403 SeriesData=get(handles.series,'UserData'); 1281 1404 1282 %reinitiate waitbar position 1283 Series.WaitbarPos=get(handles.waitbar_frame,'Position');%TO SUPPRESS 1284 waitbarpos=Series.WaitbarPos; 1285 waitbarpos(4)=0.005;%reinitialize waitbar to zero height 1286 waitbarpos(2)=Series.WaitbarPos(2)+Series.WaitbarPos(4)-0.005; 1287 set(handles.waitbar,'Position',waitbarpos) 1288 1289 % read input file parameters and set menus 1405 % Series.hseries=handles.series; % handles to the series GUI 1406 1407 %% Read parameters from series 1408 Series=read_GUI(handles.series);%TODO: extend to all input param 1409 Series.hseries=handles.series; % handles to the series GUI 1410 1411 first_i=1; 1412 last_i=1; 1413 incr_i=1; 1414 first_j=1; 1415 last_j=1; 1416 incr_j=1; 1417 if isfield(Series.IndexRange,'first_i') 1418 first_i=Series.IndexRange.first_i; 1419 incr_i=Series.IndexRange.incr_i; 1420 last_i=Series.IndexRange.last_i; 1421 end 1422 if isfield(Series.IndexRange,'first_j') 1423 first_j=Series.IndexRange.first_j; 1424 incr_j=Series.IndexRange.incr_j; 1425 last_j=Series.IndexRange.last_j; 1426 end 1427 1428 %% read input file parameters and set menus 1290 1429 Series.PathProject=get(handles.PathCampaign,'String'); 1291 1430 RootPath=get(handles.RootPath,'String');% path of the root name of the first field series … … 1324 1463 Series.transform_fct=transform_list{menu_index};% transform function handles 1325 1464 end 1326 Series.hseries=handles.series; % handles to the series GUI 1327 1328 %read the set of field numbers 1329 first_i=str2num(get(handles.first_i,'String')); 1330 last_i=str2num(get(handles.last_i,'String')); 1331 incr_i=str2num(get(handles.incr_i,'String')); 1332 first_j=str2num(get(handles.first_j,'String')); 1333 last_j=str2num(get(handles.last_j,'String')); 1334 incr_j=str2num(get(handles.incr_j,'String')); 1335 if ~isequal(get(handles.first_i,'Visible'),'on') 1336 first_i=1; 1337 last_i=1; 1338 incr_i=1; 1339 end 1340 if ~isequal(get(handles.first_j,'Visible'),'on') 1341 first_j=1; 1342 last_j=1; 1343 incr_j=1; 1344 end 1345 Series.NbSlice=str2num(get(handles.NbSlice,'String')); 1346 if isequal(first_i,[])|isequal(first_j,[]), msgbox_uvmat('ERROR','first field number not defined'),... 1347 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end; 1348 if isequal(last_i,[])| isequal(last_j,[]),msgbox_uvmat('ERROR','last field number not defined'),... 1349 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end; 1350 if isequal(incr_i,[])| isequal(incr_j,[]),msgbox_uvmat('ERROR','increment in field number not defined'),... 1351 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end; 1465 1466 % 1467 % first_i=str2num(get(handles.num_first_i,'String')); 1468 % last_i=str2num(get(handles.num_last_i,'String')); 1469 % incr_i=str2num(get(handles.num_incr_i,'String')); 1470 % first_j=str2num(get(handles.num_first_j,'String')); 1471 % last_j=str2num(get(handles.num_last_j,'String')); 1472 % incr_j=str2num(get(handles.num_incr_j,'String')); 1473 % if ~isequal(get(handles.num_first_i,'Visible'),'on') 1474 % first_i=1; 1475 % last_i=1; 1476 % incr_i=1; 1477 % end 1478 % if ~isequal(get(handles.num_first_j,'Visible'),'on') 1479 % first_j=1; 1480 % last_j=1; 1481 % incr_j=1; 1482 % end 1483 1484 %reinitiate waitbar position 1485 Series.WaitbarPos=get(handles.waitbar_frame,'Position');%TO SUPPRESS 1486 waitbarpos=Series.WaitbarPos; 1487 waitbarpos(4)=0.005;%reinitialize waitbar to zero height 1488 waitbarpos(2)=Series.WaitbarPos(2)+Series.WaitbarPos(4)-0.005; 1489 % set(handles.waitbar,'Position',waitbarpos) 1490 1491 1492 Series.NbSlice=Series.IndexRange.NbSlice; 1352 1493 if last_i < first_i | last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),... 1353 1494 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end; 1354 1495 num_i=first_i:incr_i:last_i; 1355 1496 num_j=first_j:incr_j:last_j; 1356 nbfield_cell=get(handles.n b_field,'String');1497 nbfield_cell=get(handles.num_MaxIndex_i,'String'); 1357 1498 nbfield=[]; %default 1358 1499 for iview=1:length(nbfield_cell) … … 1363 1504 end 1364 1505 nbfield=min(nbfield); 1365 nbfield2_cell=get(handles.n b_field2,'String');1506 nbfield2_cell=get(handles.num_MaxIndex_j,'String'); 1366 1507 nbfield2=[]; %default 1367 1508 for iview=1:length(nbfield2_cell) … … 1386 1527 for iview=1:length(RootPath) 1387 1528 %case of pairs (.nc files) 1388 1389 if isequal(NomType{iview},'_1_1-2')|| isequal(NomType{iview},'_1-2_1')|| isequal(NomType{iview},'_1-2')|| isequal(NomType{iview},'#_ab') 1390 ind_shift=SeriesData.displ_num(iview,:); 1391 if isequal(ind_shift,[0 0 0 0]) % undefined pairs 1392 if isequal(NomType{iview},'#_ab') 1393 mode='#_ab'; 1394 end 1395 [num_i1,num_i2,num_j1,num_j2,nbmissing]=netseries_generator(fullfile(RootPath{iview},RootFile{iview}),SubDir{iview},mode,first_i,incr_i,last_i,first_j,incr_j,last_j); 1396 else 1397 [num_i1,num_i2,num_j1,num_j2,num_i,num_j]=find_file_indices(num_i,num_j,ind_shift,NomType{iview},mode); 1398 if isempty(num_i) 1399 msgbox_uvmat('ERROR','ERROR: empty set of input files chosen') 1400 return 1401 end 1402 if num_i(1)>first_i 1403 set(handles.first_i,'String',num2str(num_i(1)))%update the display of first field 1404 last_i_Callback(hObject, eventdata, handles) 1405 end 1406 if num_i(end)<last_i 1407 set(handles.last_i,'String',num2str(num_i(end)))%update the display of last field 1408 last_i_Callback(hObject, eventdata, handles) 1409 end 1410 if num_j(1)>first_j 1411 set(handles.first_j,'String',num2str(num_j(1)))%update the display of first field 1412 last_j_Callback(hObject, eventdata, handles) 1413 end 1414 if num_j(end)<last_j 1415 set(handles.last_j,'String',num2str(num_j(end)))%update the display of last field 1416 last_j_Callback(hObject, eventdata, handles) 1417 end 1418 end 1529 fileinput=name_generator(fullfile(RootPath{iview},RootFile{iview}),first_i,first_j,FileExt{iview},NomType{iview},1,first_i+1,first_j+1,SubDir{iview}); 1530 if strcmp(get(handles.Pairs,'Visible'),'on') 1531 pair_list=get(handles.list_pair_civ,'String'); 1532 val=get(handles.list_pair_civ,'Value'); 1533 pair_string=pair_list{val}; 1534 r=regexp(pair_string,'.*\D(?<num1>[\d+|*])(?<delim>[-||])(?<num2>[\d+|*])','names'); 1535 if ~isempty(r) 1536 if strcmp(r.num1,'*')%free pairs 1537 [~,RootFile,i1_series,i2_series,j1_series,j2_series,~,~,Object]=find_file_series(fileinput)% TODO: choice pair when multiple choice 1538 1539 if isempty(i2_series) %j pairs 1540 ind_sel=i1_series>=i1_series>=first_i & i1_series<=last_i & j1_series>first_j & j2_series<last_j; 1541 j2_series=j2_series(ind_sel); 1542 else%i pairs 1543 if isempty(j1_series) %j pairs 1544 ind_sel=i1_series>=first_i & i2_series<=last_i ; 1545 else 1546 ind_sel=i1_series>=first_i & i2_series<=last_i& j1_series>first_j & j1_series<last_j; 1547 j1_series=j1_series(ind_sel); 1548 i2_series=i2_series(ind_sel); 1549 end 1550 end 1551 i1_series=i1_series(ind_sel); 1552 else 1553 if strcmp(r.delim,'-') 1554 ind_shift(1)=str2num(r.num1); 1555 ind_shift(2)=str2num(r.num2); 1556 else 1557 ind_shift(1)=-str2num(r.num1); 1558 ind_shift(2)=str2num(r.num2); 1559 end 1560 [i1_series,i2_series,j1_series,j2_series,nbmissing]=find_file_indices(num_i,num_j,ind_shift,NomType{iview},mode); 1561 end 1562 end 1563 if isempty(i1_series) 1564 msgbox_uvmat('ERROR','no file in the considered range') 1565 return 1566 end 1567 if isempty(i2_series) 1568 i2_series=i1_series; 1569 end 1570 if isempty(j2_series) 1571 j2_series=j1_series; 1572 end 1573 % if isequal(NomType{iview},'_1_1-2')|| isequal(NomType{iview},'_1-2_1')|| isequal(NomType{iview},'_1-2')|| isequal(NomType{iview},'#_ab') 1574 % ind_shift=SeriesData.displ_num(iview,:); 1575 % if isequal(ind_shift,[0 0 0 0]) % undefined pairs 1576 % if isequal(NomType{iview},'#_ab') 1577 % mode='#_ab'; 1578 % end 1579 % [num_i1,i2_series,j1_series,num_j2,nbmissing]=netseries_generator(fullfile(RootPath{iview},RootFile{iview}),SubDir{iview},mode,num_first_i,num_incr_i,num_last_i,num_first_j,num_incr_j,num_last_j); 1580 % else 1581 % [num_i1,num_i2,num_j1,num_j2,num_i,num_j]=find_file_indices(num_i,num_j,ind_shift,NomType{iview},mode); 1582 % if isempty(num_i) 1583 % msgbox_uvmat('ERROR','ERROR: empty set of input files chosen') 1584 % return 1585 % end 1586 % if num_i(1)>num_first_i 1587 % set(handles.num_first_i,'String',num2str(num_i(1)))%update the display of first field 1588 % last_i_Callback(hObject, eventdata, handles) 1589 % end 1590 % if num_i(end)<num_last_i 1591 % set(handles.num_last_i,'String',num2str(num_i(end)))%update the display of last field 1592 % last_i_Callback(hObject, eventdata, handles) 1593 % end 1594 % if num_j(1)>num_first_j 1595 % set(handles.num_first_j,'String',num2str(num_j(1)))%update the display of first field 1596 % last_j_Callback(hObject, eventdata, handles) 1597 % end 1598 % if num_j(end)<num_last_j 1599 % set(handles.num_last_j,'String',num2str(num_j(end)))%update the display of last field 1600 % last_j_Callback(hObject, eventdata, handles) 1601 % end 1602 % end 1419 1603 else%case of images 1420 [ num_i1,num_j1]=meshgrid(num_i,num_j);1421 num_i2=num_i1;1422 num_j2=num_j1;1604 [i1_series,j1_series]=meshgrid(num_i,num_j); 1605 i2_series=i1_series; 1606 j2_series=j1_series; 1423 1607 end 1424 1608 if length(RootPath)>1 1425 num_i1_cell{iview}=num_i1;1426 num_i2_cell{iview}=num_i2;1427 num_j1_cell{iview}=num_j1;1428 num_j2_cell{iview}=num_j2;1609 i1_series_cell{iview}=i1_series; 1610 i2_series_cell{iview}=i2_series; 1611 j1_series_cell{iview}=j1_series; 1612 j2_series_cell{iview}=j2_series; 1429 1613 end 1430 1614 end … … 1453 1637 Series.Action=action;%name of the processing programme 1454 1638 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 1455 1456 1639 if length(RootPath)>1 1457 h_fun( num_i1_cell,num_i2_cell,num_j1_cell,num_j2_cell,Series);1458 else 1459 h_fun( num_i1,num_i2,num_j1,num_j2,Series);1640 h_fun(i1_series_cell,i2_series_cell,j1_series_cell,j2_series_cell,Series); 1641 else 1642 h_fun(i1_series,i2_series,j1_series,j2_series,Series); 1460 1643 end 1461 1644 set(handles.RUN,'BackgroundColor',[1 0 0]) … … 1483 1666 1484 1667 %------------------------------------------------------------------------ 1485 function first_i_Callback(hObject, eventdata, handles)1668 function num_first_i_Callback(hObject, eventdata, handles) 1486 1669 %------------------------------------------------------------------------ 1487 1670 last_i_Callback(hObject, eventdata, handles) 1488 1671 1489 1672 %------------------------------------------------------------------------ 1490 function last_i_Callback(hObject, eventdata, handles)1673 function num_last_i_Callback(hObject, eventdata, handles) 1491 1674 %------------------------------------------------------------------------ 1492 1675 SeriesData=get(handles.series,'UserData'); … … 1497 1680 1498 1681 %------------------------------------------------------------------------ 1499 function first_j_Callback(hObject, eventdata, handles)1682 function num_first_j_Callback(hObject, eventdata, handles) 1500 1683 %------------------------------------------------------------------------ 1501 1684 last_j_Callback(hObject, eventdata, handles) 1502 1685 1503 1686 %------------------------------------------------------------------------ 1504 function last_j_Callback(hObject, eventdata, handles)1505 %------------------------------------------------------------------------ 1506 first_j=str2num(get(handles. first_j,'String'));1507 last_j=str2num(get(handles. last_j,'String'));1687 function num_last_j_Callback(hObject, eventdata, handles) 1688 %------------------------------------------------------------------------ 1689 first_j=str2num(get(handles.num_first_j,'String')); 1690 last_j=str2num(get(handles.num_last_j,'String')); 1508 1691 ref_j=ceil((first_j+last_j)/2); 1509 1692 set(handles.ref_j,'String', num2str(ref_j)) … … 1531 1714 if isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')|| isequal(NomType,'_1-2') 1532 1715 if isequal(mode,'series(Di)') 1533 find_netcpair_civ(h Object, eventdata, handles,Val);% update the menu of pairs depending on the available netcdf files1716 find_netcpair_civ(handles,Val);% update the menu of pairs depending on the available netcdf files 1534 1717 % break 1535 1718 end … … 1550 1733 if isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')|| isequal(NomType,'_1-2') 1551 1734 if isequal(mode,'series(Dj)') 1552 find_netcpair_civ(h Object, eventdata, handles,Val);% update the menu of pairs depending on the available netcdf files1735 find_netcpair_civ(handles,Val);% update the menu of pairs depending on the available netcdf files 1553 1736 end 1554 1737 end … … 1631 1814 set(handles.NomType,'Visible','on') 1632 1815 set(handles.FileExt,'Visible','on') 1633 set(handles. NbSlice,'Visible','off')1816 set(handles.num_NbSlice,'Visible','off') 1634 1817 set(handles.NbSlice_title,'Visible','off') 1635 1818 set(handles.VelTypeMenu,'Visible','off'); … … 1639 1822 view_FieldMenu(handles,'off') 1640 1823 view_FieldMenu_1(handles,'off') 1641 view_TRANSFORM(handles,'off') 1642 set(handles.ProjObject_frame,'Visible','off'); 1824 set(handles.FieldTransform,'Visible','off') 1825 % view_TRANSFORM(handles,'off')Visible','off') 1826 set(handles.Objects,'Visible','off'); 1643 1827 set(handles.GetMask,'Visible','off') 1644 1828 set(handles.Mask,'Visible','off') 1645 set(handles.GetObject,'Visible','off'); 1646 set(handles.ProjObject,'Visible','off'); 1829 % set(handles.GetObject,'Visible','off'); 1647 1830 set(handles.OutputDir,'Visible','off'); 1648 set(handles.PARAMETERS_frame,'Visible','off');1649 set(handles.PARAMETERS_title,'Visible','off');1831 % set(handles.PARAMETERS_frame,'Visible','off'); 1832 % set(handles.PARAMETERS_title,'Visible','off'); 1650 1833 set(handles.ParamKey,'Visible','off') 1651 1834 set(handles.ParamVal,'Visible','off') … … 1726 1909 case 'NbSlice' %hidden by default 1727 1910 if isequal(lower(varargout{ilist+1}),'on') 1728 set(handles. NbSlice,'Visible','on')1911 set(handles.num_NbSlice,'Visible','on') 1729 1912 set(handles.NbSlice_title,'Visible','on') 1730 1913 end … … 1761 1944 if isequal(lower(varargout{ilist+1}),'on') 1762 1945 set(handles.transform_fct,'Enable','on') 1763 view_TRANSFORM(handles,'on') 1946 set(handles.FieldTransform,'Visible','on') 1947 % view_TRANSFORM(handles,'on') 1764 1948 end 1765 1949 case 'GetObject' %hidden by default 1766 1950 if isequal(lower(varargout{ilist+1}),'on') 1767 set(handles. ProjObject_frame,'Visible','on')1768 set(handles.GetObject,'Visible','on');1951 set(handles.Objects,'Visible','on') 1952 % set(handles.GetObject,'Visible','on'); 1769 1953 end 1770 1954 case 'Mask' %hidden by default 1771 1955 if isequal(lower(varargout{ilist+1}),'on') 1772 set(handles. ProjObject_frame,'Visible','on')1773 set(handles.GetMask,'Visible','on');1956 set(handles.Objects,'Visible','on') 1957 % set(handles.GetMask,'Visible','on'); 1774 1958 end 1775 1959 case 'PARAMETER' … … 1845 2029 %%%%%%%%%%%%% 1846 2030 function [ind_remove]=find_pairs(dirpair,ind_i,last_i) 1847 1848 indsel=ind_i; 1849 indiff=diff(ind_i); %test index increment to detect multiplets (several pairs with the same index ind_i) and holes in the series 1850 indiff=[1 indiff last_i-ind_i(end)+1];%for testing gaps with the imposed bounds 1851 if ~isempty(indiff) 1852 indiff2=diff(indiff); 1853 indiffp=[indiff2 1]; 1854 indiffm=[1 indiff2]; 1855 ind_multi_m=find((indiff==0)&(indiffm<0))-1;%indices of first members of multiplets 1856 ind_multi_p=find((indiff==0)&(indiffp>0));%indices of last members of multiplets 1857 %for each multiplet, select the most recent file 1858 ind_remove=[]; 1859 for i=1:length(ind_multi_m) 1860 ind_pairs=ind_multi_m(i):ind_multi_p(i); 1861 for imulti=1:length(ind_pairs) 1862 datepair(imulti)=datenum(dirpair(ind_pairs(imulti)).date);%dates of creation 1863 end 1864 [datenew,indsort2]=sort(datepair); %sort the multiplet by creation date 1865 ind_s=indsort2(1:end-1);% 1866 ind_remove=[ind_remove ind_pairs(ind_s)];%remove these indices, leave the last one 1867 end 1868 end 2031 indsel=ind_i; 2032 indiff=diff(ind_i); %test index increment to detect multiplets (several pairs with the same index ind_i) and holes in the series 2033 indiff=[1 indiff last_i-ind_i(end)+1];%for testing gaps with the imposed bounds 2034 if ~isempty(indiff) 2035 indiff2=diff(indiff); 2036 indiffp=[indiff2 1]; 2037 indiffm=[1 indiff2]; 2038 ind_multi_m=find((indiff==0)&(indiffm<0))-1;%indices of first members of multiplets 2039 ind_multi_p=find((indiff==0)&(indiffp>0));%indices of last members of multiplets 2040 %for each multiplet, select the most recent file 2041 ind_remove=[]; 2042 for i=1:length(ind_multi_m) 2043 ind_pairs=ind_multi_m(i):ind_multi_p(i); 2044 for imulti=1:length(ind_pairs) 2045 datepair(imulti)=datenum(dirpair(ind_pairs(imulti)).date);%dates of creation 2046 end 2047 [datenew,indsort2]=sort(datepair); %sort the multiplet by creation date 2048 ind_s=indsort2(1:end-1);% 2049 ind_remove=[ind_remove ind_pairs(ind_s)];%remove these indices, leave the last one 2050 end 2051 end 1869 2052 1870 2053 %------------------------------------------------------------------------ … … 1878 2061 num_i_out=num_i; 1879 2062 num_j_out=num_j; 1880 if isequal (NomType,'_1-2_1') || isequal (NomType,'_1-2') 2063 % if isequal (NomType,'_1-2_1') || isequal (NomType,'_1-2') 2064 if isequal(mode,'series(Di)') 1881 2065 num_i1_line=num_i+ind_shift(3);% set of first image numbers 1882 2066 num_i2_line=num_i+ind_shift(4); … … 1890 2074 [xx,num_i1]=meshgrid(num_j,num_i1_line); 1891 2075 [xx,num_i2]=meshgrid(num_j,num_i2_line); 1892 elseif isequal ( NomType,'_1_1-2') || isequal (NomType,'#_ab')2076 elseif isequal (mode,'series(Dj)')||isequal (mode,'bursts') 1893 2077 if isequal(mode,'bursts') %case of bursts (png_old or png_2D) 1894 2078 num_j1=ind_shift(1)*ones(size(num_i)); … … 1912 2096 %------------------------------------------------------------------------ 1913 2097 SeriesData=get(handles.series,'UserData');% 1914 first_i=str2num(get(handles. first_i,'String'));1915 first_j=str2num(get(handles. first_j,'String'));1916 last_i=str2num(get(handles. last_i,'String'));1917 last_j=str2num(get(handles. last_j,'String'));2098 first_i=str2num(get(handles.num_first_i,'String')); 2099 first_j=str2num(get(handles.num_first_j,'String')); 2100 last_i=str2num(get(handles.num_last_i,'String')); 2101 last_j=str2num(get(handles.num_last_j,'String')); 1918 2102 NomType=SeriesData.NomType; 1919 2103 mode_list=get(handles.mode,'String'); … … 2156 2340 % --- image pair. The set of first numbers num1 of the image pairs is also 2157 2341 % --- given as output 2158 function [num_i1,num_i2,num_j1,num_j2,nbmissing]=netseries_generator(filebase,subdir,mode,first_i,incr_i,last_i,first_j,incr_j,last_j) 2159 %------------------------------------------------------------------------ 2160 [Path,Name]=fileparts(filebase); 2161 filebasesub=fullfile(Path,subdir,Name); 2162 filecell={};%default 2163 num_i1=[]; 2164 num_i2=[]; 2165 num_j1=[]; 2166 num_j2=[]; 2167 ind0_i=first_i:incr_i:last_i; 2168 nbcolumn=length(ind0_i); 2169 ind0_j=first_j:incr_j:last_j; 2170 nbline=length(ind0_j); 2171 if isequal(mode,'#_ab') 2172 dirpair=dir([filebasesub '*_*.nc']); 2173 elseif isequal(mode,'bursts')||isequal(mode,'series(Dj)') 2174 dirpair=dir([filebasesub '_*_*-*.nc']); 2175 elseif isequal(mode,'series(Di)') 2176 dirpair=dir([filebasesub '_*-*_*.nc']); 2177 else 2178 msgbox_uvmat('ERROR','option *|* not yet implemented') 2179 return 2180 end 2181 if isempty(dirpair) 2182 msgbox_uvmat('ERROR','no pair detected in the selected range') 2183 return 2184 end 2185 2186 if isequal(mode,'bursts')||isequal(mode,'#_ab') 2187 icount=0; 2188 for ifile=1:length(dirpair) 2189 [RootPath,RootFile,str_1,str_2,str_a,str_b,ext,nom_type]=name2display(dirpair(ifile).name); 2190 num1_r=str2num(str_1); 2191 if isequal(RootFile,Name) & ~isempty(num1_r) 2192 num_i1(ifile)=num1_r; 2193 num_a(ifile)=stra2num(str_a); 2194 num_b(ifile)=stra2num(str_b); 2195 end 2196 end 2197 test_range= (num_i1 >=first_i)&(num_i1<= last_i);% =1 when both numbers are in the range 2198 ind_i=((num_i1-first_i)/incr_i)+1;%indices i in the list of prescribed file indices 2199 select=find(test_range &(floor(ind_i)==ind_i));%selected indices of num_i1 in the file directory 2200 ind_i=ind_i(select);%set of selected indices ind_i 2201 [ind_i,indsort]=sort(ind_i);%sorted list of ind_i 2202 select=select(indsort); 2203 num_i1=num_i1(select); 2204 num_a=num_a(select); 2205 num_b=num_b(select); 2206 dirpair=dirpair(select); 2207 [ind_remove]=find_pairs(dirpair,ind_i,nbcolumn); 2208 ind_i(ind_remove)=[]; 2209 num_a(ind_remove)=[]; 2210 num_b(ind_remove)=[]; 2211 num_j1=zeros(1,nbcolumn);%default 2212 num_j2=num_j1; 2213 num_j1(ind_i)=num_a; 2214 num_j2(ind_i)=num_b; 2215 num_i1=first_i:incr_i:last_i; 2216 num_i2=num_i1; 2217 nbmissing=nbcolumn-length(ind_i); 2218 2219 elseif isequal(mode,'series(Di)') 2220 %ind0_i=first_i:incr_i:last_i; 2221 %nbcolumn=length(ind0_i); 2222 %ind0_j=first_j:incr_j:last_j; 2223 %nbline=length(ind0_j); 2224 %dirpair=dir([filebasesub '_*-*_*.nc']); 2225 for ifile=1:length(dirpair) 2226 [RootPath,RootFile,str_1,str_2,str_a,str_b,ext,nom_type]=name2display(dirpair(ifile).name); 2227 num_i1_r(ifile)=str2num(str_1); 2228 num_i2_r(ifile)=str2num(str_2); 2229 num_j(ifile)=str2num(str_a); 2230 end 2231 num_i=floor((num_i1_r+num_i2_r)/2); %list of reference indices of the detected files 2232 test_range= (num_i >=first_i)&(num_i<= last_i)&(num_j >=first_j)&(num_j<= last_j);% =1 when both numbers are in the range 2233 ind_i=((num_i-first_i)/incr_i)+1;%indices i and j in the list of prescribed file indices 2234 ind_j=((num_j-first_j)/incr_j)+1; 2235 ind_ij=ind_j+nbline*(ind_i-1);%indices in the reshhaped series of prescribed file indices 2236 select=find(test_range &(floor(ind_i)==ind_i)&(floor(ind_j)==ind_j));%selected indices in the file directory 2237 ind_ij=ind_ij(select);%set of selected indices ind_ij 2238 [ind_ij,indsort]=sort(ind_ij);%sorted list of ind_ij 2239 select=select(indsort); 2240 num_i1_r=num_i1_r(select); 2241 num_i2_r=num_i2_r(select); 2242 dirpair=dirpair(select); 2243 [ind_remove]=find_pairs(dirpair,ind_ij,nbcolumn*nbline) ; 2244 ind_ij(ind_remove)=[]; 2245 num_i1_r(ind_remove)=[]; 2246 num_i2_r(ind_remove)=[]; 2247 num_i1=zeros(1,nbline*nbcolumn);%default 2248 num_i2=num_i1; 2249 num_i1(ind_ij)=num_i1_r; 2250 num_j2(ind_ij)=num_i2_r; 2251 num_i1=reshape(num_i1,nbline,nbcolumn); 2252 num_i2=reshape(num_i2,nbline,nbcolumn); 2253 num_j1=meshgrid(ind0_i,ind0_j); 2254 num_j2=num_j1; 2255 nbmissing=nbline*nbcolumn-length(ind_ij); 2256 elseif isequal(mode,'series(Dj)') 2257 for ifile=1:length(dirpair) 2258 [RootPath,RootFile,str_1,str_2,str_a,str_b,ext,nom_type]=name2display(dirpair(ifile).name); 2259 num_i(ifile)=str2num(str_1); 2260 num_a(ifile)=str2num(str_a); 2261 num_b(ifile)=str2num(str_b); 2262 end 2263 num_j=floor((num_a+num_b)/2); %list of reference indices of the detected files 2264 test_range= (num_i >=first_i)&(num_i<= last_i)&(num_j >=first_j)&(num_j<= last_j);% =1 when both numbers are in the range 2265 ind_i=((num_i-first_i)/incr_i)+1;%indices i and j in the list of prescribed file indices 2266 ind_j=((num_j-first_j)/incr_j)+1; 2267 ind_ij=ind_j+nbline*(ind_i-1);%indices in the reshhaped series of prescribed file indices 2268 select=find(test_range &(floor(ind_i)==ind_i)&(floor(ind_j)==ind_j));%selected indices in the file directory 2269 ind_ij=ind_ij(select);%set of selected indices ind_ij 2270 [ind_ij,indsort]=sort(ind_ij);%sorted list of ind_ij 2271 select=select(indsort); 2272 num_i=num_i(select); 2273 num_a=num_a(select); 2274 num_b=num_b(select); 2275 dirpair=dirpair(select); 2276 [ind_remove]=find_pairs(dirpair,ind_ij,nbcolumn*nbline) ; 2277 ind_ij(ind_remove)=[]; 2278 num_a(ind_remove)=[]; 2279 num_b(ind_remove)=[]; 2280 num_j1=zeros(1,nbline*nbcolumn);%default 2281 num_j2=num_j1; 2282 num_j1(ind_ij)=num_a; 2283 num_j2(ind_ij)=num_b; 2284 num_j1=reshape(num_j1,nbline,nbcolumn); 2285 num_j2=reshape(num_j2,nbline,nbcolumn); 2286 num_i1=meshgrid(ind0_i,ind0_j); 2287 num_i2=num_i1; 2288 nbmissing=nbline*nbcolumn-length(ind_ij); 2289 end 2290 2291 2292 2342 % function [num_i1,num_i2,num_j1,num_j2,nbmissing]=netseries_generator(filebase,subdir,mode,first_i,incr_i,last_i,first_j,incr_j,last_j) 2343 % %------------------------------------------------------------------------ 2344 % [Path,Name]=fileparts(filebase); 2345 % filebasesub=fullfile(Path,subdir,Name); 2346 % filecell={};%default 2347 % num_i1=[]; 2348 % num_i2=[]; 2349 % num_j1=[]; 2350 % num_j2=[]; 2351 % ind0_i=first_i:incr_i:last_i; 2352 % nbcolumn=length(ind0_i); 2353 % ind0_j=first_j:incr_j:last_j; 2354 % nbline=length(ind0_j); 2355 % if isequal(mode,'#_ab') 2356 % dirpair=dir([filebasesub '*_*.nc']); 2357 % elseif isequal(mode,'bursts')||isequal(mode,'series(Dj)') 2358 % dirpair=dir([filebasesub '_*_*-*.nc']); 2359 % elseif isequal(mode,'series(Di)') 2360 % dirpair=dir([filebasesub '_*-*_*.nc']); 2361 % else 2362 % msgbox_uvmat('ERROR','option *|* not yet implemented') 2363 % return 2364 % end 2365 % if isempty(dirpair) 2366 % msgbox_uvmat('ERROR','no pair detected in the selected range') 2367 % return 2368 % end 2369 % 2370 % if isequal(mode,'bursts')||isequal(mode,'#_ab') 2371 % icount=0; 2372 % for ifile=1:length(dirpair) 2373 % [RootPath,RootFile,str_1,str_2,str_a,str_b,ext,nom_type]=name2display(dirpair(ifile).name); 2374 % num1_r=str2num(str_1); 2375 % if isequal(RootFile,Name) & ~isempty(num1_r) 2376 % num_i1(ifile)=num1_r; 2377 % num_a(ifile)=stra2num(str_a); 2378 % num_b(ifile)=stra2num(str_b); 2379 % end 2380 % end 2381 % test_range= (num_i1 >=first_i)&(num_i1<= last_i);% =1 when both numbers are in the range 2382 % ind_i=((num_i1-first_i)/incr_i)+1;%indices i in the list of prescribed file indices 2383 % select=find(test_range &(floor(ind_i)==ind_i));%selected indices of num_i1 in the file directory 2384 % ind_i=ind_i(select);%set of selected indices ind_i 2385 % [ind_i,indsort]=sort(ind_i);%sorted list of ind_i 2386 % select=select(indsort); 2387 % num_i1=num_i1(select); 2388 % num_a=num_a(select); 2389 % num_b=num_b(select); 2390 % dirpair=dirpair(select); 2391 % [ind_remove]=find_pairs(dirpair,ind_i,nbcolumn); 2392 % ind_i(ind_remove)=[]; 2393 % num_a(ind_remove)=[]; 2394 % num_b(ind_remove)=[]; 2395 % num_j1=zeros(1,nbcolumn);%default 2396 % num_j2=num_j1; 2397 % num_j1(ind_i)=num_a; 2398 % num_j2(ind_i)=num_b; 2399 % num_i1=first_i:incr_i:last_i; 2400 % num_i2=num_i1; 2401 % nbmissing=nbcolumn-length(ind_i); 2402 % 2403 % elseif isequal(mode,'series(Di)') 2404 % %ind0_i=num_first_i:num_incr_i:num_last_i; 2405 % %nbcolumn=length(ind0_i); 2406 % %ind0_j=num_first_j:num_incr_j:num_last_j; 2407 % %nbline=length(ind0_j); 2408 % %dirpair=dir([filebasesub '_*-*_*.nc']); 2409 % for ifile=1:length(dirpair) 2410 % [RootPath,RootFile,str_1,str_2,str_a,str_b,ext,nom_type]=name2display(dirpair(ifile).name); 2411 % num_i1_r(ifile)=str2num(str_1); 2412 % num_i2_r(ifile)=str2num(str_2); 2413 % num_j(ifile)=str2num(str_a); 2414 % end 2415 % num_i=floor((num_i1_r+num_i2_r)/2); %list of reference indices of the detected files 2416 % test_range= (num_i >=first_i)&(num_i<= last_i)&(num_j >=first_j)&(num_j<= last_j);% =1 when both numbers are in the range 2417 % ind_i=((num_i-first_i)/incr_i)+1;%indices i and j in the list of prescribed file indices 2418 % ind_j=((num_j-first_j)/incr_j)+1; 2419 % ind_ij=ind_j+nbline*(ind_i-1);%indices in the reshhaped series of prescribed file indices 2420 % select=find(test_range &(floor(ind_i)==ind_i)&(floor(ind_j)==ind_j));%selected indices in the file directory 2421 % ind_ij=ind_ij(select);%set of selected indices ind_ij 2422 % [ind_ij,indsort]=sort(ind_ij);%sorted list of ind_ij 2423 % select=select(indsort); 2424 % num_i1_r=num_i1_r(select); 2425 % num_i2_r=num_i2_r(select); 2426 % dirpair=dirpair(select); 2427 % [ind_remove]=find_pairs(dirpair,ind_ij,nbcolumn*nbline) ; 2428 % ind_ij(ind_remove)=[]; 2429 % num_i1_r(ind_remove)=[]; 2430 % num_i2_r(ind_remove)=[]; 2431 % num_i1=zeros(1,nbline*nbcolumn);%default 2432 % num_i2=num_i1; 2433 % num_i1(ind_ij)=num_i1_r; 2434 % num_j2(ind_ij)=num_i2_r; 2435 % num_i1=reshape(num_i1,nbline,nbcolumn); 2436 % num_i2=reshape(num_i2,nbline,nbcolumn); 2437 % num_j1=meshgrid(ind0_i,ind0_j); 2438 % num_j2=num_j1; 2439 % nbmissing=nbline*nbcolumn-length(ind_ij); 2440 % elseif isequal(mode,'series(Dj)') 2441 % for ifile=1:length(dirpair) 2442 % [RootPath,RootFile,str_1,str_2,str_a,str_b,ext,nom_type]=name2display(dirpair(ifile).name); 2443 % num_i(ifile)=str2num(str_1); 2444 % num_a(ifile)=str2num(str_a); 2445 % num_b(ifile)=str2num(str_b); 2446 % end 2447 % num_j=floor((num_a+num_b)/2); %list of reference indices of the detected files 2448 % test_range= (num_i >=first_i)&(num_i<= last_i)&(num_j >=first_j)&(num_j<= last_j);% =1 when both numbers are in the range 2449 % ind_i=((num_i-first_i)/incr_i)+1;%indices i and j in the list of prescribed file indices 2450 % ind_j=((num_j-first_j)/incr_j)+1; 2451 % ind_ij=ind_j+nbline*(ind_i-1);%indices in the reshhaped series of prescribed file indices 2452 % select=find(test_range &(floor(ind_i)==ind_i)&(floor(ind_j)==ind_j));%selected indices in the file directory 2453 % ind_ij=ind_ij(select);%set of selected indices ind_ij 2454 % [ind_ij,indsort]=sort(ind_ij);%sorted list of ind_ij 2455 % select=select(indsort); 2456 % num_i=num_i(select); 2457 % num_a=num_a(select); 2458 % num_b=num_b(select); 2459 % dirpair=dirpair(select); 2460 % [ind_remove]=find_pairs(dirpair,ind_ij,nbcolumn*nbline) ; 2461 % ind_ij(ind_remove)=[]; 2462 % num_a(ind_remove)=[]; 2463 % num_b(ind_remove)=[]; 2464 % num_j1=zeros(1,nbline*nbcolumn);%default 2465 % num_j2=num_j1; 2466 % num_j1(ind_ij)=num_a; 2467 % num_j2(ind_ij)=num_b; 2468 % num_j1=reshape(num_j1,nbline,nbcolumn); 2469 % num_j2=reshape(num_j2,nbline,nbcolumn); 2470 % num_i1=meshgrid(ind0_i,ind0_j); 2471 % num_i2=num_i1; 2472 % nbmissing=nbline*nbcolumn-length(ind_ij); 2473 % end -
trunk/src/update_waitbar.m
r19 r339 7 7 8 8 function update_waitbar(hwaitbar,bar_size,advance_ratio) 9 waitbarpos(1)=bar_size(1); 10 waitbarpos(3)=bar_size(3); 11 waitbarpos(4)=advance_ratio*bar_size(4); 12 waitbarpos(2)=bar_size(4)+bar_size(2)-waitbarpos(4); 13 set(hwaitbar,'Position',waitbarpos) 9 % waitbarpos(1)=bar_size(1); 10 % waitbarpos(3)=bar_size(3); 11 % waitbarpos(4)=advance_ratio*bar_size(4); 12 % waitbarpos(2)=bar_size(4)+bar_size(2)-waitbarpos(4); 13 % set(hwaitbar,'Position',waitbarpos) 14 set(hwaitbar,'Units','pixels') 15 pos=get(hwaitbar,'Position'); 16 CData=zeros([floor(pos(4)) floor(pos(3)) 3]); 17 set(hwaitbar,'Units','normalized') 18 CData(:,1:floor(advance_ratio*size(CData,2)),1:2)=1; 19 set(hwaitbar,'CData',CData) 14 20 drawnow -
trunk/src/uvmat.m
r334 r339 474 474 end 475 475 % detect root name, nomenclature and indices in the input file name: 476 [ RootPath,SubDir,RootFile,i1,i2,j1,j2,FileExt]=fileparts_uvmat(fileinput);476 [~,SubDir,~,i1,i2,j1,j2,FileExt]=fileparts_uvmat(fileinput); 477 477 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 478 [i1_series,i2_series,j1_series,j2_series,NomType,FileType,MovieObject]=find_file_series(fileinput);479 478 % [i1_series,i2_series,j1_series,j2_series,NomType,FileType,MovieObject]=find_file_series(fileinput); 479 [RootPath,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,MovieObject]=find_file_series(fileinput); 480 480 % open the file or fill the GUI uvmat according to the detected file type 481 481 switch FileType … … 822 822 823 823 % set default options in menu 'Fields' 824 825 824 if ~testima 826 825 testcivx=0; … … 1909 1908 function movie_pair_Callback(hObject, eventdata, handles) 1910 1909 %------------------------------------------------------------------------ 1911 status=get(handles.movie_pair,'value'); 1912 if isequal(status,0) 1910 1911 %% stop movie action if the movie_pair button is off 1912 if ~get(handles.movie_pair,'value') 1913 1913 set(handles.movie_pair,'BusyAction','Cancel')%stop movie pair if button is 'off' 1914 1914 set(handles.i2,'String','') … … 1918 1918 set(handles.movie_pair,'BusyAction','queue') 1919 1919 end 1920 %initialisation 1920 1921 %% initialisation 1921 1922 set(handles.movie_pair,'BackgroundColor',[1 1 0])%paint the command button in yellow 1922 1923 drawnow … … 1929 1930 [ff,rr,filebase,xx,Ext,SubDir]=read_file_boxes(handles); 1930 1931 NomType=get(handles.NomType,'String'); 1931 % NomType=get(handles.FileIndex,'UserData');1932 1932 else 1933 1933 list_fields=get(handles.Fields_1,'String');% list menu fields … … 1969 1969 end 1970 1970 1971 % read the second image1971 %% read the second image 1972 1972 Field.AName='image'; 1973 1973 if test_1 … … 1984 1984 end 1985 1985 Field_b.CoordUnit='pixel'; 1986 %determine the input file type 1986 1987 %% determine the input file type 1987 1988 if (test_1 && isfield(UvData,'MovieObject_1'))||(~test_1 && isfield(UvData,'MovieObject')) 1988 1989 FileType='movie';
Note: See TracChangeset
for help on using the changeset viewer.