- Timestamp:
- Jan 16, 2012, 12:28:26 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r371 r372 1348 1348 Param.Civ2.ImageB=filecell.ima2.civ2{ifile,j}; 1349 1349 if ~checkframe %&& size(time,1)>=i2_civ2(ifile) && size(time,2)>=j2_civ2(j) 1350 Param.Civ2.Dt= num2str(time(i2_civ2(ifile)+1,j2_civ2(j)+1)-time(i1_civ2(ifile)+1,j1_civ2(j)+1));1350 Param.Civ2.Dt=time(i2_civ2(ifile)+1,j2_civ2(j)+1)-time(i1_civ2(ifile)+1,j1_civ2(j)+1); 1351 1351 else 1352 1352 Param.Civ2.Dt=1; 1353 1353 end 1354 Param.Civ2.Time= num2str((time(i2_civ2(ifile)+1,j2_civ2(j)+1)+time(i1_civ2(ifile)+1,j1_civ2(j)+1))/2);1354 Param.Civ2.Time=(time(i2_civ2(ifile)+1,j2_civ2(j)+1)+time(i1_civ2(ifile)+1,j1_civ2(j)+1))/2; 1355 1355 Param.Civ2.term_a=num2stra(j1_civ2(j),nom_type_nc); 1356 1356 Param.Civ2.term_b=num2stra(j2_civ2(j),nom_type_nc); -
trunk/src/civ_matlab.m
r370 r372 282 282 end 283 283 Data.ListGlobalAttribute=[Data.ListGlobalAttribute Civ2_param {'Civ2_Time','Civ2_Dt'}]; 284 Data.Civ2_Time=str2double(par_civ2.Time);285 Data.Civ2_Dt=str2double(par_civ2.Dt);284 % Data.Civ2_Time=par_civ2.Time; 285 % Data.Civ2_Dt=par_civ2.Dt; 286 286 nbvar=numel(Data.ListVarName); 287 287 Data.ListVarName=[Data.ListVarName {'Civ2_X','Civ2_Y','Civ2_U','Civ2_V','Civ2_F','Civ2_C'}];% cell array containing the names of the fields to record -
trunk/src/find_file_series.m
r371 r372 37 37 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 38 38 39 function [RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(RootPath,fileinput )39 function [RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(RootPath,fileinput,option) 40 40 %------------------------------------------------------------------------ 41 41 if ~exist('option','var') 42 option='all'; 43 end 42 44 %% get input root name and nomenclature type 43 45 [tild,tild,RootFile,tild,i2_input,j1_input,j2_input,FileExt,NomType]=fileparts_uvmat(fileinput); … … 103 105 end 104 106 105 if strcmp(NomType,'')||strcmp(NomType,'*') 107 if strcmp(NomType,'')||strcmp(NomType,'*')||strcmp(option,'filetype') 106 108 if exist(fullfileinput,'file') 107 109 [tild,RootFile]=fileparts(fileinput);% case of constant name (no indexing) … … 251 253 NomType=''; 252 254 else 253 [tild,tild,tild,tild,tild,tild,tild,tild,NomType]=fileparts_uvmat(dirpair(ifile_min).name); 254 end 255 [tild,tild,tild,tild,tild,tild,tild,tild,NomType]=fileparts_uvmat(dirpair(ifile_min).name);% update the representation of indices (number of 0 before the number) 256 end 257 end 258 259 %% update the file type if the input file does not exist (pb of 0001) 260 if strcmp(option,'filetype') 261 return 262 elseif isempty(FileType) 263 [tild,tild, tild,tild,tild,tild,FileType,Object]=find_file_series(RootPath,dirpair(ifile_min).name,'filetype'); 255 264 end 256 265 -
trunk/src/fullfile_uvmat.m
r371 r372 48 48 j2=[]; 49 49 end 50 if ~exist('j1','var') 51 j1=[]; 52 end 50 53 if isequal(j1,j2) 51 54 j2=[];% suppress the secodn index if equal to the first 52 end53 if ~exist('j1','var')54 j1=1;55 55 end 56 56 if ~exist('i2','var') -
trunk/src/proj_field.m
r329 r372 249 249 eval(['ProjData.' VarName '(ipoint,1)=mean(Var);']) 250 250 if isequal(ObjectData.ProjMode,'interp') 251 eval(['ProjData.' VarName '(ipoint,1)=griddata_uvmat(coord_x(indsel),coord_y(indsel),Var,Xpoint(1),Xpoint(2)))';])251 ProjData.(VarName)(ipoint,1)=griddata_uvmat(coord_x(indsel),coord_y(indsel),Var,Xpoint(1),Xpoint(2)); 252 252 end 253 253 end … … 1556 1556 end 1557 1557 end 1558 ProjData1559 ProjData.VarDimName{3}1560 1558 1561 1559 %----------------------------------------------------------------- -
trunk/src/read_civdata.m
r364 r372 75 75 return 76 76 end 77 switch vel_type_out_cell{ichoice} 78 case{'civ1','fix1','patch1'} 79 Field.dt=Field.Civ1_Dt; 80 case{'civ2','fix2','patch2'} 81 Field.dt=Field.Civ2_Dt; 82 end 83 Field.ListGlobalAttribute=[Field.ListGlobalAttribute {'dt'}]; 77 84 var_ind=find(vardetect); 78 85 for ivar=1:min(numel(var_ind),numel(Field.VarAttribute)) -
trunk/src/series.m
r371 r372 454 454 [RootPath,SubDir,RootFile,i1,i2,j1,j2,FileExt,NomType]=fileparts_uvmat(fileinput); 455 455 456 %% determine reference field indices456 %% determine the selected reference field indices for pair dispaly 457 457 ref_i=1; %default ref_i is a reference frame index used to find existing pairs from PIV 458 458 if ~isempty(i1) … … 460 460 if ~isempty(i2) 461 461 ref_i=floor((ref_i+i2)/2);% reference image number corresponding to the file 462 % SeriesData.browse_Di=i2-i1;463 462 end 464 463 end 465 464 set(handles.ref_i,'String',num2str(ref_i)); 466 set(handles.num_first_i,'String',num2str(ref_i));467 set(handles.num_last_i,'String',num2str(ref_i));468 465 ref_j=1; %default ref_j is a reference frame index used to find existing pairs from PIV 469 466 if ~isempty(j1) … … 471 468 if ~isempty(j2) 472 469 ref_j=floor((j1+j2)/2); 473 % SeriesData.browse_Dj=j2-j1;474 470 end 475 471 end 476 472 set(handles.ref_j,'String',num2str(ref_j)); 473 ref_i_Callback([],[], handles) 474 ref_j_Callback([],[], handles) 475 476 %% update the first and last reference indices if empty 477 first_i=str2num(get(handles.num_first_i,'String')); 478 if isempty(first_i) 479 set(handles.num_first_i,'String',num2str(ref_i)); 480 set(handles.num_last_i,'String',num2str(ref_i)); 477 481 set(handles.num_first_j,'String',num2str(ref_j)) 478 482 set(handles.num_last_j,'String',num2str(ref_j)); 479 TimeUnit=''; %default 480 time=[];%default 481 482 % read timing and total frame number from the current file (movie files) !! may be overrid by xml file483 FileBase=fullfile(RootPath,RootFile); 484 485 testima=0; %test for image input486 if isequal(lower(FileExt),'.avi') %.avi file487 testima=1;488 elseif ~isempty(imformats(FileExt(2:end)))489 testima=1;490 elseif isequal(FileExt,'.vol')491 testima=1;492 end483 end 484 485 % 486 % % FileBase=fullfile(RootPath,RootFile); 487 % TimeUnit=''; %default 488 % time=[];%default 489 % testima=0; %test for image input 490 % if isequal(lower(FileExt),'.avi') %.avi file 491 % testima=1; 492 % elseif ~isempty(imformats(FileExt(2:end))) 493 % testima=1; 494 % elseif isequal(FileExt,'.vol') 495 % testima=1; 496 % end 493 497 494 498 %% fill the list of file series 495 496 % insert the current file series at the head of the list497 499 InputTable=get(handles.InputTable,'Data'); 498 if addtest % insert the new data at the first line ofthe table500 if addtest % display the input data as a new line in the table 499 501 val=size(InputTable,1)+1; 500 502 InputTable(val,:)=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}]; … … 502 504 else % or re-initialise the list of input file series 503 505 val=1; 504 InputTable=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}] 506 InputTable=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}]; 505 507 set(handles.TimeTable,'Data',[{[]},{[]},{[]},{[]}]) 506 508 set(handles.MinIndex,'Data',[{[]},{[]}]) … … 510 512 check_lines(val)=1; %select the edited line for refresh 511 513 set(handles.REFRESH_INDICES,'UserData',check_lines); 514 515 %% refresh menus with info fromthe new series 512 516 REFRESH_INDICES_Callback([],[], handles) 513 517 514 % store the root name for future opening of uvmat518 %% store the root name for future opening of uvmat 515 519 dir_perso=prefdir; 516 520 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); … … 1088 1092 %------------------------------------------------------------------------ 1089 1093 %% Read parameters from series 1090 Series=read_GUI(handles.series) %TODO: extend to all input param1094 Series=read_GUI(handles.series);%TODO: extend to all input param 1091 1095 Series.hseries=handles.series; % handles to the series GUI 1092 1096 … … 1272 1276 %% RUN ACTION 1273 1277 Series.Action=action;%name of the processing programme 1274 Series1275 1278 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 1276 1279 h_fun(Series); … … 1344 1347 mode=mode_list{mode_value}; 1345 1348 SeriesData=get(handles.series,'UserData'); 1346 %NomTypeCell=get(handles.NomType,'String'); 1347 NomTypeCell=SeriesData.NomType; 1348 if ~isempty(NomTypeCell) 1349 Val=get(handles.NomType,'Value'); 1350 NomType=NomTypeCell{Val}; 1351 % for ilist=1:length(NomType) 1352 if isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')|| isequal(NomType,'_1-2') 1353 if isequal(mode,'series(Di)') 1354 find_netcpair_civ(handles,Val);% update the menu of pairs depending on the available netcdf files 1355 % break 1356 end 1349 if ~isempty(SeriesData.i2_series)||~isempty(SeriesData.j2_series) 1350 if isequal(mode,'series(Di)') 1351 find_netcpair_civ(handles,Val);% update the menu of pairs depending on the available netcdf files 1357 1352 end 1358 1353 end … … 1365 1360 mode=mode_list{mode_value}; 1366 1361 SeriesData=get(handles.series,'UserData'); 1367 NomTypeCell=SeriesData.NomType; 1368 if ~isempty(NomTypeCell) 1369 Val=get(handles.NomType,'Value'); 1370 NomType=NomTypeCell{Val}; 1371 if isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')|| isequal(NomType,'_1-2') 1372 if isequal(mode,'series(Dj)') 1373 find_netcpair_civ(handles,Val);% update the menu of pairs depending on the available netcdf files 1374 end 1375 end 1376 end 1362 if ~isempty(SeriesData.i2_series)||~isempty(SeriesData.j2_series) 1363 if isequal(mode,'series(Di)') 1364 find_netcpair_civ(handles,Val);% update the menu of pairs depending on the available netcdf files 1365 end 1366 end 1367 % NomTypeCell=SeriesData.NomType; 1368 % if ~isempty(NomTypeCell) 1369 % Val=get(handles.NomType,'Value'); 1370 % NomType=NomTypeCell{Val}; 1371 % if isequal(NomType,'_1_1-2')|| isequal(NomType,'_1-2_1')|| isequal(NomType,'_1-2') 1372 % if isequal(mode,'series(Dj)') 1373 % find_netcpair_civ(handles,Val);% update the menu of pairs depending on the available netcdf files 1374 % end 1375 % end 1376 % end 1377 1377 1378 1378 %------------------------------------------------------------------------ … … 1497 1497 % FileExt=get(handles.FileExt,'String'); 1498 1498 % nb_series=length(FileExt); 1499 InputFiles=get(handles.InputTable,'Data') 1500 FileExt=InputFiles(:,5); 1501 checkcell=find(cellfun('isempty',FileExt)~=0); 1502 nb_series=0; 1503 if ~isempty(checkcell) 1504 nb_series=checkcell(end); 1505 end 1499 InputTable=get(handles.InputTable,'Data'); 1500 nb_series=size(InputTable,1); 1501 % if ~isempty(checkcell) 1502 % nb_series=checkcell(end); 1503 % end 1506 1504 % nb_series=size(InputFiles,1) 1507 1505 testima_series=1; %test for a list of images only … … 1510 1508 testciv_series=1; 1511 1509 for iview=1:nb_series 1512 ext= FileExt{iview};1510 ext=InputTable{iview,5}; 1513 1511 if length(ext)<2 1514 1512 ext='.none'; … … 1527 1525 for ilist=1:length(varargout)-1 1528 1526 switch varargout{ilist} 1527 1529 1528 %RootFile always visible 1530 1529 % case 'RootPath' %visible by default … … 1559 1558 end 1560 1559 case 'VelTypeMenu' %hidden by default 1561 if isequal(lower(varargout{ilist+1}),'one') || isequal(lower(varargout{ilist+1}),'two')1560 if isequal(lower(varargout{ilist+1}),'one') || isequal(lower(varargout{ilist+1}),'two') 1562 1561 set(handles.VelTypeMenu,'Enable','on') 1563 1562 if nb_series >=1 && ~testima_series 1564 1563 set(handles.VelTypeMenu,'Visible','on') 1565 1564 set(handles.VelType_text,'Visible','on'); 1566 set(handles.Field_frame,'Visible','on')1565 % set(handles.Field_frame,'Visible','on') 1567 1566 end 1568 end1567 end 1569 1568 if isequal(lower(varargout{ilist+1}),'two') 1570 1569 set(handles.VelTypeMenu_1,'Enable','on') … … 2146 2145 %fileinput=name_generator(fullfile(InputLine{1},InputLine{3}),1,1,InputLine{5},InputLine{4},1,2,2,InputLine{2}) 2147 2146 %update file series defined by the selected line 2148 [InputTable{ind_list, 1},InputTable{ind_list,3},InputTable{(ind_list),4},errormsg]=update_indices(handles,fileinput,ind_list);2147 [InputTable{ind_list,3},InputTable{(ind_list),4},errormsg]=update_indices(handles,fileinput,ind_list); 2149 2148 if ~isempty(errormsg) 2150 2149 msgbox_uvmat('ERROR',errormsg) … … 2184 2183 ListView_Callback(hObject,eventdata,handles) 2185 2184 end 2186 set(handles.Pairs,'Visible',state_ InputFields)2185 set(handles.Pairs,'Visible',state_Pairs) 2187 2186 enable_j(handles,state_j) 2188 2187 set(handles.REFRESH_INDICES,'BackgroundColor',[1 0 0]) 2189 2188 set(handles.REFRESH_INDICES,'visible','off') 2190 2189 2191 % update min and max indices for a series 2192 function [RootPath,RootFile,NomType,errormsg]=update_indices(handles,fileinput,iview) 2193 2190 % ----------------------------------------------------------------------- 2191 % --- Update min and max indices of a file series by scanning with find_file_series 2192 % --- which also changes the root file and NomType in case of movie. Also adjust the string representation of indices (e.g; 2193 % --- 1 or 001 by the function find_file_series 2194 % --- This function also dispaly the set of availbale files in the series 2195 % --- and the menus appropriate to the file type as well as timing possibly set 2196 % --- by an xml image documentation file 2197 function [RootFile,NomType,errormsg]=update_indices(handles,fileinput,iview) 2198 % ----------------------------------------------------------------------- 2194 2199 %% look for min and max indices existing in the file series and update SeriesData 2195 2200 errormsg=''; 2196 [RootPath ,FileName,FileExt]=fileparts(fileinput);2197 [RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(RootPath ,[FileName FileExt]);2201 [RootPathSub,FileName,FileExt]=fileparts(fileinput); 2202 [RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(RootPathSub,[FileName FileExt]); 2198 2203 if isempty(RootFile)&&isempty(i1_series) 2199 2204 errormsg='no input file in the series'; … … 2229 2234 SeriesData.FileType{iview}=FileType; 2230 2235 2231 %% representsthe set of existing files as an image2236 %% display the set of existing files as an image 2232 2237 set(handles.waitbar_frame,'Units','pixels') 2233 2238 pos=get(handles.waitbar_frame,'Position'); … … 2259 2264 testveltype_1=isequal(get(handles.VelTypeMenu_1,'enable'),'on'); 2260 2265 testtransform=isequal(get(handles.transform_fct,'Enable'),'on'); 2261 testnc=0; 2262 testnc_1=0; 2263 testcivx=0; 2264 testcivx_1=0; 2266 % testnc=0; 2267 % testnc_1=0; 2268 % testcivx=0; 2269 % testcivx_1=0; 2270 % testima=0; %test for image input 2271 % if isequal(lower(FileExt),'.avi') %.avi file 2272 % testima=1; 2273 % elseif ~isempty(imformats(FileExt(2:end))) 2274 % testima=1; 2275 % elseif isequal(FileExt,'.vol') 2276 % testima=1; 2277 % end 2265 2278 %TODO: update 2266 2279 % if length(FileExtCell)==1 || length(FileExtCell)>2 … … 2279 2292 % testcivx_1=isequal(FileTypeCell{2},'civx'); 2280 2293 % end 2281 if testfield && testnc 2294 switch FileType 2295 case {'civx','civdata'} 2282 2296 view_FieldMenu(handles,'on') 2283 if testcivx 2284 menustr=get(handles.FieldMenu,'String'); 2285 if isequal(menustr,{'get_field...'}) 2286 set(handles.FieldMenu,'String',{'get_field...';'velocity';'vort';'div';'more...'}) 2287 end 2288 else 2289 set(handles.FieldMenu,'Value',1) 2290 set(handles.FieldMenu,'String',{'get_field...'}) 2291 end 2292 else 2297 menustr=get(handles.FieldMenu,'String'); 2298 if isequal(menustr,{'get_field...'}) 2299 set(handles.FieldMenu,'String',{'get_field...';'velocity';'vort';'div';'more...'}) 2300 end 2301 set(handles.VelTypeMenu,'Visible','on') 2302 set(handles.FieldTransform,'Visible','on') 2303 % view_TRANSFORM(handles,'on') 2304 % TODO: second menu 2305 % view_FieldMenu_1(handles,'on') 2306 % if testcivx_1 2307 % menustr=get(handles.FieldMenu_1,'String'); 2308 % if isequal(menustr,{'get_field...'}) 2309 % set(handles.FieldMenu_1,'String',{'get_field...';'velocity';'vort';'div';'more...'}) 2310 % end 2311 % else 2312 % set(handles.FieldMenu_1,'Value',1) 2313 % set(handles.FieldMenu_1,'String',{'get_field...'}) 2314 % set(handles.VelTypeMenu_1,'Visible','on') 2315 % set(handles.VelType_text_1,'Visible','on'); 2316 % end 2317 % view_FieldMenu_1(handles,'off') 2318 case 'netcdf' 2319 view_FieldMenu(handles,'on') 2320 set(handles.FieldMenu,'Value',1) 2321 set(handles.FieldMenu,'String',{'get_field...'}) 2322 set(handles.FieldTransform,'Visible','off') 2323 % view_TRANSFORM(handles,'off') 2324 case {'image','multimage','video'} 2293 2325 view_FieldMenu(handles,'off') 2294 end2295 if testfield_1 && testnc_12296 view_FieldMenu_1(handles,'on')2297 if testcivx_12298 menustr=get(handles.FieldMenu_1,'String');2299 if isequal(menustr,{'get_field...'})2300 set(handles.FieldMenu_1,'String',{'get_field...';'velocity';'vort';'div';'more...'})2301 end2302 else2303 set(handles.FieldMenu_1,'Value',1)2304 set(handles.FieldMenu_1,'String',{'get_field...'})2305 end2306 else2307 2326 view_FieldMenu_1(handles,'off') 2308 end2309 if testveltype && testcivx2310 set(handles.VelTypeMenu,'Visible','on')2311 set(handles.VelType_text,'Visible','on');2312 else2313 2327 set(handles.VelTypeMenu,'Visible','off') 2314 2328 set(handles.VelType_text,'Visible','off'); 2315 2329 end 2316 if testveltype_1 && testcivx_1 2317 set(handles.VelTypeMenu_1,'Visible','on') 2318 set(handles.VelType_text_1,'Visible','on'); 2319 else 2320 set(handles.VelTypeMenu_1,'Visible','off') 2321 set(handles.VelType_text_1,'Visible','off'); 2322 end 2323 if testtransform && (testcivx || testima) 2324 set(handles.FieldTransform,'Visible','on') 2325 % view_TRANSFORM(handles,'on') 2326 else 2327 set(handles.FieldTransform,'Visible','off') 2328 % view_TRANSFORM(handles,'off') 2329 end 2330 2331 2330 2332 %TODO:update 2331 2333 % if ~isequal(FileExt,'.nc') && ~isequal(FileExt,'.cdf') && ~testima … … 2336 2338 %% read image documentation file if found%%%%%%%%%%%%%%%%%%%%%%%%%%% 2337 2339 ext_imadoc=''; 2338 FileBase=fullfile(RootPath ,RootFile);2340 FileBase=fullfile(RootPathSub,RootFile); 2339 2341 if isequal(FileExt,'.xml')||isequal(FileExt,'.civ') 2340 2342 ext_imadoc=FileExt;
Note: See TracChangeset
for help on using the changeset viewer.