Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r397 r398 395 395 396 396 %% scan the image file series 397 [RootPath,FileName,ImaExt]=fileparts(fileinput); 398 [RootFile,i1_series,tild,j1_series,tild,NomTypeIma,FileType,Object]=find_file_series(RootPath,[FileName ImaExt]); 399 if strcmp(NomTypeInput,'*')% movies will be opened at the first frame 400 i1=1; 401 i2=[]; 402 j1=[]; 403 j2=[]; 404 end 397 [FilePath,FileName,ImaExt]=fileparts(fileinput); 398 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 399 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 400 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomTypeIma,FileType,Object,i1,i2,j1,j2]=find_file_series(FilePath,[FileName ImaExt]); 401 402 % [RootPath,FileName,ImaExt]=fileparts(fileinput); 403 % [RootFile,i1_series,tild,j1_series,tild,NomTypeIma,FileType,Object]=find_file_series(RootPath,[FileName ImaExt]); 404 % if strcmp(NomTypeInput,'*')% movies will be opened at the first frame 405 % i1=1; 406 % i2=[]; 407 % j1=[]; 408 % j2=[]; 409 % end 405 410 switch FileType 406 411 case {'image','multimage','video'} … … 427 432 428 433 %% scan the images if a civ file has been opened 429 % if ~isempty(NomTypeNc)430 % [tild,i1_series,tild,j1_series,tild,NomTypeIma,ImageType,Object]=find_file_series(RootPath,RootFile);431 % end432 434 MinIndex_i=min(i1_series(i1_series>0)); 433 435 MinIndex_j=min(j1_series(j1_series>0)); … … 2695 2697 [tild,RootFile_1]=fileparts(name); 2696 2698 else 2697 [tild,tild,RootFile_1,tild,tild,tild,tild,tild,nom_type_1]=fileparts_uvmat(fileinput); 2698 [RootFile_1,i1_series,tild,j1_series,tild,nom_type_1,FileType,Object]=find_file_series(PathName,FileName); 2699 [FilePath,FileName,Ext]=fileparts(fileinput); 2700 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 2701 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 2702 [RootPath,SubDir,RootFile_1,i1_series,i2_series,j1_series,j2_series,nom_type_1,FileType,Object,i1,i2,j1,j2]=find_file_series(FilePath,[FileName Ext]); 2703 2704 % [tild,tild,RootFile_1,tild,tild,tild,tild,tild,nom_type_1]=fileparts_uvmat(fileinput); 2705 %[RootFile_1,i1_series,tild,j1_series,tild,nom_type_1,FileType,Object]=find_file_series(PathName,FileName); 2699 2706 %check image nom type 2700 2707 if ~strcmp(nom_type_1,get(handles.NomType,'String')) -
trunk/src/find_file_series.m
r397 r398 1 1 %'find_file_series': check the content of an input file and find the corresponding file series 2 2 %-------------------------------------------------------------------------- 3 % function [RootPath,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object ]=find_file_series(fileinput)3 % function [RootPath,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object,i1_input,i2_input,j1_input,j2_input]=find_file_series(fileinput) 4 4 % 5 5 % OUTPUT: … … 37 37 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 38 38 39 function [Root File,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(RootPath,fileinput)39 function [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object,i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput) 40 40 %------------------------------------------------------------------------ 41 if ~exist('option','var') 42 option='all'; 43 end 41 44 42 %% get input root name and nomenclature type 45 [tild,tild,RootFile,tild,i2_input,j1_input,j2_input,FileExt,NomType]=fileparts_uvmat(fileinput); 46 fullfileinput=fullfile(RootPath,fileinput);% input file name with path 43 fullfileinput=fullfile(FilePath,fileinput);% input file name with path 44 [RootPath,SubDir,RootFile,i1_input,i2_input,j1_input,j2_input,FileExt,NomType]=fileparts_uvmat(fullfileinput); 45 47 46 48 47 %% check for particular file types: images, movies, civ data … … 58 57 end 59 58 60 if strcmp(NomType,'')||strcmp(NomType,'*') ||strcmp(option,'filetype')59 if strcmp(NomType,'')||strcmp(NomType,'*') 61 60 if exist(fullfileinput,'file') 62 % RootFile=fileinput;% case of constant name (no indexing) 63 [tild,RootFile]=fileparts(fileinput);% case of constant name (no indexing) 61 [tild,RootFile]=fileparts(fileinput);% case of constant name (no indexing), get the filename without its extension 64 62 else 65 63 RootFile=''; 66 64 end 65 i1_input=1;% the index now refer to the frame in the movie, choose 1 at opening 66 i2_input=[]; 67 j1_input=[]; 68 j2_input=[]; 67 69 else 68 70 %% possibly include the first index in the root name, if there exists a corresponding xml file 69 % RootFileNew=RootFile;70 % if ~isempty(regexp(NomType,['^_']))71 % NomTypePref='_';72 % RootFileNew=[RootFileNew '_'];73 % end RootPath='';74 71 NomTypePref=''; 75 72 r=regexp(NomType,'^(?<tiretnum>_?\d+)','names');%look for a number or _1 at the beginning of NomType 76 % r=regexp(NomType,['^' NomTypePref '(?<num1>\d+)'],'names');%look for a number at the beginning of NomTypeSt77 73 if ~isempty(r) 78 74 fileinput_end=regexprep(fileinput,['^' RootFile],'');%remove RootFile at the beginning of fileinput … … 85 81 RootFileNew=[RootFile rr.i1]; 86 82 checkpair=~isempty(regexp(NomType,'-','once'))||~isempty(regexp(NomType,'ab$','once'))||~isempty(regexp(NomType,'AB$','once'));%case of PIV results 87 if exist(fullfile(RootPath,[RootFileNew '.xml']),'file') || (checkpair && exist(fullfile(fileparts(RootPath),[RootFileNew '.xml']),'file'))83 if exist(fullfile(RootPath,[RootFileNew '.xml']),'file') %|| (checkpair && exist(fullfile(fileparts(RootPath),[RootFileNew '.xml']),'file')) 88 84 RootFile=RootFileNew; 89 85 NomTypePref=r.tiretnum; 90 86 NomType=regexprep(NomType,['^' NomTypePref],''); 87 i1_input=j1_input; 91 88 i2_input=j2_input; 92 89 j1_input=[]; … … 151 148 star_string=[RootFile sep1 i1_star i2_star j1_star j2_star FileExt]; 152 149 wd=pwd;%current working directory 153 cd ( RootPath)% move to the local dir to save time in the operation dir.150 cd (FilePath)% move to the local dir to save time in the operation dir. 154 151 dirpair=dir(star_string);% look for relevant files in the file directory 155 152 cd(wd) … … 158 155 ref_j_list=zeros(1,nbpair); 159 156 if nbpair==0% no detected file 160 % RootPath='';161 157 RootFile=''; 162 158 end -
trunk/src/series.m
r393 r398 957 957 ind_shift=0;%default 958 958 959 %determine the list of input file names960 nbmissing=0;961 % for iview=1:length(RootPath)962 % %case of pairs (.nc files)963 % 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});964 % if strcmp(get(handles.Pairs,'Visible'),'on')965 % pair_list=get(handles.list_pair_civ,'String');966 % val=get(handles.list_pair_civ,'Value');967 % pair_string=pair_list{val};968 % r=regexp(pair_string,'.*\D(?<num1>[\d+|*])(?<delim>[-||])(?<num2>[\d+|*])','names');969 % if ~isempty(r)970 % if strcmp(r.num1,'*')%free pairs971 % [tild,RootFile,i1_series,i2_series,j1_series,j2_series,tild,tild,Object]=find_file_series(fileinput);% TODO: choice pair when multiple choice972 %973 % if isempty(i2_series) %j pairs974 % ind_sel=i1_series>=i1_series>=first_i & i1_series<=last_i & j1_series>first_j & j2_series<last_j;975 % j2_series=j2_series(ind_sel);976 % else%i pairs977 % if isempty(j1_series) %j pairs978 % ind_sel=i1_series>=first_i & i2_series<=last_i ;979 % else980 % ind_sel=i1_series>=first_i & i2_series<=last_i& j1_series>first_j & j1_series<last_j;981 % j1_series=j1_series(ind_sel);982 % i2_series=i2_series(ind_sel);983 % end984 % end985 % i1_series=i1_series(ind_sel);986 % else987 % if strcmp(r.delim,'-')988 % ind_shift(1)=str2num(r.num1);989 % ind_shift(2)=str2num(r.num2);990 % else991 % ind_shift(1)=-str2num(r.num1);992 % ind_shift(2)=str2num(r.num2);993 % end994 % [i1_series,i2_series,j1_series,j2_series,nbmissing]=find_file_indices(num_i,num_j,ind_shift,NomType{iview},mode);995 % end996 % end997 % if isempty(i1_series)998 % msgbox_uvmat('ERROR','no file in the considered range')999 % return1000 % end1001 % if isempty(i2_series)1002 % i2_series=i1_series;1003 % end1004 % if isempty(j2_series)1005 % j2_series=j1_series;1006 % end1007 % else%case of images1008 % [i1_series,j1_series]=meshgrid(num_i,num_j);1009 % i2_series=i1_series;1010 % j2_series=j1_series;1011 % end1012 % if length(RootPath)>11013 % i1_series_cell{iview}=i1_series;1014 % i2_series_cell{iview}=i2_series;1015 % j1_series_cell{iview}=j1_series;1016 % j2_series_cell{iview}=j2_series;1017 % end1018 % end1019 959 1020 960 %% defining the ACTION function handle … … 1829 1769 %% look for min and max indices existing in the file series and update SeriesData 1830 1770 errormsg=''; 1831 [RootPathSub,FileName,FileExt]=fileparts(fileinput); 1832 [RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(RootPathSub,[FileName FileExt]); 1771 [FilePath,FileName,FileExt]=fileparts(fileinput); 1772 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 1773 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 1774 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]); 1775 1776 % 1777 % [RootPathSub,FileName,FileExt]=fileparts(fileinput); 1778 % [RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(RootPathSub,[FileName FileExt]); 1833 1779 if isempty(RootFile)&&isempty(i1_series) 1834 1780 errormsg='no input file in the series'; 1835 1781 return 1836 1782 end 1837 [tild,tild,FileExt]=fileparts(fileinput);1783 % [tild,tild,FileExt]=fileparts(fileinput); 1838 1784 1839 1785 MinIndex=get(handles.MinIndex,'Data'); … … 1968 1914 %% read image documentation file if found%%%%%%%%%%%%%%%%%%%%%%%%%%% 1969 1915 ext_imadoc=''; 1970 FileBase=fullfile(RootPath Sub,RootFile);1916 FileBase=fullfile(RootPath,RootFile); 1971 1917 if isequal(FileExt,'.xml')||isequal(FileExt,'.civ') 1972 1918 ext_imadoc=FileExt; -
trunk/src/uvmat.m
r397 r398 504 504 505 505 %% detect root name, nomenclature and indices in the input file name: 506 [RootPath,SubDir,tild,i1,i2,j1,j2]=fileparts_uvmat(fileinput);507 [ tild,FileName,FileExt]=fileparts(fileinput);506 %[RootPath,SubDir]=fileparts_uvmat(fileinput); 507 [FilePath,FileName,FileExt]=fileparts(fileinput); 508 508 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 509 [RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[FileName FileExt]); 510 if strcmp(NomType,'*')% movies will be opened at the first frame 511 i1=1; 512 i2=[]; 513 j1=[]; 514 j2=[]; 515 end 509 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 510 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]); 511 % if strcmp(NomType,'*')% movies will be opened at the first frame 512 % i1=1; 513 % i2=[]; 514 % j1=[]; 515 % j2=[]; 516 % end 516 517 517 518 %% open the file or fill the GUI uvmat according to the detected file type … … 606 607 %fileinput=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 607 608 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 608 [ tild,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);609 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 609 610 % initiate the input file series and refresh the current field view: 610 611 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject); … … 1092 1093 %fileinput=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 1093 1094 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 1094 [ tild,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);1095 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 1095 1096 % initiate the input file series and refresh the current field view: 1096 1097 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,2); … … 2446 2447 for imap=1:numel(IndexObj) 2447 2448 iobj=IndexObj(imap); 2448 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj}) % project field on the object2449 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj});% project field on the object 2449 2450 2450 2451 if ~isempty(errormsg)
Note: See TracChangeset
for help on using the changeset viewer.