- Timestamp:
- Dec 13, 2011, 11:20:07 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r326 r332 552 552 %% set the menus of image pairs and default selection for civ %%%%%%%%%%%%%%%%%%% 553 553 test_ima_i=numel(nom_type_ima)>1 && isempty(regexp(nom_type_ima(2:end),'\D','once'));%images with single indexing 554 if test_ima_i || isequal(nom_type_nc,'_ i1-i2')||~(exist('nbfield2','var')&&(nbfield2~=1))554 if test_ima_i || isequal(nom_type_nc,'_1-2')||~(exist('nbfield2','var')&&(nbfield2~=1)) 555 555 set(handles.ListPairMode,'Value',1) 556 556 set(handles.ListPairMode,'String',{'series(Di)'}) … … 1695 1695 end 1696 1696 if isempty(nom_type_ima2),nom_type_ima2='1';end; %default 1697 if isempty(nom_type_nc),nom_type_nc='_ i1-i2';end; %default1697 if isempty(nom_type_nc),nom_type_nc='_1-2';end; %default 1698 1698 [num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2]=... 1699 1699 find_pair_indices(handles,ref_i,ref_j,mode); … … 3085 3085 nom_type_ima=browse.nom_type_ima; 3086 3086 end 3087 nom_type_nc='_ i1-i2';%default3087 nom_type_nc='_1-2';%default 3088 3088 if isfield(browse,'nom_type_nc') 3089 3089 nom_type_nc=browse.nom_type_nc; … … 3093 3093 elseif isequal(nom_type_ima,'none')||isequal(nom_type_nc,'none') 3094 3094 nom_type_nc='none'; 3095 elseif isequal(nom_type_ima,'avi')||isequal(nom_type_ima,'_i')||isequal(nom_type_ima,'ima_num')||isequal(nom_type_nc,'_ i1-i2')3096 nom_type_nc='_ i1-i2';3095 elseif isequal(nom_type_ima,'avi')||isequal(nom_type_ima,'_i')||isequal(nom_type_ima,'ima_num')||isequal(nom_type_nc,'_1-2') 3096 nom_type_nc='_1-2'; 3097 3097 else 3098 3098 if isequal(mode,'series(Di)')%|isequal(mode,'st_series(Di)') 3099 nom_type_nc='_ i1-i2_j'; % PIV in volume3099 nom_type_nc='_1-2_1'; % PIV in volume 3100 3100 else 3101 nom_type_nc='_ i_j1-j2';3101 nom_type_nc='_1_1-2'; 3102 3102 end 3103 3103 end -
trunk/src/geometry_calib.m
r252 r332 275 275 delete(hhh); 276 276 end 277 set(hhuvmat. FixLimits,'Value',0)% put FixedLimits option to 'off'278 set(hhuvmat. FixLimits,'BackgroundColor',[0.7 0.7 0.7])277 set(hhuvmat.CheckFixLimits,'Value',0)% put FixedLimits option to 'off' 278 set(hhuvmat.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 279 279 UserData=get(handles.geometry_calib,'UserData'); 280 280 UserData.XmlInputFile=outputfile;%save the current xml file name … … 499 499 huvmat=findobj(allchild(0),'Tag','uvmat'); 500 500 hhuvmat=guidata(huvmat); 501 Calib.Cx=str2num(get(hhuvmat.n px,'String'))/2;502 Calib.Cx=str2num(get(hhuvmat.n py,'String'))/2;501 Calib.Cx=str2num(get(hhuvmat.num_Npx,'String'))/2; 502 Calib.Cx=str2num(get(hhuvmat.num_Npy,'String'))/2; 503 503 end 504 504 %tsai parameters … … 557 557 %retrieve the calibration points stored in the files listed in the popup list coord_files 558 558 x_1=Coord(:,4:5)';%px coordinates of the ref points 559 nx=str2num(get(hhuvmat.n px,'String'));560 ny=str2num(get(hhuvmat.n py,'String'));559 nx=str2num(get(hhuvmat.num_Npx,'String')); 560 ny=str2num(get(hhuvmat.num_Npy,'String')); 561 561 x_1(2,:)=ny-x_1(2,:);%reverse the y image coordinates 562 562 X_1=Coord(:,1:3)';%phys coordinates of the ref points … … 629 629 %retrieve the calibration points stored in the files listed in the popup list coord_files 630 630 x_1=Coord(:,4:5)';%px coordinates of the ref points 631 nx=str2num(get(hhuvmat.n px,'String'));632 ny=str2num(get(hhuvmat.n py,'String'));631 nx=str2num(get(hhuvmat.num_Npx,'String')); 632 ny=str2num(get(hhuvmat.num_Npy,'String')); 633 633 x_1(2,:)=ny-x_1(2,:);%reverse the y image coordinates 634 634 X_1=Coord(:,1:3)';%phys coordinates of the ref points … … 693 693 huvmat=findobj(allchild(0),'Tag','uvmat'); 694 694 hhuvmat=guidata(huvmat); 695 ny=str2double(get(hhuvmat.n py,'String'));695 ny=str2double(get(hhuvmat.num_Npy,'String')); 696 696 x_1(2,:)=ny-x_1(2,:);%reverse the y image coordinates 697 697 n_ima=1; … … 1596 1596 % f2=1000; 1597 1597 % hhuvmat=guidata(findobj(allchild(0),'Name','uvmat')); 1598 % Cx=str2num(get(hhuvmat.n px,'String'))/2;1599 % Cy=str2num(get(hhuvmat.n py,'String'))/2;1598 % Cx=str2num(get(hhuvmat.num_Npx,'String'))/2; 1599 % Cy=str2num(get(hhuvmat.num_Npy,'String'))/2; 1600 1600 Tabchar={};%default 1601 1601 val_cal=1;%default -
trunk/src/mouse_down.m
r309 r332 24 24 function xy=mouse_down(hObject,eventdata) 25 25 26 huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle which controls theoption of mouse action 27 if isempty(huvmat) 28 return 29 end 30 hhuvmat=guidata(huvmat);%handles of elements in uvmat 31 UvData=get(huvmat,'UserData'); 26 AxeData=[];%default 32 27 FigData=get(hObject,'UserData'); 33 28 if ishandle(FigData)% case of a zoom plot, the handle of the parent rectangle is stored in UserData, its parent is the plotting axes of the rectangle … … 41 36 hhcurrentfig=guidata(hcurrentfig); 42 37 if isfield(hhcurrentfig,'CheckZoom') 43 test_zoom=get(hhcurrentfig.CheckZoom,'Value');%test for zoom action, first priority38 test_zoom=get(hhcurrentfig.CheckZoom,'Value');%test for zoom action, first priority 44 39 else 45 40 test_zoom=0; 46 41 end 47 test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler action, second priority; 48 test_edit=get(hhuvmat.edit_object,'Value');%test for object editing, third priority 49 test_edit_vect=get(hhuvmat.edit_vect,'Value');%test for vector editing, priority 4 50 test_create=isequal(get(hhuvmat.MenuObject,'checked'),'on');% test for object creation, priority 5 51 if test_create 52 hset_object=findobj(allchild(0),'tag','set_object'); 53 test_create=~isempty(hset_object)&&~test_edit; 54 end 55 test_cal=isequal(get(hhuvmat.MenuCalib,'checked'),'on');% test for calibration 56 if test_cal% test for calibration popints, priority 6 57 h_calib=findobj(allchild(0),'tag','geometry_calib'); 58 if isempty(h_calib) 59 test_cal=0; 60 set(hhuvmat.MenuCalib,'checked','off');% test for calibration off 61 else 62 hh_calib=guidata(h_calib); 63 test_cal=get(hh_calib.edit_append,'Value'); 64 end 65 end 66 AxeData=[];%default 42 43 %% look for parameters set by the GUI uvmat 44 test_ruler=0; 45 test_edit=0; 46 test_create=0; 47 huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle which controls theoption of mouse action 48 if ~isempty(huvmat) 49 hhuvmat=guidata(huvmat);%handles of elements in uvmat 50 UvData=get(huvmat,'UserData'); 51 test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler action, second priority; 52 test_edit=get(hhuvmat.edit_object,'Value');%test for object editing, third priority 53 test_edit_vect=get(hhuvmat.edit_vect,'Value');%test for vector editing, priority 4 54 test_create=isequal(get(hhuvmat.MenuObject,'checked'),'on');% test for object creation, priority 5 55 if test_create 56 hset_object=findobj(allchild(0),'tag','set_object'); 57 test_create=~isempty(hset_object)&&~test_edit; 58 end 59 test_cal=isequal(get(hhuvmat.MenuCalib,'checked'),'on');% test for calibration 60 if test_cal% test for calibration popints, priority 6 61 h_calib=findobj(allchild(0),'tag','geometry_calib'); 62 if isempty(h_calib) 63 test_cal=0; 64 set(hhuvmat.MenuCalib,'checked','off');% test for calibration off 65 else 66 hh_calib=guidata(h_calib); 67 test_cal=get(hh_calib.edit_append,'Value'); 68 end 69 end 70 end 67 71 68 72 %% determine the currently selected items -
trunk/src/name2display.m
r317 r332 18 18 % nom_type='_1a','_1A','_01a','_01A',...: idem, with a separator '_' before the index 19 19 % nom_type='_1_1','_01_1',...: matrix of files with two indices i and j separated by '_'(e.g. 'aa_45_2.png') 20 % nom_type='_ i1-i2': from pairs from a single index (e.g. 'aa_45-47.nc')21 % nom_type='_ i_j1-j2': pairs of j indices (e.g. 'aa_45_2-3.nc')22 % nom_type='_ i1-i2_j': pairs of i indices (e.g. 'aa_45-46_2.nc')20 % nom_type='_1-2': from pairs from a single index (e.g. 'aa_45-47.nc') 21 % nom_type='_1_1-2': pairs of j indices (e.g. 'aa_45_2-3.nc') 22 % nom_type='_1-2_j': pairs of i indices (e.g. 'aa_45-46_2.nc') 23 23 % nom_type='_1_ab','1_ab','01_ab'..., from pairs of '#' images (e.g.'aa045bc.nc'), ext='.nc' 24 24 %subdir: name of the subdirectory for netcdf files … … 69 69 penult=double(RootFile(indcur-1));%ascii code of the penultimate character 70 70 testsub=0; %default 71 % case of an indexed series in a single file72 if strcmpi(ext,'.avi')73 nom_type='*';74 % case of a numerical index follewed by a lower case letter (e.g. a,b,c):75 % the penultimate character is a number and the last one a letter (lower case: last >= 97 && last <= 12276 % capital77 % letter: last >= 65 && last <= 90)78 elseif penult >= 48 && penult <= 57 && ((last >= 65 && last <= 90)||(last >= 97 && last <= 122))71 % % case of an indexed series in a single file 72 % if strcmpi(ext,'.avi') 73 % nom_type='*'; 74 % %case of a numerical index follewed by a lower case letter (e.g. a,b,c): 75 % %the penultimate character is a number and the last one a letter (lower case: last >= 97 && last <= 122 76 % % capital 77 % % letter: last >= 65 && last <= 90) 78 if penult >= 48 && penult <= 57 && ((last >= 65 && last <= 90)||(last >= 97 && last <= 122)) 79 79 str_a=last_str; %extract appendix a,b,c... or A,B,C... as output. 80 80 ind_end=indcur-1; %current index just before the suffix letter … … 98 98 str_a=num2; 99 99 str_b=num3; 100 nom_type='_ i1-i2_j1-j2';100 nom_type='_1-2_1-2'; 101 101 testsub=1; 102 102 indcur=separ0-1; … … 105 105 str2=num2; 106 106 str_a=num3; 107 nom_type='_ i1-i2_j';107 nom_type='_1-2_1'; 108 108 testsub=1; 109 109 indcur=separ1-1; … … 113 113 str_a=num2; 114 114 str_b=num3; 115 nom_type='_ i_j1-j2';115 nom_type='_1_1-2'; 116 116 testsub=1; 117 117 elseif strcmp(filelit(end-1:end),'_-') … … 120 120 str2=num3; 121 121 str_a=''; 122 nom_type='_ i1-i2';122 nom_type='_1-2'; 123 123 testsub=1; 124 124 elseif strcmp(filelit(end-1:end),'__') -
trunk/src/name_generator.m
r221 r332 26 26 % nom_type='_1a','_1A','_01a','_01A',...: idem, with a separator '_' before the index 27 27 % nom_type='_1_1','_01_1',...: matrix of files with two indices i and j separated by '_'(e.g. 'aa_45_2.png') 28 % nom_type='_ i1-i2': from pairs from a single index (e.g. 'aa_45-47.nc')29 % nom_type='_ i_j1-j2': pairs of j indices (e.g. 'aa_45_2-3.nc')30 % nom_type='_ i1-i2_j': pairs of i indices (e.g. 'aa_45-46_2.nc')28 % nom_type='_1-2': from pairs from a single index (e.g. 'aa_45-47.nc') 29 % nom_type='_1_1-2': pairs of j indices (e.g. 'aa_45_2-3.nc') 30 % nom_type='_1-2_1': pairs of i indices (e.g. 'aa_45-46_2.nc') 31 31 % nom_type='_1_ab','1_ab','01_ab'..., from pairs of '#' images (e.g.'aa045bc.nc'), ext='.nc' 32 32 %'comp_input' (for nom_type involving index pairs (e.g. netc)) … … 71 71 num_i2_out=num_i2;%default output 72 72 num_j2_out=num_j2;%default output 73 test_pairs=numel(nom_type)>=2 &&(strcmp(nom_type,'_ i1-i2_j1-j2')|| strcmp(nom_type(end-1:end),'ab')|| strcmp(nom_type(end-1:end),'AB')||...74 strcmp(nom_type,'_ i_j1-j2')|| strcmp(nom_type,'_i1-i2_j')||strcmp(nom_type,'_i1-i2'));75 %test_2D= strcmp(nom_type(end-1:end),'ab')|| strcmp(nom_type(end-1:end),'AB') ||strcmp(nom_type,'_ i_j1-j2');76 %test_3D=strcmp(nom_type,'_ i1-i2_j')|| strcmp(nom_type,'_i1-i2');73 test_pairs=numel(nom_type)>=2 &&(strcmp(nom_type,'_1-2_1-2')|| strcmp(nom_type(end-1:end),'ab')|| strcmp(nom_type(end-1:end),'AB')||... 74 strcmp(nom_type,'_1_1-2')|| strcmp(nom_type,'_1-2_1')||strcmp(nom_type,'_1-2')); 75 %test_2D= strcmp(nom_type(end-1:end),'ab')|| strcmp(nom_type(end-1:end),'AB') ||strcmp(nom_type,'_1_1-2'); 76 %test_3D=strcmp(nom_type,'_1-2_1')|| strcmp(nom_type,'_1-2'); 77 77 if ~isequal(subdir,'') && ~isequal(subdir,'?') 78 78 [Path,Name]=fileparts(filebase); … … 144 144 filename=[filename num2str(num_i1,numstr) num_j_str ext]; 145 145 num_i2_out=num_i1; 146 elseif isequal(nom_type,' i_j1-j2')146 elseif isequal(nom_type,'1_1-2') 147 147 if isequal(num2str(num_j1),num2str(num_j2))% case of displacements at the same time 148 148 filename=[filename num2str(num_i1) '_' num2str(num_j1) ext]; … … 151 151 end 152 152 num_i2_out=num_i1; 153 elseif isequal(nom_type,' i1-i2_j')153 elseif isequal(nom_type,'1-2_1') 154 154 if isequal(num2str(num_i1),num2str(num_i2))% case of displacements at the same time 155 155 filename=[filename num2str(num_i1) '_' num2str(num_j1) ext]; … … 158 158 end 159 159 num_j2_out=num_j1; 160 elseif isequal(nom_type,' i1-i2')160 elseif isequal(nom_type,'1-2') 161 161 if isequal(num2str(num_i1),num2str(num_i2))% case of displacements at the same time 162 162 filename=[filename num2str(num_i1) ext]; … … 165 165 end 166 166 num_j2_out=num_j1; 167 elseif isequal(nom_type,' i1-i2_j1-j2')167 elseif isequal(nom_type,'1-2_1-2') 168 168 if isequal(num2str(num_i1),num2str(num_i2))% case of displacements at the same time 169 169 app1= num2str(num_i1); … … 215 215 if isequal(nom_type,'#_ab') 216 216 filename=[filebasesub num2str(num_i1,'%03d') '_' num2stra(num_j1,nom_type) num2stra(num_j2,nom_type) ext]; 217 elseif isequal(nom_type,'_ i1_j1-j2')217 elseif isequal(nom_type,'_1_1-2') 218 218 filename=[filebasesub '_' num2str(num_i1) '_' num2str(num_j1) '-' num2str(num_i2) ext]; 219 elseif isequal(nom_type,'_ i1-i2_j')219 elseif isequal(nom_type,'_1-2_1') 220 220 filename=[filebasesub '_' num2str(num_i1) '-' num2str(num_i2) '_' num2str(num_j1) ext]; 221 elseif isequal(nom_type,'_ i1-i2')221 elseif isequal(nom_type,'_1-2') 222 222 filename=[filebasesub '_' num2str(num_i1) '-' num2str(num_i2) ext]; 223 223 end … … 246 246 if isequal(nom_type,'#_ab') 247 247 dirpair=dir([filebasesub num2str(num_i1,'%03d') '_*.nc']); 248 elseif isequal(nom_type,'_ i_j1-j2')248 elseif isequal(nom_type,'_1_1-2') 249 249 dirpair=dir([filebasesub '_' num2str(num_i1) '_*-*.nc']); 250 elseif isequal(nom_type,'_ i1-i2_j')250 elseif isequal(nom_type,'_1-2_1') 251 251 dirpair=dir([filebasesub '_' num2str(num_i1) '-*_' num2str(num_j1) '.nc']); 252 elseif isequal(nom_type,'_ i1-i2')252 elseif isequal(nom_type,'_1-2') 253 253 dirpair=dir([filebasesub '_' num2str(num_i1) '-*.nc']); 254 254 if isempty(dirpair) -
trunk/src/num2stra.m
r122 r332 13 13 14 14 function str=num2stra(num,nom_type,index) 15 str=''; 15 16 if ~exist('index','var') 16 17 index=2; %index 1 or 2 of the file indices … … 18 19 switch index 19 20 case 1 20 if length(nom_type)>=4 && isequal(nom_type(1:2),'%0') && isequal(nom_type(4),'d')21 str=num2str(num,nom_type(1:4));22 else21 % if length(nom_type)>=4 && isequal(nom_type(1:2),'%0') && isequal(nom_type(4),'d') 22 % str=num2str(num,nom_type(1:4)); 23 % else 23 24 str=num2str(num); 24 end25 % end 25 26 case 2 26 if isempty(nom_type) 27 nom_type='none'; 28 end 29 if isequal(nom_type,'png_old') || isequal(nom_type,'netc_old') || isequal(nom_type,'raw_SMD')||... 30 isequal(nom_type(end),'a')||isequal(nom_type(end),'b') 27 if isequal(nom_type(end),'a')||isequal(nom_type(end),'b') 31 28 str=char(96+num); 32 29 elseif isequal(nom_type(end),'A')|isequal(nom_type(end),'B') 33 30 str=char(64+num); 34 elseif isequal(nom_type,'series_i')|isequal(nom_type,'netc_series')...35 |isequal(nom_type,'ima_num')| isequal(nom_type,'avi')| isequal(nom_type,'none')...36 isequal(nom_type,'_i')|isequal(nom_type,'_i1-i2')37 str='';31 % elseif isequal(nom_type,'series_i')|isequal(nom_type,'netc_series')... 32 % |isequal(nom_type,'ima_num')| isequal(nom_type,'avi')| isequal(nom_type,'none')... 33 % isequal(nom_type,'_i')|isequal(nom_type,'_i1-i2') 34 % str=''; 38 35 else 39 36 str=num2str(num); -
trunk/src/series.m
r329 r332 65 65 % set(0,'Units','pixels') 66 66 % screensize=get(0,'ScreenSize'); %screen size in pixels 67 set(hObject,'Position',[150 100 1000 600] );%position and size in pixels (get adjusted to the screen size in case of excess) 67 set(hObject,'WindowButtonDownFcn',{'mouse_down'})%allows mouse action with right button (zoom for uicontrol display) 68 %set(hObject,'Position',[150 100 1000 600] );%position and size in pixels (get adjusted to the screen size in case of excess) 68 69 %load the list of previously browsed files in menus Open and Open_1 69 70 dir_perso=prefdir; … … 112 113 if isfield(param,'FileName') 113 114 if isfield(param,'FileName_1') 114 update_file(h Object, eventdata, handles,param.FileName_1,0)115 update_file(h Object, eventdata, handles,param.FileName,1)115 update_file(handles,param.FileName_1,0) 116 update_file(handles,param.FileName,1) 116 117 else 117 update_file(h Object, eventdata, handles,param.FileName,0)118 update_file(handles,param.FileName,0) 118 119 end 119 120 end … … 125 126 FieldCell{1}=param.list_fields{param.index_fields}; 126 127 end 127 set(hObject,'WindowButtonDownFcn',{'mouse_down'})%allows mouse action with right button (zoom for uicontrol display)128 128 NomType_Callback(hObject, eventdata, handles) 129 129 … … 135 135 [path_series,name,ext]=fileparts(which('series')); 136 136 path_series=fullfile(path_series,'series');%path of the function 'series' 137 addpath path_series; %add the path to UVMAT, (useful in case of change of working directory after civ has been s opened in the working directory)137 addpath (path_series) ; %add the path to UVMAT, (useful in case of change of working directory after civ has been s opened in the working directory) 138 138 path_transform=fullfile(path_series,'transform_field');%path to the field transform functions 139 139 for ilist=1:length(fct_menu) … … 256 256 warndlg_uvmat('ERROR','input file type not implemented')%A Faire: ouvrir le fichier pour naviguer 257 257 else 258 update_file(h Object, eventdata, handles,fileinput,0)258 update_file(handles,fileinput,0) 259 259 %update list of recent files in the menubar 260 260 MenuFile_1=fileinput; … … 293 293 function MenuFile_1_Callback(hObject, eventdata, handles) 294 294 fileinput=get(handles.MenuFile_1,'Label'); 295 update_file(h Object, eventdata, handles,fileinput,0)295 update_file(handles,fileinput,0) 296 296 297 297 % -------------------------------------------------------------------- 298 298 function MenuFile_2_Callback(hObject, eventdata, handles) 299 299 fileinput=get(handles.MenuFile_2,'Label'); 300 update_file(h Object, eventdata, handles,fileinput,0)300 update_file(handles,fileinput,0) 301 301 302 302 % -------------------------------------------------------------------- 303 303 function MenuFile_3_Callback(hObject, eventdata, handles) 304 304 fileinput=get(handles.MenuFile_3,'Label'); 305 update_file( hObject, eventdata,handles,fileinput,0)305 update_file( handles,fileinput,0) 306 306 307 307 % -------------------------------------------------------------------- 308 308 function MenuFile_4_Callback(hObject, eventdata, handles) 309 309 fileinput=get(handles.MenuFile_4,'Label'); 310 update_file(h Object, eventdata, handles,fileinput,0)310 update_file(handles,fileinput,0) 311 311 312 312 % -------------------------------------------------------------------- 313 313 function MenuFile_5_Callback(hObject, eventdata, handles) 314 314 fileinput=get(handles.MenuFile_5,'Label'); 315 update_file(h Object, eventdata, handles,fileinput,0)315 update_file(handles,fileinput,0) 316 316 317 317 % -------------------------------------------------------------------- … … 360 360 msgbox_uvmat('ERROR','input file type not implemented')%A Faire: ouvrir le fichier pour naviguer 361 361 else 362 update_file(h Object, eventdata, handles,fileinput,1)362 update_file(handles,fileinput,1) 363 363 %update list of recent files in the menubar 364 364 MenuFile_1=fileinput; … … 397 397 function MenuFile_insert_1_Callback(hObject, eventdata, handles) 398 398 fileinput=get(handles.MenuFile_insert_1,'Label'); 399 update_file(h Object, eventdata, handles,fileinput,1)399 update_file(handles,fileinput,1) 400 400 401 401 % -------------------------------------------------------------------- 402 402 function MenuFile_insert_2_Callback(hObject, eventdata, handles) 403 403 fileinput=get(handles.MenuFile_insert_2,'Label'); 404 update_file(h Object, eventdata, handles,fileinput,1)404 update_file(handles,fileinput,1) 405 405 406 406 % -------------------------------------------------------------------- 407 407 function MenuFile_insert_3_Callback(hObject, eventdata, handles) 408 408 fileinput=get(handles.MenuFile_insert_3,'Label'); 409 update_file( hObject, eventdata,handles,fileinput,1)409 update_file( handles,fileinput,1) 410 410 411 411 % -------------------------------------------------------------------- 412 412 function MenuFile_insert_4_Callback(hObject, eventdata, handles) 413 413 fileinput=get(handles.MenuFile_insert_4,'Label'); 414 update_file( hObject, eventdata,handles,fileinput,1)414 update_file( handles,fileinput,1) 415 415 416 416 % -------------------------------------------------------------------- 417 417 function MenuFile_insert_5_Callback(hObject, eventdata, handles) 418 418 fileinput=get(handles.MenuFile_insert_5,'Label'); 419 update_file(h Object, eventdata, handles,fileinput,1)419 update_file(handles,fileinput,1) 420 420 421 421 %------------------------------------------------------------------------ 422 422 % --- refresh the GUI data after introduction of a new file series 423 function update_file(hObject, eventdata, handles,fileinput,addtest) 423 % INPUT: 424 % handles: 425 % fileinput: name of the input file 426 % addtest: =0 to refresh the list of file series, =1 to append a new series to the list (from the menu bar option 'Open_insert') 427 function update_file(handles,fileinput,addtest) 424 428 %------------------------------------------------------------------------ 429 430 %% enable other menus and uicontrols 431 set(handles.MenuOpen_insert,'Enable','on') 432 set(handles.MenuFile_insert_1,'Enable','on') 433 set(handles.MenuFile_insert_2,'Enable','on') 434 set(handles.MenuFile_insert_3,'Enable','on') 435 set(handles.MenuFile_insert_4,'Enable','on') 436 set(handles.MenuFile_insert_5,'Enable','on') 437 set(handles.RUN, 'Enable','On') 438 set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red 439 set(handles.RootPath,'BackgroundColor',[1 1 0]) % set RootPath edit box to yellow 440 drawnow 441 442 %% get the input root name, indices, file extension and nomenclature NomType 425 443 if ~exist(fileinput,'file') 426 444 msgbox_uvmat('ERROR',['input file ' fileinput ' does not exist']) 427 445 return 428 446 end 429 430 % refresh input root name, indices, file extension and nomenclature 431 [RootPath,RootFile,field_count,str2,str_a,str_b,FileExt,NomType,SubDir]=name2display(fileinput); 432 433 %check for movie image files 434 if ~isempty(FileExt) 435 if ~isempty(imformats(FileExt(2:end))) 436 imainfo=imfinfo(fileinput); 437 if length(imainfo) >1 %case of image with multiple frames 438 NomType='*'; 439 [RootPath,RootFile]=fileparts(fileinput); 440 end 441 end 442 end 443 NcType='none';%default 444 if isequal(FileExt,'.nc') 445 Data=nc2struct(fileinput,[]); 446 if isfield(Data,'absolut_time_T0') 447 NcType='civx'; % test for civx velocity fields 448 end 449 end 450 451 set(handles.RootPath,'Value',1) 452 set(handles.SubDir,'Value',1) 453 set(handles.RootFile,'Value',1) 454 set(handles.NomType,'Value',1) 455 set(handles.FileExt,'Value',1) 456 set(handles.nb_field,'Value',1) 457 set(handles.nb_field2,'Value',1) 458 if addtest 459 SeriesData=get(handles.figure1,'UserData'); 460 SeriesData.displ_num=[0 0 0 0;SeriesData.displ_num]; 461 SeriesData.CurrentInputFile_1=SeriesData.CurrentInputFile; 462 RootPathCell=[{RootPath}; get(handles.RootPath,'String')] ; 463 SubDirCell=[{SubDir}; get(handles.SubDir,'String')]; 464 RootFileCell=[{RootFile}; get(handles.RootFile,'String')]; 465 NomTypeCell=[{NomType}; SeriesData.NomType]; 466 FileExtCell=[{FileExt}; get(handles.FileExt,'String')]; 467 NcTypeCell=[{NcType};SeriesData.NcType]; 468 set(handles.NomType,'String',[{};get(handles.NomType,'String')]) 469 else 470 SeriesData=[];%re-initialisation 471 SeriesData.displ_num=[0 0 0 0]; 472 RootPathCell={RootPath}; 473 SubDirCell={SubDir}; 474 RootFileCell={RootFile}; 475 NomTypeCell={NomType}; 476 FileExtCell={FileExt}; 477 NcTypeCell={NcType}; 478 end 479 480 SeriesData.NomType=NomTypeCell; 481 SeriesData.NcType=NcTypeCell; 482 SeriesData.CurrentInputFile=fileinput; 483 set(handles.RootPath,'String',RootPathCell); 484 set(handles.SubDir,'String',SubDirCell); 485 set(handles.RootFile,'String',RootFileCell); 486 set(handles.NomType,'String',NomTypeCell); 487 set(handles.FileExt,'String',FileExtCell); 488 489 %determine field indices 447 [RootPath,RootFile,i1,str2,str_a,str_b,FileExt,NomType,SubDir]=name2display(fileinput); 448 449 %% 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); 470 end 471 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=[{nb_field_str2} ;get(handles.nb_field2,'String')]; 476 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); 486 487 488 %% determine reference field indices 490 489 ref_i=1; %default ref_i is a reference frame index used to find existing pairs from PIV 491 if ~isempty(str2num( field_count))492 ref_i=str2num( field_count);490 if ~isempty(str2num(i1)) 491 ref_i=str2num(i1); 493 492 if ~isempty(str2num(str2)) 494 493 ref_i=floor((ref_i+str2num(str2))/2);% reference image number corresponding to the file 495 SeriesData.browse_Di=str2num(str2)-str2num( field_count);494 SeriesData.browse_Di=str2num(str2)-str2num(i1); 496 495 end 497 496 end … … 511 510 set(handles.last_j,'String',num2str(ref_j)); 512 511 513 %enable other menus and uicontrols514 set(handles.MenuOpen_insert,'Enable','on')515 set(handles.MenuFile_insert_1,'Enable','on')516 set(handles.MenuFile_insert_2,'Enable','on')517 set(handles.MenuFile_insert_3,'Enable','on')518 set(handles.MenuFile_insert_4,'Enable','on')519 set(handles.MenuFile_insert_5,'Enable','on')520 set(handles.RUN, 'Enable','On')521 set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red522 set(handles.RootPath,'BackgroundColor',[1 1 0]) % set RootPath edit box to yellow523 drawnow524 525 512 TimeUnit=''; %default 526 513 time=[];%default … … 536 523 if isequal(lower(FileExt),'.avi') %.avi file 537 524 testima=1; 538 info=aviinfo([FileBase FileExt]);539 time=(0:1/info.FramesPerSecond:(info.NumFrames-1)/info.FramesPerSecond)';540 nb_field=info.NumFrames;541 nb_field2=1;525 % info=aviinfo([FileBase FileExt]); 526 % time=(0:1/info.FramesPerSecond:(info.NumFrames-1)/info.FramesPerSecond)'; 527 % nb_field=info.NumFrames; 528 % nb_field2=1; 542 529 elseif ~isempty(imformats(FileExt(2:end))) 543 530 testima=1; 544 if isequal(NomType,'*')% multi-frame image545 imainfo=imfinfo([FileBase FileExt]);546 if length(imainfo) >1 %case of image with multiple frames547 nb_field=length(imainfo);548 nb_field2=1;549 end550 end531 % if isequal(NomType,'*')% multi-frame image 532 % imainfo=imfinfo([FileBase FileExt]); 533 % if length(imainfo) >1 %case of image with multiple frames 534 % nb_field=length(imainfo); 535 % nb_field2=1; 536 % end 537 % end 551 538 elseif isequal(FileExt,'.vol') 552 539 testima=1; 553 540 end 554 541 555 % enable field and veltype menus 542 543 %% fill the list of file series 544 % select the first line in the list 545 set(handles.RootPath,'Value',1) 546 set(handles.SubDir,'Value',1) 547 set(handles.RootFile,'Value',1) 548 set(handles.NomType,'Value',1) 549 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 553 if addtest 554 SeriesData=get(handles.series,'UserData'); 555 SeriesData.displ_num=[0 0 0 0;SeriesData.displ_num]; 556 SeriesData.CurrentInputFile_1=SeriesData.CurrentInputFile; 557 RootPathCell=[{RootPath}; get(handles.RootPath,'String')] ; 558 SubDirCell=[{SubDir}; get(handles.SubDir,'String')]; 559 RootFileCell=[{RootFile}; get(handles.RootFile,'String')]; 560 NomTypeCell=[{NomType}; SeriesData.NomType]; 561 FileExtCell=[{FileExt}; get(handles.FileExt,'String')]; 562 FileTypeCell=[{FileType};SeriesData.FileType]; 563 set(handles.NomType,'String',[{};get(handles.NomType,'String')]) 564 % or re-initialise the list of input file series 565 else 566 SeriesData=[];%re-initialisation 567 SeriesData.displ_num=[0 0 0 0]; 568 RootPathCell={RootPath}; 569 SubDirCell={SubDir}; 570 RootFileCell={RootFile}; 571 NomTypeCell={NomType}; 572 FileExtCell={FileExt}; 573 FileTypeCell={FileType}; 574 end 575 SeriesData.NomType=NomTypeCell; 576 SeriesData.FileType=FileTypeCell; 577 SeriesData.CurrentInputFile=fileinput; 578 set(handles.RootPath,'String',RootPathCell); 579 set(handles.SubDir,'String',SubDirCell); 580 set(handles.RootFile,'String',RootFileCell); 581 set(handles.NomType,'String',NomTypeCell); 582 set(handles.FileExt,'String',FileExtCell); 583 584 %% enable field and veltype menus 556 585 testfield=isequal(get(handles.FieldMenu,'enable'),'on'); 557 586 testfield_1=isequal(get(handles.FieldMenu_1,'enable'),'on'); … … 568 597 testnc=1; 569 598 end 570 if isequal( NcTypeCell{iview},'civx')599 if isequal(FileTypeCell{iview},'civx') 571 600 testcivx=1; 572 601 end … … 575 604 testnc=isequal(FileExtCell{1},'.nc'); 576 605 testnc_1=isequal(FileExtCell{2},'.nc'); 577 testcivx=isequal( NcTypeCell{1},'civx');578 testcivx_1=isequal( NcTypeCell{2},'civx');606 testcivx=isequal(FileTypeCell{1},'civx'); 607 testcivx_1=isequal(FileTypeCell{2},'civx'); 579 608 end 580 609 if testfield && testnc … … 630 659 end 631 660 632 %%%%%%%% read image documentation file if found%%%%%%%%%%%%%%%%%%%%%%%%%%% 633 %look for the file existence 661 %% read image documentation file if found%%%%%%%%%%%%%%%%%%%%%%%%%%% 634 662 ext_imadoc=''; 635 663 if isequal(FileExt,'.xml')||isequal(FileExt,'.civ') … … 640 668 ext_imadoc='.civ'; 641 669 end 642 670 %read the ImaDoc file 643 671 XmlData=[]; 644 672 NbSlice_calib={}; … … 672 700 end 673 701 end 702 703 704 705 %% display times 674 706 if addtest 675 707 SeriesData.Time=[{time} SeriesData.Time]; … … 677 709 SeriesData.Time={time}; 678 710 end 679 680 681 % if ~isempty(time)682 % siztime=size(time);683 % nb_field=siztime(1);684 % nb_field2=siztime(2);685 % end686 711 set(handles.TimeUnit,'String',TimeUnit) 687 %look for max indices 688 if ~strcmp(NomType,'*') 689 [num_i1,num_i2,num_j1,num_j2]=find_indexseries(fileinput); 690 nb_field=max(floor((max(num_i1)+max(num_i2))/2)); 691 nb_field2=max(floor((max(num_j1)+max(num_j2))/2)); 692 end 693 if isnan(nb_field) 694 nb_field_str='?'; 695 nb_field_str2='?'; 696 else 697 nb_field_str=num2str(nb_field); 698 nb_field_str2=num2str(nb_field2); 699 end 700 if addtest 701 nb_field_cell=[{nb_field_str} ;get(handles.nb_field,'String')]; 702 nb_field2_cell=[{nb_field_str2} ;get(handles.nb_field2,'String')]; 703 else 704 nb_field_cell={nb_field_str}; 705 nb_field2_cell={nb_field_str2}; 706 end 707 set(handles.nb_field,'String',nb_field_cell); 708 set(handles.nb_field2,'String',nb_field2_cell); 709 set(handles.figure1,'UserData',SeriesData); 710 711 %number of slices 712 set(handles.series,'UserData',SeriesData); 713 714 %% number of slices 712 715 if isfield(XmlData,'GeometryCalib') && isfield(XmlData.GeometryCalib,'SliceCoord') 713 716 siz=size(XmlData.GeometryCalib.SliceCoord); … … 721 724 722 725 % set menus of index pairs 723 NomType_Callback( hObject, eventdata, handles)726 NomType_Callback([], [], handles) 724 727 725 728 %store the root name for future opening of uvmat … … 739 742 end 740 743 set(handles.RootPath,'BackgroundColor',[1 1 1]) 741 set(handles.PathCampaign,'String',SeriesData.PathCampaign)742 last_j_Callback( hObject, eventdata, handles)743 last_i_Callback( hObject, eventdata, handles)744 % set(handles.PathCampaign,'String',SeriesData.PathCampaign) 745 last_j_Callback([], [], handles) 746 last_i_Callback([], [], handles) 744 747 745 748 %------------------------------------------------------------------------ … … 819 822 function NomType_Callback(hObject, eventdata, handles) 820 823 %------------------------------------------------------------------------ 821 hseries=get(handles.ProjObject,'Parent'); 822 SeriesData=get(hseries,'UserData'); 824 SeriesData=get(handles.series,'UserData'); 823 825 if isfield(SeriesData,'NomType') 824 826 NomTypeCell=SeriesData.NomType; … … 853 855 NomType=NomTypeCell{Val}; 854 856 switch NomType 855 case {'_ i1-i2_j', '_i1-i2'}857 case {'_1-2_1', '_1-2'} 856 858 set(handles.mode,'String',{'series(Di)'}) 857 859 set(handles.mode,'Value',1); … … 862 864 set(handles.mode,'Value',1); 863 865 testpair=1; 864 case '_ i_j1-j2'866 case '_1_1-2' 865 867 set(handles.mode,'String',{'bursts';'series(Dj)'})%multiple choice 866 868 if ~isempty(nbfield) && ~isempty(nbfield2) && ((nbfield2>10) || (nbfield==1)) … … 873 875 end 874 876 switch NomType 875 case {'_1_1','_ i_j1-j2','_i1-i2_j','1_ab','01_ab'},% two navigation indices877 case {'_1_1','_1_1-2','_1-2_1','1_ab','01_ab'},% two navigation indices 876 878 state_j='on'; 877 879 end … … 881 883 else 882 884 set(handles.NomType,'String',NomTypeCell) 885 set(handles.j_txt,'Visible',state_j) 886 set(handles.MinIndex_j,'Visible',state_j) 883 887 set(handles.first_j,'Visible',state_j) 884 888 set(handles.incr_j,'Visible',state_j) 885 889 set(handles.last_j,'Visible',state_j) 886 set(handles.nb_field2,'Visible',state_j) 890 set(handles.nb_field2,'Visible',state_j) 887 891 end 888 892 … … 892 896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 893 897 function mode_Callback(hObject, eventdata, handles) 894 %hseries=get(handles.mode,'parent'); 895 hseries=handles.figure1; 896 SeriesData=get(hseries,'UserData'); 898 SeriesData=get(handles.series,'UserData'); 897 899 mode_list=get(handles.mode,'String'); 898 900 mode_value=get(handles.mode,'Value'); … … 904 906 Val=get(handles.NomType,'Value'); 905 907 NomType=NomTypeCell{Val}; 906 test_find_pair=isequal(NomType,'_ i_j1-j2')|| isequal(NomType,'_i1-i2_j')|| isequal(NomType,'_i1-i2')|| isequal(NomType,'#_ab');908 test_find_pair=isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')|| isequal(NomType,'_1-2')|| isequal(NomType,'#_ab'); 907 909 end 908 910 time=[]; … … 917 919 enable_i(handles,'On') 918 920 enable_j(handles,'Off') %do not display j index scanning in burst mode (j is fixed by the burst choice) 919 elseif isequal(NomType,'_ i_j1-j2')|| isequal(NomType,'_i1-i2_j')921 elseif isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1') 920 922 enable_i(handles,'On') 921 923 enable_j(handles,'On') % allow both i and j index scanning … … 925 927 end 926 928 set(handles.list_pair_civ,'Value',indchosen);%set the default choice of image pairs for civ1 927 set(h series,'UserData',SeriesData)929 set(handles.series,'UserData',SeriesData) 928 930 929 931 %list pairs if relevant … … 945 947 function enable_j(handles,state) 946 948 set(handles.j_txt,'Visible',state) 949 set(handles.MinIndex_j,'Visible',state) 947 950 set(handles.first_j,'Visible',state) 948 951 set(handles.last_j,'Visible',state) … … 974 977 %---------------------------------------------------------------- 975 978 function find_netcpair_civ(hObject, eventdata, handles,Val) 976 %hseries=get(handles.list_pair_civ,'parent'); 977 SeriesData=get(handles.figure1,'UserData'); 979 SeriesData=get(handles.series,'UserData'); 978 980 % NomTypeCell=get(handles.NomType,'String'); 979 981 NomTypeCell=SeriesData.NomType; … … 1080 1082 for numod_a=1:nbfield2-1 %nbfield2 always >=2 for 'bursts' mode 1081 1083 for numod_b=(numod_a+1):nbfield2 1082 [filename]=name_generator(filebase,ref_i,numod_a,'.nc',NomType,1,ref_i,numod_b,subdir) ;1083 select=(exist(filename,'file')==2) ;1084 [filename]=name_generator(filebase,ref_i,numod_a,'.nc',NomType,1,ref_i,numod_b,subdir) 1085 select=(exist(filename,'file')==2) 1084 1086 if select==1 1085 1087 ind_exist=ind_exist+1; … … 1104 1106 nom_type_ima='#A'; 1105 1107 otherwise 1106 nom_type_ima='_ i_j';1108 nom_type_ima='_1_1'; 1107 1109 end 1108 1110 displ_pair{ind_exist}=['j= ' num2stra(numod_a,nom_type_ima,2) '-' num2stra(numod_b,nom_type_ima,2) ... … … 1145 1147 SeriesData.displ_num(iview,:)=(displ_num(:,val))'; 1146 1148 SeriesData.ref_time=ref_time; 1147 set(handles. figure1,'UserData',SeriesData)1149 set(handles.series,'UserData',SeriesData) 1148 1150 list_pair_civ_Callback(hObject, eventdata, handles) 1149 1151 … … 1157 1159 Val=get(handles.RootPath,'Value'); 1158 1160 IndexCell=get(handles.NomType,'String'); 1159 %hseries=get(handles.list_pair_civ,'parent'); 1160 SeriesData=get(handles.figure1,'UserData'); 1161 SeriesData=get(handles.series,'UserData'); 1161 1162 NomType=SeriesData.NomType{Val}; 1162 1163 list_pair=get(handles.list_pair_civ,'String');%get the menu of image pairs … … 1184 1185 end 1185 1186 switch NomType 1186 case {'_ i1-i2_j'}1187 case {'_1-2_1'} 1187 1188 if isequal(num1_str(1),'0') 1188 1189 IndexCell{Val}=['_(i-(i+' num2_str ')_j']; … … 1192 1193 displ_num(3)=num1; 1193 1194 displ_num(4)=num2; 1194 case {'_ i1-i2'}1195 case {'_1-2'} 1195 1196 if isequal(num1_str(1),'0') 1196 1197 IndexCell{Val}=['_(i' num1_str ')-(i+' num2_str ')']; … … 1200 1201 displ_num(3)=num1; 1201 1202 displ_num(4)=num2; 1202 case '_ i_j1-j2'1203 case '_1_1-2' 1203 1204 if test_bursts 1204 1205 IndexCell{Val}=['_i_' num1_str '-' num2_str ]; … … 1219 1220 set(handles.NomType,'String',IndexCell) 1220 1221 SeriesData.displ_num(Val,:)=displ_num; 1221 set(handles. figure1,'UserData',SeriesData)1222 set(handles.series,'UserData',SeriesData) 1222 1223 % set(handles.NomType,'Value',Val) 1223 1224 … … 1270 1271 %read root name and field type 1271 1272 set(handles.RUN,'BusyAction','queue'); 1272 %hseries=get(handles.RUN,'parent'); 1273 set(0,'CurrentFigure',handles.figure1) 1273 set(0,'CurrentFigure',handles.series) 1274 1274 if isequal(get(handles.GetObject,'Visible'),'on') && isequal(get(handles.GetObject,'Value'),1) 1275 1275 Series.GetObject=1; … … 1278 1278 Series.GetObject=0; 1279 1279 end 1280 SeriesData=get(handles. figure1,'UserData');1280 SeriesData=get(handles.series,'UserData'); 1281 1281 1282 1282 %reinitiate waitbar position … … 1324 1324 Series.transform_fct=transform_list{menu_index};% transform function handles 1325 1325 end 1326 Series.hseries=handles. figure1; % handles to the series GUI1326 Series.hseries=handles.series; % handles to the series GUI 1327 1327 1328 1328 %read the set of field numbers … … 1387 1387 %case of pairs (.nc files) 1388 1388 1389 if isequal(NomType{iview},'_ i_j1-j2')|| isequal(NomType{iview},'_i1-i2_j')|| isequal(NomType{iview},'_i1-i2')|| isequal(NomType{iview},'#_ab')1389 if isequal(NomType{iview},'_1_1-2')|| isequal(NomType{iview},'_1-2_1')|| isequal(NomType{iview},'_1-2')|| isequal(NomType{iview},'#_ab') 1390 1390 ind_shift=SeriesData.displ_num(iview,:); 1391 1391 if isequal(ind_shift,[0 0 0 0]) % undefined pairs … … 1490 1490 function last_i_Callback(hObject, eventdata, handles) 1491 1491 %------------------------------------------------------------------------ 1492 % hseries=get(handles.last_i,'parent'); 1493 % first_i=str2num(get(handles.first_i,'String')); 1494 % last_i=str2num(get(handles.last_i,'String')); 1495 % ref_i=ceil((first_i+last_i)/2); 1496 % set(handles.ref_i,'String', num2str(ref_i)) 1497 % ref_i_Callback(hObject, eventdata, handles) 1498 SeriesData=get(handles.figure1,'UserData'); 1492 SeriesData=get(handles.series,'UserData'); 1499 1493 if ~isfield(SeriesData,'Time') 1500 1494 SeriesData.Time{1}=[]; … … 1515 1509 set(handles.ref_j,'String', num2str(ref_j)) 1516 1510 ref_j_Callback(hObject, eventdata, handles) 1517 SeriesData=get(handles. figure1,'UserData');1511 SeriesData=get(handles.series,'UserData'); 1518 1512 if ~isfield(SeriesData,'Time') 1519 1513 SeriesData.Time{1}=[]; … … 1528 1522 mode_value=get(handles.mode,'Value'); 1529 1523 mode=mode_list{mode_value}; 1530 %hseries=get(handles.ref_i,'parent'); 1531 SeriesData=get(handles.figure1,'UserData'); 1524 SeriesData=get(handles.series,'UserData'); 1532 1525 %NomTypeCell=get(handles.NomType,'String'); 1533 1526 NomTypeCell=SeriesData.NomType; … … 1536 1529 NomType=NomTypeCell{Val}; 1537 1530 % for ilist=1:length(NomType) 1538 if isequal(NomType,'_ i_j1-j2')|| isequal(NomType,'_i1-i2_j')|| isequal(NomType,'_i1-i2')1531 if isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')|| isequal(NomType,'_1-2') 1539 1532 if isequal(mode,'series(Di)') 1540 1533 find_netcpair_civ(hObject, eventdata, handles,Val);% update the menu of pairs depending on the available netcdf files … … 1550 1543 mode_value=get(handles.mode,'Value'); 1551 1544 mode=mode_list{mode_value}; 1552 %hseries=get(handles.ref_i,'parent'); 1553 SeriesData=get(handles.figure1,'UserData'); 1545 SeriesData=get(handles.series,'UserData'); 1554 1546 NomTypeCell=SeriesData.NomType; 1555 1547 if ~isempty(NomTypeCell) 1556 1548 Val=get(handles.NomType,'Value'); 1557 1549 NomType=NomTypeCell{Val}; 1558 if isequal(NomType,'_ i_j1-j2')|| isequal(NomType,'_i1-i2_j')|| isequal(NomType,'_i1-i2')1550 if isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')|| isequal(NomType,'_1-2') 1559 1551 if isequal(mode,'series(Dj)') 1560 1552 find_netcpair_civ(hObject, eventdata, handles,Val);% update the menu of pairs depending on the available netcdf files … … 1807 1799 delete(hget_field)%delete opened versions of get_field 1808 1800 end 1809 %hseries=get(handles.FieldMenu,'parent'); 1810 SeriesData=get(handles.figure1,'UserData'); 1801 SeriesData=get(handles.series,'UserData'); 1811 1802 filename=SeriesData.CurrentInputFile; 1812 1803 if exist(filename,'file') … … 1835 1826 delete(hget_field) 1836 1827 end 1837 %hseries=get(handles.FieldMenu,'parent'); 1838 SeriesData=get(handles.figure1,'UserData'); 1828 SeriesData=get(handles.series,'UserData'); 1839 1829 filename=SeriesData.CurrentInputFile_1; 1840 1830 if exist(filename,'file') … … 1888 1878 num_i_out=num_i; 1889 1879 num_j_out=num_j; 1890 if isequal (NomType,'_ i1-i2_j') || isequal (NomType,'_i1-i2')1880 if isequal (NomType,'_1-2_1') || isequal (NomType,'_1-2') 1891 1881 num_i1_line=num_i+ind_shift(3);% set of first image numbers 1892 1882 num_i2_line=num_i+ind_shift(4); … … 1900 1890 [xx,num_i1]=meshgrid(num_j,num_i1_line); 1901 1891 [xx,num_i2]=meshgrid(num_j,num_i2_line); 1902 elseif isequal (NomType,'_ i_j1-j2') || isequal (NomType,'#_ab')1892 elseif isequal (NomType,'_1_1-2') || isequal (NomType,'#_ab') 1903 1893 if isequal(mode,'bursts') %case of bursts (png_old or png_2D) 1904 1894 num_j1=ind_shift(1)*ones(size(num_i)); … … 1921 1911 function displ_time(handles,times) 1922 1912 %------------------------------------------------------------------------ 1923 hseries=get(handles.last_i,'parent'); 1924 SeriesData=get(hseries,'UserData');% 1913 SeriesData=get(handles.series,'UserData');% 1925 1914 first_i=str2num(get(handles.first_i,'String')); 1926 1915 first_j=str2num(get(handles.first_j,'String')); 1927 1916 last_i=str2num(get(handles.last_i,'String')); 1928 1917 last_j=str2num(get(handles.last_j,'String')); 1929 % index_civ=get(handles.list_pair_civ,'Value');1930 % NomType=get(handles.NomType,'String');1931 1918 NomType=SeriesData.NomType; 1932 1919 mode_list=get(handles.mode,'String'); 1933 1920 index_mode=get(handles.mode,'Value'); 1934 1921 mode=mode_list{index_mode}; 1935 % ind_shift=0;%default1936 1922 1937 1923 time_first=[]; … … 1944 1930 time_last_cell{iview}='?';%default 1945 1931 time=SeriesData.Time{iview}; 1946 if isequal(NomType{iview},'_ i1-i2_j')|isequal(NomType{iview},'_i_j1-j2')|isequal(NomType{iview},'#_ab')|isequal(NomType{iview},'_i1-i2')1932 if isequal(NomType{iview},'_1-2_1')|isequal(NomType{iview},'_1_1-2')|isequal(NomType{iview},'#_ab')|isequal(NomType{iview},'_1-2') 1947 1933 if isfield(SeriesData,'displ_num')& ~isempty(SeriesData.displ_num) 1948 1934 ind_shift=SeriesData.displ_num(iview,:); … … 2021 2007 function GetObject_Callback(hObject, eventdata, handles) 2022 2008 %------------------------------------------------------------------------ 2023 hseries=get(handles.GetObject,'parent'); 2024 SeriesData=get(hseries,'UserData'); 2009 SeriesData=get(handles.series,'UserData'); 2025 2010 value=get(handles.GetObject,'Value'); 2026 2011 if value … … 2075 2060 % end 2076 2061 end 2077 set(h series,'UserData',SeriesData)2062 set(handles.series,'UserData',SeriesData) 2078 2063 2079 2064 %-------------------------------------------------------------- … … 2114 2099 global nb_transform 2115 2100 2116 % huvmat=get(handles.transform_fct,'parent');2117 2101 menu=get(handles.transform_fct,'String'); 2118 2102 ind_coord=get(handles.transform_fct,'Value'); … … 2305 2289 end 2306 2290 2307 %------------------------------------------------------------------------ 2308 % --- generates series of file indices corresponding to a file fileinput 2309 function [num_i1,num_i2,num_j1,num_j2]=find_indexseries(fileinput) 2310 %------------------------------------------------------------------------ 2311 num_i1=NaN;%default 2312 num_i2=NaN;%default 2313 num_j1=NaN;%default 2314 num_j2=NaN;%default 2315 % refresh input root name, indices, file extension and nomenclature 2316 [RootPath,RootFile,field_count,str2,str_a,str_b,FileExt,NomType,SubDir]=name2display(fileinput); 2317 if strcmp(SubDir,'') 2318 filebasesub=fullfile(RootPath,RootFile); 2319 else 2320 filebasesub=fullfile(RootPath,SubDir,RootFile); 2321 end 2322 dirpair=[]; %default 2323 switch NomType 2324 case '_1' 2325 dirpair=dir([filebasesub '_*' FileExt]); 2326 case '_1_1' 2327 dirpair=dir([filebasesub '_*_*' FileExt]); 2328 case '_i1-i2' 2329 dirpair=dir([filebasesub '_*-*' FileExt]); 2330 case '1_ab' 2331 dirpair=dir([filebasesub '*_*' FileExt]); 2332 case '_i_j1-j2' 2333 dirpair=dir([filebasesub '*_*-*' FileExt]); 2334 case '_i1-i2_j' 2335 dirpair=dir([filebasesub '*-*_*' FileExt]); 2336 end 2337 for ifile=1:length(dirpair) 2338 [RootPath,RF,str_1,str_2,str_a,str_b]=name2display(dirpair(ifile).name); 2339 num_i1(ifile)=str2double(str_1); 2340 num_i2(ifile)=str2double(str_2); 2341 if isnan(num_i2(ifile)) 2342 num_i2(ifile)=num_i1(ifile); 2343 end 2344 num_j1(ifile)=stra2num(str_a); 2345 if isnan(num_j1(ifile)) 2346 num_j1(ifile)=1; 2347 end 2348 num_j2(ifile)=stra2num(str_b); 2349 if isnan(num_j2(ifile)) 2350 num_j2(ifile)=num_j1(ifile); 2351 end 2352 end 2353 2291 2292 -
trunk/src/uvmat.m
r326 r332 660 660 end 661 661 end 662 if ~strcmp(hhh,'') && mmreader.isPlatformSupported()% if the functionis found (recent version of matlab)662 if ~strcmp(hhh,'')% if the function mmreader is found (recent version of matlab) 663 663 UvData.MovieObject=mmreader([FileBase FileIndices FileExt]); 664 664 elseif isfield(UvData,'MovieObject') … … 1360 1360 % NomType=get(handles.FileIndex,'UserData'); 1361 1361 switch NomType 1362 case {'_ i_j1-j2','#_ab','%3dab'},% pair with j index1362 case {'_1_1-2','#_ab','%3dab'},% pair with j index 1363 1363 set(handles.fix_pair,'Visible','on')% option fixed pair on/off made visible (choice of avaible pair with buttons + and - if ='off') 1364 1364 otherwise … … 1778 1778 %% read the current input file name(s) and field indices 1779 1779 InputFile=read_GUI(handles.InputFile); 1780 InputFile.RootFile=regexprep(InputFile.RootFile,' \<[\\/]|[\\/]\>','');%suppress possible / or \ separator at the beginning or the end of the string1781 InputFile.SubDir=regexprep(InputFile.SubDir,' \<[\\/]|[\\/]\>','');%suppress possible / or \ separator at the beginning or the end of the string1780 InputFile.RootFile=regexprep(InputFile.RootFile,'^[\\/]|[\\/]$','');%suppress possible / or \ separator at the beginning or the end of the string 1781 InputFile.SubDir=regexprep(InputFile.SubDir,'^[\\/]|[\\/]$','');%suppress possible / or \ separator at the beginning or the end of the string 1782 1782 if isempty(InputFile.RootFile) 1783 1783 filebase=InputFile.RootPath; … … 3149 3149 NomTypeNew=NomType;%default 3150 3150 if isequal(field,'image') 3151 if isequal(NomType,'_ i1-i2_j')||isequal(NomType,'_i_j1-j2')3152 NomTypeNew='_ i_j';3151 if isequal(NomType,'_1-2_1')||isequal(NomType,'_1_1-2') 3152 NomTypeNew='_1_1'; 3153 3153 elseif isequal(NomType,'#_ab') 3154 3154 NomTypeNew='#a'; 3155 elseif isequal(NomType,'_ i1-i2')3156 NomTypeNew='_ i';3155 elseif isequal(NomType,'_1-2') 3156 NomTypeNew='_1'; 3157 3157 end 3158 3158 imagename=name_generator(FileBase,str2double(str1),str2double(str_a),'.png',NomTypeNew,1,str2double(str2),str2double(str_b),''); … … 3270 3270 if isequal(field_1,'image') 3271 3271 % transform netc type to the corresponding image type 3272 if isequal(NomType_1,'_ i1-i2_j')||isequal(NomType_1,'_i_j1-j2')|| isequal(NomType_1,'#_ab')|| isequal(NomType_1,'_i1-i2')3272 if isequal(NomType_1,'_1-2_1')||isequal(NomType_1,'_1_1-2')|| isequal(NomType_1,'#_ab')|| isequal(NomType_1,'_1-2') 3273 3273 UvData.SubDir_1=get(handles.SubDir_1,'String'); %preserve the InputFile.SubDir in memory 3274 if isequal(NomType_1,'_ i1-i2_j')||isequal(NomType_1,'_i_j1-j2')3275 NomTypeNew='_ i_j';3274 if isequal(NomType_1,'_1-2_1')||isequal(NomType_1,'_1_1-2') 3275 NomTypeNew='_1_1'; 3276 3276 elseif isequal(NomType_1,'#_ab') 3277 3277 NomTypeNew='#a'; 3278 elseif isequal(NomType_1,'_ i1-i2')3279 NomTypeNew='_ i';3278 elseif isequal(NomType_1,'_1-2') 3279 NomTypeNew='_1'; 3280 3280 end 3281 3281 end … … 3321 3321 str1=get(handles.i1,'String'); 3322 3322 str_a=get(handles.j1,'String'); 3323 if isequal(NomType_1,'#_ab')||isequal(NomType_1,'_ i1-i2_j')||isequal(NomType_1,'_i_j1-j2')||isequal(NomType_1,'_i1-i2')3323 if isequal(NomType_1,'#_ab')||isequal(NomType_1,'_1-2_1')||isequal(NomType_1,'_1_1-2')||isequal(NomType_1,'_1-2') 3324 3324 NomTypeNew=NomType_1; 3325 3325 elseif isequal(NomType_1,'#a') 3326 3326 [filename, n1,na,n2,nb,SubDir_1]=name_generator(filebase_1, str2num(str1),stra2num(str_a),'.nc','#_ab',0,[],[],SubDir_1); 3327 3327 NomTypeNew='#_ab'; 3328 elseif isequal(NomType_1,'_ i_j')3329 [filename,n1,na,n2,nb,SubDir_1]=name_generator(filebase_1,str2num(str1),stra2num(str_a),'.nc','_ i1-i2_j',0,str2num(str1),[],SubDir_1);3328 elseif isequal(NomType_1,'_1_1') 3329 [filename,n1,na,n2,nb,SubDir_1]=name_generator(filebase_1,str2num(str1),stra2num(str_a),'.nc','_1-2_1',0,str2num(str1),[],SubDir_1); 3330 3330 if idetect==1 3331 NomTypeNew='_ i1-i2_j';3331 NomTypeNew='_1-2_1'; 3332 3332 else 3333 NomTypeNew='_ i_j1-j2';3333 NomTypeNew='_1_1-2'; 3334 3334 end 3335 3335 else %for instance avi files or any ima_num series 3336 [filename,n1,na,n2,nb,SubDir_1]=name_generator(filebase_1,str2num(str1),stra2num(str_a),'.nc','_ i1-i2',0,str2num(str1),[],SubDir_1);3337 NomTypeNew='_ i1-i2';3336 [filename,n1,na,n2,nb,SubDir_1]=name_generator(filebase_1,str2num(str1),stra2num(str_a),'.nc','_1-2',0,str2num(str1),[],SubDir_1); 3337 NomTypeNew='_1-2'; 3338 3338 end 3339 3339 [Path,Name]=fileparts(filebase_1);
Note: See TracChangeset
for help on using the changeset viewer.