Changeset 205
- Timestamp:
- Feb 20, 2011, 5:33:46 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r188 r205 55 55 %-------------------------------------------------------------------------- 56 56 function series_OpeningFcn(hObject, eventdata, handles,param) 57 global nb_builtin nb_transform57 global nb_builtin_ACTION nb_builtin_transform 58 58 % Choose default command line output for series 59 59 handles.output = hObject; … … 65 65 %load the list of previously browsed files in menus Open and Open_1 66 66 dir_perso=prefdir; 67 test_profil_perso=0; 67 68 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 68 69 if exist(profil_perso,'file') 69 70 h=load (profil_perso); 71 test_profil_perso=1; 70 72 if isfield(h,'MenuFile_1') 71 73 set(handles.MenuFile_1,'Label',h.MenuFile_1); … … 136 138 fct_menu={'check_files';'aver_stat';'time_series';'merge_proj';'clean_civ_cmx'}; 137 139 transform_menu={'';'phys';'px';'phys_polar'}; 138 nb_builtin =numel(fct_menu); %number of functions140 nb_builtin_ACTION=numel(fct_menu); %number of functions 139 141 nb_transform=numel(transform_menu); 140 142 [path_series,name,ext]=fileparts(which('series')); … … 147 149 %TRANSFORM menu: loads the information stored in prefdir to initiate the list of field transform functions 148 150 menu_str={'';'phys';'px';'phys_polar'}; 149 nb_builtin =numel(menu_str); %number of functions151 nb_builtin_transform=numel(menu_str); %number of functions 150 152 [path_uvmat,name,ext]=fileparts(which('uvmat')); 151 153 addpath(fullfile(path_uvmat,'transform_field')) … … 163 165 164 166 % read the list of functions stored in the personal file 'uvmat_perso.mat' in prefdir 165 dir_perso=prefdir; 166 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 167 if exist(profil_perso,'file') 168 h=load (profil_perso); 167 if test_profil_perso 169 168 if isfield(h,'series_fct') && iscell(h.series_fct) 170 169 for ilist=1:length(h.series_fct) 171 170 [path,file]=fileparts(h.series_fct{ilist}); 172 171 fct_path=[fct_path; {path}];%concatene the list of paths 173 transform_menu=[transform_menu; {file}];172 fct_menu=[fct_menu; {file}]; 174 173 end 175 174 end … … 259 258 SeriesData=[];%dfault 260 259 if isequal(ext,'.xml') 261 errordlg('input file type not implemented')%A Faire: ouvrir le fichier pour naviguer260 warndlg_uvmat('ERROR','input file type not implemented')%A Faire: ouvrir le fichier pour naviguer 262 261 elseif isequal(ext,'.xls') 263 errordlg('input file type not implemented')%A Faire: ouvrir le fichier pour naviguer262 warndlg_uvmat('ERROR','input file type not implemented')%A Faire: ouvrir le fichier pour naviguer 264 263 else 265 264 update_file(hObject, eventdata, handles,fileinput,0) … … 295 294 end 296 295 end 297 % set(hseries,'UserData',SeriesData);298 % RootFile_Callback(hObject, eventdata, handles);299 % FileExt_Callback(hObject, eventdata, handles);300 % NomType_Callback(hObject, eventdata, handles)301 % mode_Callback(hObject, eventdata, handles)302 296 303 297 … … 538 532 time=[];%default 539 533 GeometryCalib=[];%default 540 nb_field= [];%default541 nb_field2= [];%default534 nb_field=NaN;%default 535 nb_field2=NaN;%default 542 536 SeriesData.PathCampaign=get(handles.PathCampaign,'String'); 543 537 … … 549 543 testima=1; 550 544 info=aviinfo([FileBase FileExt]); 551 time= [0:1/info.FramesPerSecond:(info.NumFrames-1)/info.FramesPerSecond]';545 time=(0:1/info.FramesPerSecond:(info.NumFrames-1)/info.FramesPerSecond)'; 552 546 nb_field=info.NumFrames; 553 547 nb_field2=1; … … 703 697 nb_field2=max(floor((max(num_j1)+max(num_j2))/2)); 704 698 end 705 if is empty(nb_field)||isnan(nb_field)699 if isnan(nb_field) 706 700 nb_field_str='?'; 707 701 nb_field_str2='?'; … … 888 882 end 889 883 switch NomType 890 case {'_ i_j','_i_j1-j2','_i1-i2_j','#_ab'},% two navigation indices884 case {'_1_1','_i_j1-j2','_i1-i2_j','1_ab','01_ab'},% two navigation indices 891 885 state_j='on'; 892 886 end … … 1367 1361 if last_i < first_i | last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),... 1368 1362 set(handles.RUN, 'Enable','On'), set(handles.RUN,'BackgroundColor',[1 0 0]),return,end; 1369 num_i= [first_i:incr_i:last_i];1370 num_j= [first_j:incr_j:last_j];1363 num_i=first_i:incr_i:last_i; 1364 num_j=first_j:incr_j:last_j; 1371 1365 nbfield_cell=get(handles.nb_field,'String'); 1372 1366 nbfield=[]; %default … … 1582 1576 function ACTION_Callback(hObject, eventdata, handles) 1583 1577 %------------------------------------------------------------------------ 1584 global nb_builtin 1578 global nb_builtin_ACTION 1585 1579 list_ACTION=get(handles.ACTION,'String');% list menu fields 1586 1580 index_ACTION=get(handles.ACTION,'Value');% selected string index … … 1610 1604 index_ACTION=get(handles.ACTION,'Value');% currently selected index in the list 1611 1605 list_path{index_ACTION}=PathName; 1612 if length(menu_str)>nb_builtin +5; %nb_builtin=nbre of functions always remaining in the initial menu1613 nbremove=length(menu_str)-nb_builtin -5;1614 menu_str(nb_builtin +1:end-5)=[];1615 list_path(nb_builtin +1:end-4)=[];1606 if length(menu_str)>nb_builtin_ACTION+5; %nb_builtin=nbre of functions always remaining in the initial menu 1607 nbremove=length(menu_str)-nb_builtin_ACTION-5; 1608 menu_str(nb_builtin_ACTION+1:end-5)=[]; 1609 list_path(nb_builtin_ACTION+1:end-4)=[]; 1616 1610 index_ACTION=index_ACTION-nbremove; 1617 1611 set(handles.ACTION,'Value',index_ACTION) … … 1625 1619 dir_perso=prefdir; 1626 1620 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 1627 for ilist=nb_builtin +1:length(menu_str)-11628 series_fct{ilist-nb_builtin }=fullfile(list_path{ilist},[menu_str{ilist} '.m']);1621 for ilist=nb_builtin_ACTION+1:length(menu_str)-1 1622 series_fct{ilist-nb_builtin_ACTION}=fullfile(list_path{ilist},[menu_str{ilist} '.m']); 1629 1623 end 1630 if exist(profil_perso,'file') 1624 if nb_builtin_ACTION+1>=length(menu_str)-1 1625 if exist(profil_perso,'file') && nb_builtin_ACTION+1>=length(menu_str)-1 1631 1626 save(profil_perso,'series_fct','-append') 1632 1627 else … … 1639 1634 save(profil_perso, 'series_fct') 1640 1635 end 1636 end 1641 1637 end 1642 1638 end … … 2341 2337 dirpair=[]; %default 2342 2338 switch NomType 2343 case '_ i'2339 case '_1' 2344 2340 dirpair=dir([filebasesub '_*' FileExt]); 2345 case '_ i_j'2341 case '_1_1' 2346 2342 dirpair=dir([filebasesub '_*_*' FileExt]); 2347 2343 case '_i1-i2' 2348 2344 dirpair=dir([filebasesub '_*-*' FileExt]); 2349 case ' #_ab'2345 case '1_ab' 2350 2346 dirpair=dir([filebasesub '*_*' FileExt]); 2351 2347 case '_i_j1-j2' … … 2354 2350 dirpair=dir([filebasesub '*-*_*' FileExt]); 2355 2351 end 2356 % nom_type='#' series of indexed images wich is not series_i2357 % [filebase index ext], e.g. 'aa045.jpg' or 'aa45.tif'2358 % nom_type='#a','#A' with a numerical index and an index letter(e.g.'aa045b.png'), OBSOLETE (replaced by 'series_i_j')2359 % nom_type='%03d' or '%04d', series of indexed images with numbers completed with zeros to 3 or 4 digits, e.g.'aa045.tif'2360 % nom_type='_%03d', '_%04d', or '_%05d', series of indexed images with _ and numbers completed with zeros to 3, 4 or 5 digits, e.g.'aa_045.tif'2361 % nom_type='raw_SMD', same as '#a' but with no extension ext='', OBSOLETE2362 % nom_type='#_ab' from pairs of '#a' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')2363 % nom_type='%3dab' from pairs of '%3da' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')2364 2352 for ifile=1:length(dirpair) 2365 2353 [RootPath,RF,str_1,str_2,str_a,str_b]=name2display(dirpair(ifile).name);
Note: See TracChangeset
for help on using the changeset viewer.