Changeset 122 for trunk/src/civ.m
- Timestamp:
- Nov 14, 2010, 9:58:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r120 r122 67 67 ext=[]; 68 68 testall=0; 69 browse=[];70 69 %default input parameters: 71 70 num1=1; % set of field i numbers 72 num2= 2; % set of field i numbers71 num2=1; % set of field i numbers 73 72 num_a=1; % set of field j numbers (fields a) 74 73 num_b=1; % second set of field j numbers (fields b) … … 87 86 ext=param.ImaExt; 88 87 end 89 if ~isempty(ext) && (~isempty(imformats(ext(2:end)))||... 90 strcmp(lower(ext),'.avi'));%if an image file has been opened by uvmat 88 browse.num_i1=num1; 89 browse.num_i2=num2; 90 browse.num_j1=num_a; 91 browse.num_j2=num_b; 92 if ~isempty(ext) && (~isempty(imformats(ext(2:end)))||strcmpi(ext,'.avi'));%if an image file has been opened by uvmat 91 93 set(handles.ImaExt,'String',ext) 92 94 if exist('nom_type_read','var') … … 102 104 set(handles.ImaDoc,'String',ext) 103 105 104 %read names of the .exe file to adjust the interface according to 105 %available binaries 106 %read names of the .exe file to adjust the interface according to available binaries 106 107 path_uvmat=which('uvmat');% check the path detected for source file uvmat 107 108 path_UVMAT=fileparts(path_uvmat); %path to UVMAT … … 315 316 browse=get(handles.browse_root,'UserData'); 316 317 end 317 if length(ext)>1 && (~isempty(imformats(ext(2:end)))||... 318 isequal(ext,'.avi')||isequal(ext,'.AVI'));%if an image file has been opened by uvmat 319 set(handles.ImaExt,'String',ext) 318 browse.num_i1=num_i1; 319 browse.num_i2=num_i2; 320 browse.num_j1=num_j1; 321 browse.num_j2=num_j2; 322 if length(ext)>1 && (~isempty(imformats(ext(2:end)))||strcmpi(ext,'.avi'));%if an image file has been opened by uvmat 323 % set(handles.ImaExt,'String',ext) 320 324 browse.nom_type_ima=nom_type; 321 browse. field_count=num_i1;325 browse.ext_ima=ext; 322 326 end 323 327 set(handles.ImaDoc,'String',ext); … … 437 441 %------------------------------------------------------------------------ 438 442 set(handles.compare,'Visible','on') 439 ext_ima=get(handles.ImaExt,'String'); 443 %ext_ima=get(handles.ImaExt,'String'); 444 ext_ima='';%default 440 445 nom_type_ima=[];%default 441 446 field_count=1;%default … … 447 452 pxcmy_search=[];%default 448 453 filebase=get(handles.RootName,'String'); 449 450 454 ext=get(handles.ImaDoc,'String'); 451 455 browse=get(handles.browse_root,'UserData');%default 452 if ~isempty(browse) 453 if isfield(browse,'nom_type_ima') 454 nom_type_ima=browse.nom_type_ima;% get an image nomenclature type already determined by an input image name 455 end 456 if isfield(browse,'field_count') 457 field_count=browse.field_count;% get an image index type already determined by an input file 458 end 456 if isfield(browse,'nom_type_ima') 457 nom_type_ima=browse.nom_type_ima;% get an image nomenclature type already determined by an input image name 458 ext_ima=browse.ext_ima; 459 end 460 if isfield(browse,'nom_type_nc') 461 nom_type_nc=browse.nom_type_nc;% get an image nomenclature type already determined by an input image name 462 end 463 if isfield(browse,'num_i1') 464 field_count=browse.num_i1;% get an image index type already determined by an input file 459 465 end 460 466 … … 522 528 testima_xml=0; 523 529 if isequal(ext,'.civxml')%TO ABANDON 524 [nbfield,nb urst,time]=read_civxml([filebase '.civxml']);530 [nbfield,nbfield2,time]=read_civxml([filebase '.civxml']); 525 531 mode='pair j1-j2'; 526 532 if isempty(nom_type_ima)% dtermine types by default if not already selected by browser or uvmat … … 541 547 time=XmlData.Time; 542 548 nbfield=size(time,1); 543 nb urst=size(time,2);549 nbfield2=size(time,2); 544 550 %transform .Time to a column vector if it is a line vector the nomenclature uses a single index 545 if isequal(nbfield,1) && ~isequal(nb urst,1)% .Time is a line vector551 if isequal(nbfield,1) && ~isequal(nbfield2,1)% .Time is a line vector 546 552 if numel(nom_type_read)>=2 && (strcmp(nom_type_read,'_i')||strcmp(nom_type_read(1:2),'%0')||strcmp(nom_type_read(1:2),'_%')) 547 553 time=time'; 548 nbfield=nb urst;549 nb urst=1;554 nbfield=nbfield2; 555 nbfield2=1; 550 556 end 551 557 end … … 572 578 end 573 579 if ~isempty(ext_ima_read) && ~isempty(nom_type_read) 574 if isempty(ext_ima)575 ext_ima=ext_ima_read;% define image extension from the xml file if an image has not been opened previously576 else %keep the image extension577 if ~strcmp(ext_ima_read,ext_ima)578 msgbox_uvmat('WARNING',['FirtsImage extension ' ext_ima_read ' announced in the xml file inconsistent with the selected image'])579 end580 end580 % if isempty(ext_ima) 581 % ext_ima=ext_ima_read;% define image extension from the xml file if an image has not been opened previously 582 % else %keep the image extension 583 % if ~strcmp(ext_ima_read,ext_ima) 584 % msgbox_uvmat('WARNING',['FirtsImage extension ' ext_ima_read ' announced in the xml file inconsistent with the selected image']) 585 % end 586 % end 581 587 nom_type_ima=nom_type_read; 582 588 end 583 elseif isequal(ext,'.civ')% case of .civ image documentation file589 elseif strcmp(ext,'.civ')% case of .civ image documentation file 584 590 [error,time,TimeUnit,mode,npx,npy]=read_imatext([filebase '.civ']); 585 591 if error==2, msgbox_uvmat('WARNING',['no file ' filebase '.civ']); … … 588 594 % ImaExt='.png'; 589 595 nom_type_ima='png_old'; 590 elseif isequal(lower(ext),'.avi')596 elseif strcmpi(ext,'.avi') 591 597 nom_type_ima='*'; 592 598 ext_ima=ext; … … 606 612 set(handles.ImaDoc,'BackgroundColor',[1 1 1]) 607 613 608 %get the imabe nomenclature type if not defiend by the input file nor by the xml file 614 %get the imabe nomenclature type if not defined by the input file nor by the xml file 615 dirima=[];%default 609 616 if isempty(nom_type_ima) 610 617 %look for double image series '_i_j' … … 616 623 % look for other images series 617 624 dirima=dir([filebase '*' num2str(first_i) '.*']); 618 if ~isempty(dirima) 619 [pp,ff,fc,str2,str_a,str_b,ext_ima,nom_type_ima]=name2display(dirima(1).name); 620 end 621 else 622 [pp,ff,fc,str2,str_a,str_b,ext_ima,nom_type_ima]=name2display(dirima(1).name); 623 end 624 else 625 [pp,ff,fc,str2,str_a,str_b,ext_ima,nom_type_ima]=name2display(dirima(1).name); 626 end 627 end 628 % no image documentation file found: look for a series of existing images or .nc files 629 if isempty(time) && ~isequal(ext,'.nc') && ~strcmp(nom_type_ima,'none') && ~strcmp(nom_type_ima,'') && ~strcmp(nom_type_ima,'*') 625 if isempty(dirima) 626 % look for other images series witth letter appendix 627 appendix=char(96+first_j); 628 dirima=dir([filebase '*' num2str(first_i) appendix '.*']); 629 % if ~isempty(dirima) 630 % [pp,ff,fc,str2,str_a,str_b,ext_ima,nom_type_ima]=name2display(dirima(1).name); 631 % end 632 % else 633 % [pp,ff,fc,str2,str_a,str_b,ext_ima,nom_type_ima]=name2display(dirima(1).name); 634 end 635 % else 636 % [pp,ff,fc,str2,str_a,str_b,ext_ima,nom_type_ima]=name2display(dirima(1).name); 637 end 638 % else 639 % [pp,ff,fc,str2,str_a,str_b,ext_ima,nom_type_ima]=name2display(dirima(1).name); 640 end 641 end 642 for ilist=1:numel(dirima) 643 [pp,ff,fc,str2,str_a,str_b,ext_list,nom_type_list]=name2display(dirima(ilist).name); 644 form=imformats(ext_list(2:end)); 645 if ~isempty(form)% if the extension corresponds to an image format recognized by Matlab 646 ext_ima=ext_list; 647 nom_type_ima=nom_type_list; 648 break 649 end 650 end 651 % no image documentation file found: look for a series of existing files,images by priority or .nc files 652 if isempty(nom_type_ima) 653 ext_search=ext; 654 nom_type_search=nom_type_nc; 655 else 656 ext_search=ext_ima; 657 nom_type_search=nom_type_ima; 658 end 659 if isempty(time) && ~strcmp(nom_type_search,'none') && ~strcmp(nom_type_search,'') && ~strcmp(nom_type_search,'*') 630 660 subdir=get(handles.subdir_civ1,'String'); 631 661 incr_pair=[0 0];%default … … 634 664 end 635 665 % nbdetect=0;%test of detected images 636 field_i= field_count;666 field_i=browse.num_i2; 637 667 idetect=1; 638 668 while idetect==1 %look for the maximum file number in the series 639 imagename=name_generator(filebase,field_i+1,1,ext_ ima,nom_type_ima);669 imagename=name_generator(filebase,field_i+1,1,ext_search,nom_type_search); 640 670 idetect=(exist(imagename,'file')==2); 641 671 if idetect … … 645 675 % nbdetect=nbdetect+(exist(imagename,'file')==2); 646 676 end 647 nb _field=field_i;% last detected field number648 field_i= field_count;%look for the minimum file number in the series677 nbfield=field_i;% last detected field number 678 field_i=browse.num_i1;%look for the minimum file number in the series 649 679 idetect=1; 650 680 while idetect==1 651 imagename=name_generator(filebase,field_i-1,1,ext_ ima,nom_type_ima);681 imagename=name_generator(filebase,field_i-1,1,ext_search,nom_type_search); 652 682 idetect=(exist(imagename,'file')==2); 653 683 if idetect … … 655 685 end 656 686 end 657 first_i=max(field_i,1); 658 659 switch nom_type_ima 660 case {'_i_j','%01dA','%02dA','%03dA','%04dA'} 661 field_i=field_count; 662 field_j=1; 687 first_i=max(field_i,1); 688 if numel(regexp(nom_type_search,'\D'))>=1%two indices i and j 689 field_i=browse.num_i1; 690 field_j=browse.num_j2; 663 691 jdetect=1; 664 692 while jdetect==1 %look for the maximum file number in the series 665 imagename=name_generator(filebase,field_i,field_j,ext_ ima,nom_type_ima);693 imagename=name_generator(filebase,field_i,field_j,ext_search,nom_type_search); 666 694 jdetect=(exist(imagename,'file')==2); 667 695 if jdetect … … 671 699 % nbdetect=nbdetect+(exist(imagename,'file')==2); 672 700 end 673 nb _field_j=field_j-1;% last detected field number701 nbfield2=field_j;% last detected field number 674 702 end 675 676 677 703 678 704 %determine the set of times and possible intervals for CIV 679 705 % dt=(1/1000)*str2num(get(handles.dt,'String')); 680 time=(0:nb _field-1)';% time=file index -1 by default681 682 switch nom_type_ima 683 case {'_i_j','%01dA','%02dA','%03dA','%04dA'}706 time=(0:nbfield-1)';% time=file index -1 by default 707 if numel(regexp(nom_type_search,'\D'))>=1%two indices i and j 708 % switch nom_type_search 709 % case {'_i_j','%01dA','%02dA','%03dA','%04dA'} 684 710 % time=[0:nb_field-1]'*ones(1,nb_field_j);% time=file index -1 by default 685 [x,y]=meshgrid( [0:2-1],[0:152-1]);711 [x,y]=meshgrid(0:nbfield2-1,0:nbfield-1); 686 712 time=x+y; 687 713 % time=[0:nb_field-1]'*[0:nb_field_j-1];% time=file index -1 by default 688 714 end 689 690 691 set(handles.mode,'String',{'series(Di)'}) 692 end 693 % if isequal(nom_type_ima,'none')% no file numbering used 694 % first_i=1; 695 % last_i=1; 696 % first_j=1; 697 % last_j=1; 698 % end 715 % set(handles.mode,'String',{'series(Di)'}) 716 end 699 717 700 718 if exist('time','var') … … 722 740 723 741 %%%%%%%%%%% set the menus of image pairs and default selection for civ %%%%%%%%%%%%%%%%%%% 724 if isequal(nom_type_ima,'_i')|| isequal(nom_type_nc,'_i1-i2')||~(exist('nbfield2','var')&&(nbfield2~=1)) 742 test_ima_i=numel(nom_type_ima)>1 && isempty(regexp(nom_type_ima(2:end),'\D'));%images with single indexing 743 if test_ima_i || isequal(nom_type_nc,'_i1-i2')||~(exist('nbfield2','var')&&(nbfield2~=1)) 725 744 set(handles.mode,'String',{'series(Di)'}) 726 set(handles.mode,'Value',1)727 elseif isequal(nom_type_ima,'png_old')||isequal(nom_type_nc,'netc_old')728 set(handles.mode,'String',{'pair j1-j2'})729 745 set(handles.mode,'Value',1) 730 746 elseif (nbfield==1)% simple series in j … … 733 749 else 734 750 set(handles.mode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice 735 if nbfield2 <= 5751 if nbfield2 <= 10 736 752 set(handles.mode,'Value',1)% advice 'pair j1-j2' for small burst 737 753 end 738 % else739 % if isequal(mode,'volume')740 % set(handles.mode,'Value',3)741 % elseif nbfield2 <= 5742 % set(handles.mode,'Value',1)% advice 'pair j1-j2' for small bursts743 % else744 % set(handles.mode,'Value',2)% advice series Dj for long bursts, not volume745 % end746 754 end 747 755 … … 777 785 set(handles.RUN, 'Enable','On') 778 786 set(handles.RUN,'BackgroundColor',[1 0 0]) 779 780 787 set(handles.BATCH,'Enable','On') 788 set(handles.BATCH,'BackgroundColor',[1 0 0]) 781 789 782 790 %%%%% store the root input filename for future opening … … 2165 2173 end 2166 2174 end 2167 2168 2169 2170 2175 if batch 2171 2176 if isfield(sparam,'BatchMode') … … 2184 2189 set(handles.waitbar_civ2,'Position',[0.946 0.219 0.03 0.001]) 2185 2190 set(handles.waitbar_patch2,'Position',[0.946 0.0 0.03 0.001]) 2186 2187 2191 drawnow 2188 %get the filename root, nomenclature and numbers2189 2190 % for Windows system find the UBC path name if needed2191 % if ~isunix & isequal(todo_path(1:2),'\\') & isequal(filebase(2:3),':\')2192 % cur_dir=pwd;2193 % if ~isequal(cur_dir(2:3),':\')2194 % cd(matlabroot); %move to the Matlab root directory if the current Matlab dir does not allow the dos command or is M:2195 % end2196 % [ss,ww]=dos(['net use ' filebase(1:2)]);2197 % if isequal(ss,0)2198 % rankpath=findstr(ww,'\\');2199 % if ~isempty(rankpath)2200 % wwrest=ww(rankpath:end);2201 % rankend=min(find(double(wwrest)==10))-1;2202 % filebase=[wwrest(1:rankend) filebase(3:end)];2203 % set(handles.RootName,'String',filebase);2204 % end2205 % else2206 % msgbox_uvmat('ERROR','for BATCH option, UBC file names, beginning by \\, are needed');2207 % % set(handles.BATCH, 'Enable','On')2208 % % set(handles.BATCH,'BackgroundColor',[1 0 0])2209 % return2210 % end2211 % end2212 2192 2213 2193 % set the list of files and check them … … 2240 2220 [s,w]=unix('ps faux |grep civ|wc -l'); 2241 2221 w(end)=[]; 2242 str2num(w)+numel(num1_civ1)2243 2222 if str2num(w)+numel(num1_civ1)> MaxCivProcesses 2244 2223 msgbox_uvmat('ERROR',{['There are already ' w ' civ processes running locally'];'Use BATCH or submit RUN later'}) … … 2247 2226 end 2248 2227 end 2249 2250 2228 display('files OK, processing...') 2251 2229 nbfield=numel(num1_civ1); … … 2325 2303 %%%%%%%%%%%%%%%%%%% 2326 2304 end 2327 2328 2329 2305 2330 2306 %get patch2 parameters … … 2812 2788 ext_ima=get(handles.ImaExt,'String'); 2813 2789 nom_type_nc=browse.nom_type_nc; 2814 nom_type_ima2=browse.nom_type_ima; 2815 if isequal(nom_type_ima2,[]),nom_type_ima2='ima_num';end; %default 2816 if isequal(nom_type_nc,[]),nom_type_nc='_i1-i2';end; %default 2790 if isfield(browse,'nom_type_ima') 2791 nom_type_ima2=browse.nom_type_ima; 2792 end 2793 if isempty(nom_type_ima2),nom_type_ima2='1';end; %default 2794 if isempty(nom_type_nc),nom_type_nc='_i1-i2';end; %default 2817 2795 [num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2]=... 2818 2796 find_pair_indices(handles,mode); … … 2950 2928 if ~exist(file_ref,'file') 2951 2929 msgbox_uvmat('ERROR',['reference file ' file_ref ' not found for fix2']) 2952 filecell= [];2930 filecell={}; 2953 2931 return 2954 2932 end … … 2967 2945 if ~exist(Path_ima,'dir') 2968 2946 msgbox_uvmat('ERROR',['path to images ' Path_ima ' not found']) 2969 filecell= [];2947 filecell={}; 2970 2948 return 2971 2949 end … … 2974 2952 m2=''; 2975 2953 [erread,message]=fileattrib(Path_ima); 2976 if ~isempty(message) & ~isequal(message.UserWrite,1)2954 if ~isempty(message) && ~isequal(message.UserWrite,1) 2977 2955 msgbox_uvmat('ERROR',['No writting access to ' Path_ima]) 2978 filecell= [];2956 filecell={}; 2979 2957 cd(currentdir); 2980 2958 return … … 2986 2964 detect=1; 2987 2965 while detect==1 %create a new subdir if the netcdf files already exist 2988 for ifile=1:nbfield; 2966 vers=0; 2967 subdir_civ1_new=subdir_civ1; 2968 for ifile=1:nbfield 2989 2969 for j=1:nbslice 2990 filename=name_generator(filebase_nc,num1_civ1(ifile),num_a_civ1(j),'.nc',nom_type_nc,1,num2_civ1(ifile),num_b_civ1(j),subdir_civ1 );2970 filename=name_generator(filebase_nc,num1_civ1(ifile),num_a_civ1(j),'.nc',nom_type_nc,1,num2_civ1(ifile),num_b_civ1(j),subdir_civ1_new); 2991 2971 detect=exist(filename,'file')==2; 2992 2972 if detect% if a netcdf file already exists 2993 subdir_civ1=[subdir_civ1 '.0']; 2973 vers=vers+1; 2974 subdir_civ1_new=[subdir_civ1 '_' num2str(vers)]; 2994 2975 subdir_civ2=subdir_civ1; 2995 2976 break … … 3001 2982 end 3002 2983 end 2984 subdir_civ1=subdir_civ1_new; 3003 2985 %create the new subdir_civ1 3004 2986 if ~exist(fullfile(Path_ima,subdir_civ1),'dir') 3005 2987 [m1,m2,m3]=mkdir(subdir_civ1); 3006 2988 if ~isequal(m2,'') 3007 msgbox_uvmat('ERROR', m2) 3008 %msgbox(m2);%error message for directory creation 2989 msgbox_uvmat('ERROR', m2)%error message for directory creation 2990 cd(currentdir) 2991 filecell={}; 2992 return 3009 2993 end 3010 2994 end 3011 2995 if strcmp(compare,'stereo PIV')&&(strcmp(mode,'pair j1-j2')||strcmp(mode,'series(Dj)')||strcmp(mode,'series(Di)'))%check second nc series 2996 vers=0; 2997 subdir_civ1_new=subdir_civ1; 3012 2998 for ifile=1:nbfield 3013 2999 for j=1:nbslice 3014 filename=name_generator(filebase_A,num1_civ1(ifile),num_a_civ1(j),'.nc',nom_type_nc,1,num2_civ1(ifile),num_b_civ1(j),subdir_civ1 );%3000 filename=name_generator(filebase_A,num1_civ1(ifile),num_a_civ1(j),'.nc',nom_type_nc,1,num2_civ1(ifile),num_b_civ1(j),subdir_civ1_new);% 3015 3001 detect=exist(filename,'file')==2; 3016 3002 if detect% if a netcdf file already exists 3017 subdir_civ1=[subdir_civ1 '.0']; 3003 vers=vers+1; 3004 subdir_civ1_new=[subdir_civ1 '_' num2str(vers)]; 3018 3005 subdir_civ2=subdir_civ1; 3019 3006 break … … 3025 3012 end 3026 3013 end 3014 subdir_civ1=subdir_civ1_new; 3027 3015 %create the new subdir_civ1 3028 3016 if ~exist(fullfile(Path_ima,subdir_civ1),'dir') … … 3030 3018 if ~isequal(m2,'') 3031 3019 msgbox_uvmat('ERROR', m2) 3020 cd(currentdir) 3021 filecell={}; 3022 return 3032 3023 end 3033 3024 end … … 3047 3038 if idetectmin==0, 3048 3039 msgbox_uvmat('ERROR',[filecell.ima1.civ1{ifile,indexj} ' not found']) 3049 filecell=[]; 3040 filecell={}; 3041 cd(currentdir) 3050 3042 return 3051 3043 end … … 3053 3045 if idetectmin==0, 3054 3046 msgbox_uvmat('ERROR',[filecell.ima2.civ1{ifile,indexj} ' not found']) 3055 filecell= [];3047 filecell={}; 3056 3048 cd(currentdir) 3057 3049 return … … 3071 3063 if idetectmin==0, 3072 3064 msgbox_uvmat('ERROR',[filecell.imaA1.civ1{ifile,indexj} ' not found']) 3073 filecell= [];3065 filecell={}; 3074 3066 cd(currentdir) 3075 3067 return … … 3078 3070 if idetectmin==0, 3079 3071 msgbox_uvmat('ERROR',[filecell.imaA2.civ1{ifile,indexj} ' not found']) 3080 filecell= [];3072 filecell={}; 3081 3073 cd(currentdir) 3082 3074 return … … 3092 3084 nom_type_nc,1,num2_civ1(ifile),num_b_civ1(j),subdir_civ1);% 3093 3085 detect=exist(filename,'file')==2; 3086 if detect==0 3087 msgbox_uvmat('ERROR',[filename ' not found']) 3088 filecell={}; 3089 cd(currentdir) 3090 return 3091 end 3094 3092 filecell.nc.civ1(ifile,j)={filename}; 3095 3093 end … … 3104 3102 set(handles.RUN, 'Enable','On') 3105 3103 set(handles.RUN,'BackgroundColor',[1 0 0]) 3106 % set(handles.BATCH, 'Enable','On') 3107 % set(handles.BATCH,'BackgroundColor',[1 0 0]) 3108 filecell=[]; 3104 filecell={}; 3109 3105 cd(currentdir) 3110 3106 return … … 3141 3137 if ~isequal(m2,'') 3142 3138 msgbox_uvmat('ERROR', m2) 3139 filecell={}; 3140 cd(currentdir) 3141 return 3143 3142 end 3144 3143 end 3145 3144 if strcmp(compare,'stereo PIV')%check second nc series 3145 vers=0; 3146 subdir_civ2_new=subdir_civ2; 3146 3147 for ifile=1:nbfield 3147 3148 for j=1:nbslice 3148 3149 filename=name_generator(filebase_A,num1_civ2(ifile),num_a_civ2(j),'.nc',... 3149 nom_type_nc,1,num2_civ2(ifile),num_b_civ1(j),subdir_civ2 );%3150 nom_type_nc,1,num2_civ2(ifile),num_b_civ1(j),subdir_civ2_new);% 3150 3151 detect=exist(filename,'file')==2; 3151 3152 if detect% if a netcdf file already exists 3152 subdir_civ2=[subdir_civ2 '.0']; 3153 vers=vers+1; 3154 subdir_civ2_new=[subdir_civ2 '_' num2str(vers)]; 3153 3155 break 3154 3156 end … … 3159 3161 end 3160 3162 end 3163 subdir_civ2=subdir_civ2_new; 3161 3164 %create the new subdir_civ1 3162 3165 if ~exist(fullfile(Path_ima,subdir_civ2),'dir') 3163 3166 [m1,m2,m3]=mkdir(subdir_civ2); 3164 3167 if ~isequal(m2,'') 3165 msgbox_uvmat('ERROR', m2) 3166 %msgbox(m2);%error message for directory creation 3168 msgbox_uvmat('ERROR', m2)%error message for directory creation 3169 cd(currentdir) 3170 filecell={}; 3171 return 3167 3172 end 3168 3173 end … … 3171 3176 end 3172 3177 cd(currentdir);%come back to the current working directory 3173 3174 3178 3175 3179 %%%%%%%%%%%%% if civ2 results are obtained or used %%%%%%%%%%%%% … … 3184 3188 if ~exist(filename,'file') 3185 3189 msgbox_uvmat('ERROR',['input file ' filename ' not found']) 3186 filecell= [];3190 filecell={}; 3187 3191 return 3188 3192 end … … 3216 3220 set(handles.RUN, 'Enable','On') 3217 3221 set(handles.RUN,'BackgroundColor',[1 0 0]) 3218 % set(handles.BATCH, 'Enable','On')3219 % set(handles.BATCH,'BackgroundColor',[1 0 0])3220 cd(currentdir)3221 3222 return 3222 3223 end … … 4233 4234 %------------------------------------------------------------------------ 4234 4235 % --- transform numbers to letters 4235 function str=num2stra(num,nom_type); 4236 %------------------------------------------------------------------------ 4237 if isequal(nom_type,'png_old') | isequal(nom_type,'netc_old') |isequal(nom_type,'raw_SMD') 4236 function str=num2stra(num,nom_type) 4237 %------------------------------------------------------------------------ 4238 if isempty(nom_type) 4239 str=''; 4240 elseif strcmp(nom_type(end),'a') 4238 4241 str=char(96+num); 4239 elseif isequal(nom_type,'_i')|isequal(nom_type,'_i1-i2')... 4240 |isequal(nom_type,'ima_num')| isequal(nom_type,'avi')| isequal(nom_type,'none') 4242 elseif strcmp(nom_type(end),'A') 4243 str=char(96+num); 4244 elseif isempty(nom_type(2:end))%a single index 4241 4245 str=''; 4242 4246 else … … 5065 5069 fprintf(fid, ['PixCmXY ' par.pxcmx ' ' par.pxcmy '\n' ]); 5066 5070 fprintf(fid, ['XX 1' '\n' ]); 5067 fprintf(fid, ['ShiftXY 0 0\n']);5071 fprintf(fid, 'ShiftXY 0 0\n'); 5068 5072 fprintf(fid, ['Grid ' par.gridflag '\n' ]); 5069 5073 fprintf(fid, ['GridName ' regexprep(par.gridname,'\\','\\\\') '\n']); … … 5246 5250 fileinput=[PathName FileName]; 5247 5251 sizf=size(fileinput); 5248 if (~ischar(fileinput)| ~isequal(sizf(1),1)),return;end %stop if fileinput not a character string5252 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end %stop if fileinput not a character string 5249 5253 [Path,File,field_count,str2,str_a,str_b,ref.ext,ref.nom_type,ref.subdir]=name2display(fileinput); 5250 5254 ref.filebase=fullfile(Path,File);
Note: See TracChangeset
for help on using the changeset viewer.