- Timestamp:
- Jun 5, 2014, 10:39:28 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r662 r783 433 433 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 434 434 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 435 [RootPath,SubDirImages,RootFile,i1_series,tild,j1_series,tild,NomTypeIma,FileType,FileInfo,MovieObject]=find_file_series(FilePath,[FileName ImaExt]); 435 [RootPath,SubDirImages,RootFile,i1_series,tild,j1_series,tild,NomTypeIma,FileInfo,MovieObject]=find_file_series(FilePath,[FileName ImaExt]); 436 FileType=FileInfo.FileType; 436 437 switch FileType 437 438 case {'image','multimage','video','mmreader'} … … 1204 1205 % if strcmp(Param.Program,'civ_matlab') 1205 1206 if Param.CheckCiv1 1206 [Param.Civ1.FileTypeA,ImageInfoA_civ1,Param.Civ1.ImageA]=get_file_type(filecell.ima1.civ1{1}); 1207 [Param.Civ1.FileTypeB,ImageInfoB_civ1,Param.Civ1.ImageB]=get_file_type(filecell.ima2.civ1{1}); 1207 [ImageInfoA_civ1,Param.Civ1.ImageA]=get_file_type(filecell.ima1.civ1{1}); 1208 Param.Civ1.FileTypeA=ImageInfoA_civ1.FileType; 1209 [ImageInfoB_civ1,Param.Civ1.ImageB]=get_file_type(filecell.ima2.civ1{1}); 1210 Param.Civ1.FileTypeB=ImageInfoB_civ1.FileType; 1208 1211 end 1209 1212 if Param.CheckCiv2 1210 [Param.Civ2.FileTypeA,ImageInfoA_civ2,Param.Civ2.ImageA]=get_file_type(filecell.ima1.civ2{1}); 1211 [Param.Civ2.FileTypeB,ImageInfoB_civ2,Param.Civ2.ImageB]=get_file_type(filecell.ima2.civ2{1}); 1213 [ImageInfoA_civ2,Param.Civ2.ImageA]=get_file_type(filecell.ima1.civ2{1}); 1214 Param.Civ2.FileTypeA=ImageInfoA_civ2.FileType; 1215 [ImageInfoB_civ2,Param.Civ2.ImageB]=get_file_type(filecell.ima2.civ2{1}); 1216 Param.Civ2.FileTypeB=ImageInfoB_civ2.FileType; 1212 1217 end 1213 1218 % end … … 2321 2326 if ~isequal(ext_ima,'.png') 2322 2327 if checkbox(1) %if civ1 is performed 2323 [FileType,FileInfo,MovieObject]=get_file_type(filecell.ima1.civ1{1}); 2328 [FileInfo,MovieObject]=get_file_type(filecell.ima1.civ1{1}); 2329 FileType=FileInfo.FileType; 2324 2330 check_j=0; 2325 2331 if strcmp(FileType,'mmreader')||strcmp(FileType,'VideoReader')||strcmp(FileType,'multimage') … … 2360 2366 end 2361 2367 if checkbox(4) %if civ2 is performed 2362 [FileType,FileInfo,MovieObject]=get_file_type(filecell.ima1.civ2{1}); 2368 [FileInfo,MovieObject]=get_file_type(filecell.ima1.civ2{1}); 2369 FileType=FileInfo.FileType; 2363 2370 check_j=0; 2364 2371 if strcmp(FileType,'mmreader')||strcmp(FileType,'VideoReader')||strcmp(FileType,'multimage') … … 2569 2576 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 2570 2577 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 2571 [RootPath,SubDir,RootFile_1,i1_series,i2_series,j1_series,j2_series,nom_type_1,File Type,FileInfo,Object,i1,i2,j1,j2]=find_file_series(FilePath,[FileName Ext]);2572 2578 [RootPath,SubDir,RootFile_1,i1_series,i2_series,j1_series,j2_series,nom_type_1,FileInfo,Object,i1,i2,j1,j2]=find_file_series(FilePath,[FileName Ext]); 2579 FileType=FileInfo.FileType; 2573 2580 %check image nom type 2574 2581 if ~strcmp(nom_type_1,get(handles.NomType,'String')) … … 3775 3782 Data.CoordUnit='pixel';% used to set equal scaling for x and y in image dispaly 3776 3783 par_civ1=read_GUI(handles.Civ1); 3777 par_civ1.FileTypeA=get_file_type(filecell.ima1.civ1{1}); 3784 FileInfo=get_file_type(filecell.ima1.civ1{1}); 3785 par_civ1.FileTypeA=FileInfo.FileType; 3778 3786 par_civ1.ImageWidth=size(Data.A,2); 3779 3787 par_civ1.ImageHeight=size(Data.A,1); -
trunk/src/find_file_series.m
r667 r783 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,i1_input,i2_input,j1_input,j2_input]=find_file_series(fileinput)3 % function [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,Object,i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput,checkxml) 4 4 % 5 5 % OUTPUT: 6 % RootPath: path to the dir containing the input file 7 % SubDir: data dir containing the input file series 6 8 % RootFile: root file detected in fileinput, possibly modified for movies (indexing is then done on image view, not file) 7 9 % i1_series(pair,ref_j+1, ref_i+1),i2_series,j1_series,j2_series: set of indices (i1,i2,j1,j2) sorted by ref index ref_i, ref_j, and pairindex in case of multiple pairs with the same ref 8 10 % (ref_i+1 is used to deal with the image index zero sometimes used) 9 11 % NomType: nomenclature type corrected after checking the first file (problem of 0 before the number string) 10 % FileType: type of file, = 11 % = 'image', usual image as recognised by Matlab 12 % = 'multimage', image series stored in a single file 13 % = 'civx', netcdf file with civx convention 14 % = 'civdata', civ data with new convention 15 % = 'netcdf' other netcdf files 16 % = 'video': movie recognised by VideoReader (e;g. avi) 17 % MovieObject: video object (=[] otherwise) 12 % FileInfo: structure containing info on the input files (assumed identical on the whole series) 13 % FileInfo.FileType: type of file, = 14 % = 'image', usual image as recognised by Matlab 15 % = 'multimage', image series stored in a single file 16 % = 'civx', netcdf file with civx convention 17 % = 'civdata', civ data with new convention 18 % = 'netcdf' other netcdf files 19 % = 'video': movie recognised by VideoReader (e;g. avi) 20 % MovieObject: video object (=[] otherwise 21 % i1_input,i2_input,j1_input,j2_input: indices of the input file, or of the first file in the series if the input file does not exist 18 22 % 19 23 %INPUT 20 % RootPath: path to the directory to be scanned24 % FilePath: path to the directory to be scanned 21 25 % fileinput: name (without path) of the input file sample 22 26 % checkxml: =1(default) take into account xml file existence to possibly include indexes in RootFile … … 39 43 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 40 44 41 function [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,File Type,FileInfo,MovieObject,i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput,checkxml)45 function [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput,checkxml) 42 46 %------------------------------------------------------------------------ 43 47 … … 52 56 j1_series=zeros(1,1,1); 53 57 j2_series=zeros(1,1,1); 54 [File Type,FileInfo,MovieObject]=get_file_type(fullfileinput);58 [FileInfo,MovieObject]=get_file_type(fullfileinput); 55 59 if ~exist(FilePath,'dir') 56 60 return % don't go further if the dir path does not exist … … 233 237 NomType=regexprep(NomType,['^' NomTypePref],''); 234 238 %% update the file type if the input file does not exist (pb of 0001) 235 if isempty(File Type)236 [File Type,FileInfo,MovieObject]=get_file_type(fullfile(FilePath,dirpair(ifile_min).name));239 if isempty(FileInfo.FileType) 240 [FileInfo,MovieObject]=get_file_type(fullfile(FilePath,dirpair(ifile_min).name)); 237 241 end 238 242 end … … 247 251 %% introduce the frame index in case of movies or multimage type 248 252 if isfield(FileInfo,'NumberOfFrames') && FileInfo.NumberOfFrames >1 249 if isempty(i1_series) 253 if isempty(i1_series)% if there is no file index, i denotes the frame index 250 254 i1_series=zeros(FileInfo.NumberOfFrames+1,2);% first column =0 251 255 i1_series(:,2)=(0:FileInfo.NumberOfFrames)'; % second column=frame index -1 252 256 i1_input=1; 253 257 NomType='*'; 254 else 255 i1_series=i1_series(:,2)*ones(1,FileInfo.NumberOfFrames); 256 i1_series=[zeros(size(i1_series,1),1) i1_series]; 257 j1_series=ones(size(i1_series,1),1)*(1:FileInfo.NumberOfFrames); 258 j1_series=[zeros(size(i1_series,1),1) j1_series]; 259 % include the first index in the root name 260 r=regexp(NomType,'^(?<tiretnum>_?\d+)','names');%look for a number or _1 at the beginning of NomType 261 if ~isempty(r) 262 fileinput_end=regexprep(fileinput,['^' RootFile],'');%remove RootFile at the beginning of fileinput 263 if isempty(regexp(r.tiretnum,'^_','once'))% if a separator '_' is not detected 264 rr=regexp(fileinput_end,'^(?<i1>\d+)','names'); 265 else% if a separator '_' is detected 266 rr=regexp(fileinput_end,'^(?<i1>_\d+)','names'); 267 end 268 if ~isempty(rr) 269 % RootFile=[RootFile rr.i1];% new root file 270 % NomTypePref=r.tiretnum; 271 % NomType=regexprep(NomType,['^' NomTypePref],''); 272 % i1_input=j1_input; 273 % i2_input=j2_input; 274 j1_input=1; 275 j2_input=[]; 258 else % if there is a file index, j denotes the frame index while i denotes the file index 259 if strcmp(NomType(end-1:end),'ab')% recognized as a pair 260 RootFile=fullfile_uvmat('','',RootFile,'',NomType,i1_input,i2_input,j1_input,j2_input);% restitute the root name without the detected indices 261 i1_series=zeros(FileInfo.NumberOfFrames+1,2);% first column =0 262 i1_series(:,2)=(0:FileInfo.NumberOfFrames)'; % second column=frame index -1 263 j1_series=[]; 264 i1_input=1; 265 NomType='*'; 266 else 267 i1_series=i1_series(:,2)*ones(1,FileInfo.NumberOfFrames);% 268 i1_series=[zeros(size(i1_series,1),1) i1_series]; 269 j1_series=ones(size(i1_series,1),1)*(1:FileInfo.NumberOfFrames);% 270 j1_series=[zeros(size(i1_series,1),1) j1_series]; 271 % include the first index in the root name 272 r=regexp(NomType,'^(?<tiretnum>_?\d+)','names');%look for a number or _1 at the beginning of NomType 273 if ~isempty(r) 274 fileinput_end=regexprep(fileinput,['^' RootFile],'');%remove RootFile at the beginning of fileinput 275 if isempty(regexp(r.tiretnum,'^_','once'))% if a separator '_' is not detected 276 rr=regexp(fileinput_end,'^(?<i1>\d+)','names'); 277 else% if a separator '_' is detected 278 rr=regexp(fileinput_end,'^(?<i1>_\d+)','names'); 279 end 280 if ~isempty(rr) 281 j1_input=1; 282 j2_input=[]; 283 end 276 284 end 277 285 end -
trunk/src/get_file_series.m
r757 r783 62 62 FilePath=fullfile(InputTable{iview,1},InputTable{iview,2}); 63 63 fileinput=[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]; 64 [tild,tild,tild,i1_series{iview},i2_series{iview},j1_series{iview},j2_series{iview},NomType,File Type,FileInfo,MovieObject,...64 [tild,tild,tild,i1_series{iview},i2_series{iview},j1_series{iview},j2_series{iview},NomType,FileInfo,MovieObject,... 65 65 i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput); 66 66 i1_series{iview}=squeeze(i1_series{iview}(1,:,:)); %select first pair index as ordered by find_file_series -
trunk/src/get_file_type.m
r781 r783 16 16 % INPUT: 17 17 % fileinput: name, including path, of the file to analyse 18 function [FileType,FileInfo,VideoObject]=get_file_type(fileinput) 19 %%%% TODO: suppress the output argument FileType, contained in FileInfo %%%% 20 FileInfo=[];% will remain empty in the absence of input file 18 function [FileInfo,VideoObject]=get_file_type(fileinput) 21 19 VideoObject=[]; 22 20 if exist(fileinput,'file') 23 21 FileInfo.FileName=fileinput; 24 22 FileInfo.FileType='txt'; %default 25 FileType='txt';%default, text file26 23 else 27 File Type='';24 FileInfo.FileType=''; 28 25 return 29 26 end 30 [tild,tild,FileExt]=fileparts(fileinput); 27 [tild,tild,FileExt]=fileparts(fileinput);%get the fiel extension FileExt 31 28 32 29 switch FileExt 33 30 case '.fig' 34 31 FileInfo.FileType='figure'; 35 FileType='figure';36 32 case '.xml' 37 33 FileInfo.FileType='xml'; 38 FileType='xml';39 34 case '.xls' 40 35 FileInfo.FileType='xls'; 41 FileType='xls';42 36 case '.dat' 43 FileInfo.FileType='dat'; 44 FileType='dat'; 37 FileInfo.FileType='dat';; 45 38 otherwise 46 39 if ~isempty(FileExt)% exclude empty extension … … 50 43 try 51 44 imainfo=imfinfo(fileinput); 52 if length(imainfo) >1 %case of image with multiple frames 53 FileType='multimage'; 45 if length(imainfo) >1 %case of image with multiple frames 54 46 FileInfo=imainfo(1);%take info from the first frame 47 FileInfo.FileType='multimage'; 55 48 FileInfo.NumberOfFrames=length(imainfo); 56 49 else 57 FileType='image';58 50 FileInfo=imainfo; 51 FileInfo.FileType='image'; 59 52 FileInfo.NumberOfFrames=1; 60 53 end 61 54 FileInfo.FileName=FileInfo.Filename; %correct the info given by imfinfo 62 FileInfo.FileType=FileType;63 55 end 64 56 else 65 57 error_nc=0; 66 58 try 67 % [Data,tild,tild,errormsg]=nc2struct(fileinput,'ListGlobalAttribute','absolut_time_T0','Conventions',...68 % 'CivStage','patch2','fix2','civ2','patch','fix','hart');69 59 [Data,tild,tild,errormsg]=nc2struct(fileinput,[]); 70 60 if ~isempty(errormsg) … … 89 79 elseif isfield(Data,'Conventions') && strcmp(Data.Conventions,'uvmat/civdata') 90 80 FileInfo.FileType='civdata'; % test for civx velocity fields 91 FileType='civdata'; % test for civx velocity fields81 % FileType='civdata'; % test for civx velocity fields 92 82 FileInfo.CivStage=Data.CivStage; 93 83 else 94 84 FileInfo.FileType='netcdf'; 95 FileType='netcdf';85 %FileType='netcdf'; 96 86 FileInfo.ListVarName=Data.ListVarName; 97 87 end … … 105 95 VideoObject=VideoReader(fileinput); 106 96 FileInfo=get(VideoObject); 107 File Type='video';97 FileInfo.FileType='video'; 108 98 elseif exist('mmreader.m','file')% Matlab 2009a 109 99 VideoObject=mmreader(fileinput); 110 100 FileInfo=get(VideoObject); 111 File Type='mmreader';101 FileInfo.FileType='mmreader'; 112 102 end 113 103 FileInfo.FileName=fileinput; 114 FileInfo.FileType=FileType;115 104 FileInfo.BitDepth=FileInfo.BitsPerPixel/3; 116 105 end -
trunk/src/series.m
r781 r783 424 424 if ~isequal(ListStruct(ilist).isdir,1)%look for files, not dir 425 425 FileName=ListStruct(ilist).name; 426 File Type=get_file_type(fullfile(DirName,FileName));427 switch File Type426 FileInfo=get_file_type(fullfile(DirName,FileName)); 427 switch FileInfo.FileType 428 428 case {'image','multimage','civx','civdata','netcdf'} 429 429 break … … 477 477 if ~isequal(hdir(ilist).isdir,1)%look for files, not dir 478 478 FileName=hdir(ilist).name; 479 File Type=get_file_type(fullfile(DirName,FileName));480 switch File Type479 FileInfo=get_file_type(fullfile(DirName,FileName)); 480 switch FileInfo.FileType 481 481 case {'image','multimage','civx','civdata','netcdf'} 482 482 break … … 553 553 RootPath=fileparts(RootPath); %will try the upper folder 554 554 else %scan the input folder 555 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,File Type,FileInfo,MovieObject]=...555 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=... 556 556 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]); 557 557 end … … 607 607 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 608 608 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 609 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]); 609 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]); 610 FileType=FileInfo.FileType; 610 611 if isempty(RootFile)&&isempty(i1_series) 611 612 errormsg='no input file in the series'; … … 1024 1025 %% set length of waitbar 1025 1026 displ_time(handles) 1026 1027 1028 % look for netcdf data as input1029 % switch FileType1030 % case {'civx','civdata'}1031 % FieldList=[set_field_list('U','V');{'C'}];%standard menu for civx data1032 % set(handles.Coord_x,'String','X');1033 % set(handles.Coord_y,'String','Y');1034 % case 'netcdf'1035 % ind_x=find(strcmp(get(handles.Coord_x,'String'),FileInfo.ListVarName));1036 % if isempty(ind_x)1037 % FieldList={};% new kind of file opened, we need to pick variables with get_field...1038 % set(handles.Coord_x,'String','')1039 % set(handles.Coord_y,'String','')1040 % else1041 % FileInfo.ListVarName(ind_x)=[];%remove coord-x from the list of variables to display1042 % ind_y=find(strcmp(get(handles.Coord_y,'String'),FileInfo.ListVarName));1043 % if isempty(ind_y)1044 % FieldList={};% new kind of file opened, we need to pick variables with get_field...1045 % set(handles.Coord_x,'String','')1046 % set(handles.Coord_y,'String','')1047 % else1048 % FileInfo.ListVarName(ind_y)=[];%remove coord-y from the list of variables to display1049 % FieldList=(FileInfo.ListVarName)';1050 % end1051 % end1052 % otherwise1053 % set(handles.FieldName,'Value',1) % set menu to 'image'1054 % set(handles.FieldName,'String',{'image'})1055 % set(handles.Coord_x,'String','AX');1056 % set(handles.Coord_y,'String','AY');1057 % end1058 % if ismember(FileType,{'civx','civdata','netcdf'})1059 % PrevMenu=get(handles.FieldName,'String');1060 % PrevValue=get(handles.FieldName,'Value');1061 % PrevMenu=PrevMenu(PrevValue(PrevValue<=numel(PrevMenu)));1062 % FieldValue=[];1063 % for ilist=1:numel(PrevMenu)1064 % index_menu=find(strcmp(PrevMenu{ilist},FieldList));1065 % if ~isempty(index_menu)1066 % FieldValue=[FieldValue index_menu];1067 % end1068 % end1069 % if isempty(FieldValue)1070 % FieldValue=1;1071 % end1072 % set(handles.FieldName,'Value',FieldValue)1073 % set(handles.FieldName,'String',[FieldList;{'get_field...'}])1074 % end1075 1027 1076 1028 … … 3023 2975 set(htitlebox,'String',FullSelectName) 3024 2976 elseif exist(FullSelectName,'file')%visualise the vel field if it exists 3025 File Type=get_file_type(FullSelectName);3026 if strcmp(File Type,'txt')2977 FileInfo=get_file_type(FullSelectName); 2978 if strcmp(FileInfo.FileType,'txt') 3027 2979 edit(FullSelectName) 3028 elseif strcmp(File Type,'xml')2980 elseif strcmp(FileInfo.FileType,'xml') 3029 2981 editxml(FullSelectName) 3030 2982 else -
trunk/src/series/aver_stat.m
r751 r783 121 121 return 122 122 end 123 [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 123 [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 124 FileType{iview}=FileInfo{iview}.FileType; 124 125 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images 125 126 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files -
trunk/src/series/aver_synchro.m
r751 r783 93 93 FileExt=Param.InputTable(:,5); 94 94 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 95 [FileType,FileInfo]=get_file_type(filecell{1,1}); 95 FileInfo=get_file_type(filecell{1,1}); 96 FileType=FileInfo.FileType; 96 97 %%%%%%%%%%%% 97 98 % The cell array filecell is the list of input file names, while -
trunk/src/series/beam_forming.m
r782 r783 82 82 return 83 83 end 84 [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 84 [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 85 FileType{iview}=FileInfo{iview}.FileType; 85 86 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images 86 87 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files -
trunk/src/series/check_data_files.m
r649 r783 92 92 NcTypeOptions={'netcdf','civx','civdata'}; 93 93 for iview=1:nbview 94 [FileType{iview},FileInfo{iview},Object{iview}]=get_file_type(filecell{iview,1}); 94 [FileInfo{iview},Object{iview}]=get_file_type(filecell{iview,1}); 95 FileType{iview}=FileInfo{iview}.FileType; 95 96 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images 96 97 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files … … 100 101 for iview=1:nbview 101 102 if isequal(FileType{iview},'mmreader')||isequal(FileType{iview},'video')||isequal(FileType{iview},'multimage') 102 [ tild,FileInfo]=get_file_type(filecell{iview,1});103 [FileInfo]=get_file_type(filecell{iview,1}); 103 104 Tabchar{1}=filecell{iview,1};%info.Filename; 104 105 Tabchar{2}=''; 105 106 Tabchar{3}=[num2str(FileInfo.FrameRate) ' frames/s ']; 106 107 message=''; 107 % Tabchar{4}='';108 % Tabchar{5}=[' compression' FileInfo.VideoCompression];109 % Tabchar{6}=[ 'quality ' num2str(FileInfo.Quality)];110 108 else 111 109 Tabchar={}; … … 133 131 end 134 132 lastfield=''; 135 [FileType{iview},FileInfo,Object]=get_file_type(file); 133 [FileInfo,Object]=get_file_type(file); 134 FileType{iview}=FileInfo.FileType; 136 135 if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata') 137 136 if isfield(FileInfo,'CivStage') -
trunk/src/series/check_peaklock.m
r668 r783 113 113 return 114 114 end 115 [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 115 [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 116 FileType{iview}=FileInfo{iview}.FileType; 116 117 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images 117 118 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files -
trunk/src/series/civ_input.m
r781 r783 2068 2068 Data.CoordUnit='pixel';% used to set equal scaling for x and y in image dispa=ly 2069 2069 par_civ1=read_GUI(handles.Civ1); 2070 par_civ1.FileTypeA=get_file_type(ImageName_A); 2070 FileInfo=get_file_type(ImageName_A); 2071 par_civ1.FileTypeA=FileInfo.FileType; 2071 2072 par_civ1.ImageWidth=size(Data.A,2); 2072 2073 par_civ1.ImageHeight=size(Data.A,1); -
trunk/src/series/civ_series.m
r782 r783 220 220 return 221 221 end 222 [FileType_A,FileInfo_A,VideoObject_A]=get_file_type(ImageName_A); 222 [FileInfo_A,VideoObject_A]=get_file_type(ImageName_A); 223 FileType_A=FileInfo_A.FileType; 223 224 if strcmp(FileInfo_A.FileType,'netcdf') 224 225 FieldName_A=Param.InputFields.FieldName; … … 233 234 return 234 235 end 235 [FileType_B,FileInfo_B,VideoObject_B]=get_file_type(ImageName_B); 236 [FileInfo_B,VideoObject_B]=get_file_type(ImageName_B); 237 FileType_B=FileInfo_B.FileType; 236 238 if strcmp(FileInfo_B.FileType,'netcdf') 237 239 FieldName_B=Param.InputFields.FieldName; … … 255 257 return 256 258 end 257 [FileType_B,FileInfo_B,VideoObject_B]=get_file_type(ImageName_B); 259 [FileInfo_B,VideoObject_B]=get_file_type(ImageName_B); 260 FileType_B=FileInfo_B.FileType; 258 261 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2(1)); 259 262 NbField=numel(i1_series_Civ2); -
trunk/src/series/float_tracking.m
r635 r783 124 124 125 125 %% check the input file type 126 [FileType,FileInfo,VideoObject]=get_file_type(filecell{1,1}); 126 [FileInfo,VideoObject]=get_file_type(filecell{1,1}); 127 FileType=FileInfo.FileType; 127 128 ImageTypeOptions={'image','multimage','mmreader','video'}; 128 129 if isempty(find(strcmp(FileType,ImageTypeOptions))) -
trunk/src/series/ima_levels.m
r635 r783 65 65 msgbox_uvmat('WARNING','the first input file does not exist') 66 66 else 67 FileType=get_file_type(filecell{1,1}); 67 FileInfo=get_file_type(filecell{1,1}); 68 FileType=FileInfo.FileType; 68 69 if isempty(find(strcmp(FileType,{'image','multimage','mmreader','video'})));% =1 for images 69 70 msgbox_uvmat('ERROR',['bad input file type for ' mfilename ': an image is needed']) … … 106 107 nbfield_i=size(i1_series{1},2); %nb of fields for the i index 107 108 nbfield=nbfield_j*nbfield_i; %total number of fields 108 [FileType{1},FileInfo{1},VideoObject{1}]=get_file_type(filecell{1,1});% type of input file 109 [FileInfo{1},VideoObject{1}]=get_file_type(filecell{1,1});% type of input file 110 FileType{1}=FileInfo{1}.FileType; 109 111 110 112 %% frame index for movie or multimage file input -
trunk/src/series/merge_proj.m
r746 r783 121 121 return 122 122 end 123 [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 123 [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 124 FileType{iview}=FileInfo{iview}.FileType; 124 125 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images 125 126 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files -
trunk/src/series/merge_proj_special.m
r712 r783 114 114 return 115 115 end 116 [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 116 [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 117 FileType{iview}=FileInfo{iview}.FileType; 117 118 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images 118 119 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files -
trunk/src/series/particle_tracking.m
r635 r783 124 124 125 125 %% check the input file type 126 [FileType,FileInfo,VideoObject]=get_file_type(filecell{1,1}); 126 [FileInfo,VideoObject]=get_file_type(filecell{1,1}); 127 FileType=FileInfo.FileType; 127 128 ImageTypeOptions={'image','multimage','mmreader','video'}; 128 129 if isempty(find(strcmp(FileType,ImageTypeOptions))) -
trunk/src/series/relabel_i_j.m
r736 r783 95 95 return 96 96 end 97 [FileType{1},FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1}); 97 [FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1}); 98 FileType{1}=FileInfo{1}.FileType; 98 99 CheckImage=~isempty(find(strcmp(FileType{1},ImageTypeOptions)));% =1 for images 99 100 -
trunk/src/series/sub_background.m
r774 r783 90 90 %% check the validity of input file types 91 91 ImageTypeOptions={'image','multimage','mmreader','video'};%allowed input file types(images) 92 FileType=get_file_type(FirstFileName); 92 FileInfo=get_file_type(FirstFileName); 93 FileType=FileInfo.FileType; 93 94 CheckImage=~isempty(find(strcmp(FileType,ImageTypeOptions), 1));% =1 for images 94 95 if ~CheckImage … … 200 201 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices 201 202 %%%%%%%%%%%% 202 [FileType{1},FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1}); 203 [FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1}); 204 FileType{1}=FileInfo{1}.FileType; 203 205 if ~isempty(j1_series{1}) 204 206 frame_index{1}=j1_series{1}; -
trunk/src/series/time_series.m
r768 r783 124 124 return 125 125 end 126 [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 126 [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 127 FileType{iview}=FileInfo{iview}.FileType; 127 128 if strcmp(FileType{iview},'civdata')||strcmp(FileType{iview},'civx') 128 129 if ~isfield(Param.InputFields,'VelType') -
trunk/src/series/turb_stat.m
r761 r783 103 103 return 104 104 end 105 [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 105 [FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1}); 106 FileType{iview}=FileInfo{iview}.FileType; 106 107 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images 107 108 CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files -
trunk/src/set_grid.m
r622 r783 228 228 return 229 229 end 230 [File Type,tild,VideoObject]=get_file_type(GUI.ImageA);231 switch File Type230 [FileInfo,VideoObject]=get_file_type(GUI.ImageA); 231 switch FileInfo.FileType 232 232 case {'image','multimage','video','mmreader'}% case of input image or movie OK 233 233 otherwise … … 265 265 266 266 %% detect the grid points which are inside image A 267 A=read_image(GUI.ImageA,File Type,VideoObject,1);267 A=read_image(GUI.ImageA,FileInfo.FileType,VideoObject,1); 268 268 npxA=size(A,2); 269 269 npyA=size(A,1); … … 323 323 'Pick the second image file',fileparts(fileparts(get(handles.ImageA,'String')))); 324 324 ImageB=fullfile(PathName,FileName); 325 [File Type,tild,VideoObject]=get_file_type(ImageB);326 switch File Type325 [FileInfo,tild,VideoObject]=get_file_type(ImageB); 326 switch FileInfo.FileType 327 327 case {'image','multimage','video','mmreader'}% case of input image or movie OK 328 328 set(handles.ImageB,'String',ImageB) -
trunk/src/uigetfile_uvmat.m
r714 r783 147 147 uiresume(hfig) 148 148 case 'status_display' 149 File Type=get_file_type(FullSelectName);150 if strcmp(File Type,'txt')149 FileInfo=get_file_type(FullSelectName); 150 if strcmp(FileInfo.FileType,'txt') 151 151 edit(FullSelectName) 152 elseif strcmp(File Type,'xml')152 elseif strcmp(FileInfo.FileType,'xml') 153 153 editxml(FullSelectName) 154 elseif strcmp(File Type,'figure')154 elseif strcmp(FileInfo.FileType,'figure') 155 155 open(FullSelectName) 156 156 else -
trunk/src/uvmat.m
r782 r783 643 643 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 644 644 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 645 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,File Type,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);645 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 646 646 if isempty(i1_series) 647 647 fileinput=uigetfile_uvmat('pick an input file',fullfile(RootPath,SubDir)); … … 666 666 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles); 667 667 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 668 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,File Type,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]);668 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=find_file_series(fullfile(RootPath,SubDir),[RootFile FileIndices FileExt]); 669 669 if isempty(i1_series) 670 670 fileinput=uigetfile_uvmat('pick an input file for the second line',fullfile(RootPath,SubDir)); … … 737 737 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 738 738 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 739 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,File Type,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);740 739 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]); 740 FileType=FileInfo.FileType; 741 741 if strcmp(FileType,'txt') 742 742 try … … 1384 1384 for ifile=1:numel(ListFiles) 1385 1385 [tild,tild,MaskExt]=fileparts(ListFiles{1}); 1386 [tild,tild,MaskFile{ifile},i1_series,i2_series,j1_series,j2_series,MaskNomType,MaskFileType]=find_file_series(MaskPath,ListFiles{ifile},0); 1386 [tild,tild,MaskFile{ifile},i1_series,i2_series,j1_series,j2_series,MaskNomType,MaskFileInfo]=find_file_series(MaskPath,ListFiles{ifile},0); 1387 MaskFileType=MaskFileInfo.FileType; 1387 1388 if strcmp(MaskFileType,'image') && isempty(i2_series) && isempty(j2_series) 1388 1389 mdetect=1; … … 2185 2186 case 'multimage' 2186 2187 if ~strcmp(NomType,'*') 2188 MaxIndex_j_cell=get(handles.MaxIndex_j,'String'); 2189 if num_j1>str2num(MaxIndex_j_cell{1}) 2190 errormsg='specified frame index exceeds file content'; 2191 return 2192 else 2187 2193 frame_index=num_j1;%frame index for movies or multimage 2194 end 2188 2195 else 2196 MaxIndex_i_cell=get(handles.MaxIndex_i,'String'); 2197 if num_i1>str2num(MaxIndex_i_cell{1}) 2198 errormsg='specified frame index exceeds file content'; 2199 return 2200 else 2189 2201 frame_index=num_i1; 2202 end 2190 2203 end 2191 2204 case 'vol' %TODO: update … … 3877 3890 3878 3891 %% delete drawn objects if the output CooordUnit is different from the previous one 3879 if ~ strcmp(CoordUnit,CoordUnitPrev)3892 if ~isempty(CoordUnit) && ~isempty(CoordUnitPrev) && ~strcmp(CoordUnit,CoordUnitPrev) 3880 3893 set(handles.CheckFixLimits,'Value',0) 3881 3894 hother=findobj('Tag','proj_object');%find all the proj objects
Note: See TracChangeset
for help on using the changeset viewer.