Changeset 319 for trunk/src/civ.m
- Timestamp:
- Dec 6, 2011, 8:14:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r317 r319 196 196 browse=[];%initialisation 197 197 else 198 browse=get(handles RootName,'UserData');198 browse=get(handles.RootName,'UserData'); 199 199 end 200 200 browse.num_i1=num_i1; … … 289 289 set(handles.num_Rho,'Value',1) 290 290 set(handles.num_Rho,'String',{'1';'2'}) 291 set(handles.BATCH,'Enable','off')291 % set(handles.BATCH,'Enable','off') 292 292 293 293 % ----------------------------------------------------------------------- … … 345 345 num_ref_i=i1;%efaulmt ref index 346 346 num_ref_j=j1; 347 browse=get(handles.RootName,'UserData'); 347 348 browse.incr_pair=[0 0];%default 348 349 … … 1180 1181 cmd=[cmd... 1181 1182 cmd_civ1(filecell.nc.civ1{ifile,j},Param) '\n']; 1183 if ~isempty(errormsg) 1184 msgbox_uvmat('ERROR',errormsg) 1185 return 1186 end 1182 1187 case 'CivAll' 1183 1188 CivAllCmd=[CivAllCmd ' civ1 ']; … … 1428 1433 drawnow 1429 1434 if ~strcmp(compare,'stereo PIV') 1430 [Data,erromsg]=civ_matlab(Param,filecell.nc.civ1{ifile,j}); 1431 if isempty(errormsg) 1432 display([filecell.nc.civ1{ifile,j} ' written']) 1435 filename_xml=[OutputFile '.civ.xml']; 1436 t=struct2xml(Param); 1437 save(t,filename_xml) 1438 if batch 1439 batch_file_list{length(batch_file_list)+1}=filename_xml; 1433 1440 else 1434 msgbox_uvmat('ERROR',errormsg) 1435 end 1441 [Data,erromsg]=civ_matlab(Param,filecell.nc.civ1{ifile,j}); 1442 if isempty(errormsg) 1443 display([filecell.nc.civ1{ifile,j} ' written']) 1444 else 1445 msgbox_uvmat('ERROR',errormsg) 1446 end 1447 end 1436 1448 end 1437 1449 end … … 2471 2483 %------------------------------------------------------------------------ 2472 2484 test=get(handles.ListCompareMode,'Value'); 2473 if test==2 || test==3 % case 'disp alcemen' or 'stereo PIV'2485 if test==2 || test==3 % case 'displacement' or 'stereo PIV' 2474 2486 filebase=get(handles.RootName,'String'); 2475 browse=get(handles RootName,'Userdata');2487 browse=get(handles.RootName,'Userdata'); 2476 2488 browse.nom_type_ima1=browse.nom_type_ima; 2477 set(handles RootName,'UserData',browse);2489 set(handles.RootName,'UserData',browse); 2478 2490 set(handles.sub_txt,'Visible','on') 2479 2491 set(handles.RootName_1,'Visible','On');%mkes the second file input window visible … … 2519 2531 [RootPath,RootFile,field_count,str2,str_a,str_b,xx,nom_type,subdir]=name2display(name); 2520 2532 set(handles.RootName_1,'String',RootFile); 2521 browse=get(handles RootName,'UserData');2533 browse=get(handles.RootName,'UserData'); 2522 2534 browse.nom_type_ima_1=nom_type; 2523 set(handles RootName,'UserData',browse)2535 set(handles.RootName,'UserData',browse) 2524 2536 2525 2537 %check image extension … … 2549 2561 set(handles.ListPairMode,'Value',1) 2550 2562 set(handles.ListPairMode,'String',mode_store) 2551 set(handles.test_stereo1,'Value',0)2563 % set(handles.test_stereo1,'Value',0) 2552 2564 set(handles.CheckStereo,'Value',0) 2553 2565 set(handles.ListPairMode,'Value',1) % mode 'civX' selected by default 2554 2566 end 2555 2567 if test==3 && get(handles.CheckPatch1,'Value') 2556 set(handles. test_stereo1,'Visible','on')2557 else 2558 set(handles. test_stereo1,'Visible','off')2568 set(handles.CheckStereo,'Visible','on') 2569 else 2570 set(handles.CheckStereo,'Visible','off') 2559 2571 end 2560 2572 if test==3 && get(handles.CheckPatch2,'Value') … … 2563 2575 set(handles.CheckStereo,'Visible','off') 2564 2576 end 2565 mode_Callback(hObject, eventdata, handles)2577 ListPairMode_Callback(hObject, eventdata, handles) 2566 2578 2567 2579 … … 2701 2713 displ_num(3,1)=0; 2702 2714 displ_num(4,1)=0; 2703 if nbfield > 1 2715 if nbfield > 1 || nbfield==0 2704 2716 set(handles.itext,'Visible','On') 2705 2717 set(handles.first_i,'Visible','On') … … 3656 3668 3657 3669 %% if hObject is on the checkciv1 frame, duplicate action for checkciv2 frame 3658 PanelName=get(hparent,'tag') 3670 PanelName=get(hparent,'tag'); 3659 3671 if strcmp(PanelName,'Civ1') 3660 3672 hchildren=get(handles.Civ2,'children'); … … 4038 4050 %pixels per cm and matrix of the image times, read from the .civ file by uvmat 4039 4051 %changes : filename_cmx -> filename ( no extension ) 4052 cmd=''; 4053 errormsg=''; %default 4040 4054 filename=regexprep(filename,'.nc',''); %file name for the result 4041 4055 if isequal(Param.Civ1.Dt,'0') … … 4045 4059 Param.Civ1.ImageB=regexprep(Param.Civ1.ImageB,'.png',''); 4046 4060 fid=fopen([filename '.civ1.cmx'],'w'); 4061 if isequal(fid,-1) 4062 display(['cmd file ' filename ' cannot be created']) 4063 return 4064 end 4047 4065 fprintf(fid,['############## CMX file' '\n' ]); 4048 4066 fprintf(fid, ['FirstImage ' regexprep(Param.Civ1.ImageA,'\\','\\\\') '\n' ]);% for windows compatibility … … 4358 4376 Data.ListVarName={'ny','nx','A'}; 4359 4377 Data.VarDimName= {'ny','nx',{'ny','nx'}}; 4360 4361 Param=read_GUI(handles.civ) 4362 Param.CheckOutputFile=0; 4363 [Data,errormsg]=civ_matlab(Param,filecell.nc.civ1{1})% get the grid of x, y positions set for PIV 4364 if ~isempty(errormsg) 4365 msgbox_uvmat('ERROR',Data.Txt) 4366 return 4367 end 4368 set(handles.TestCiv1,'BackgroundColor',[1 0 0]) 4378 4379 param_patch1=read_GUI(handles.Patch1); 4380 param_patch1.CivFile=filecell.nc.civ1{1}; 4381 Param.Patch1=param_patch1; 4382 for irho=1:7 4383 [Data,errormsg]=civ_matlab(Param);% get the grid of x, y positions set for PIV 4384 if ~isempty(errormsg) 4385 msgbox_uvmat('ERROR',Data.Txt) 4386 return 4387 end 4388 SmoothingParam(irho)=Param.Patch1.SmoothingParam; 4389 Data.Civ1_U_Diff=Data.Civ1_U_Diff(Data.Civ1_FF==0); 4390 Data.Civ1_V_Diff=Data.Civ1_V_Diff(Data.Civ1_FF==0); 4391 DiffVel(irho)=sqrt(mean(Data.Civ1_U_Diff.*Data.Civ1_U_Diff+Data.Civ1_V_Diff.*Data.Civ1_V_Diff)) 4392 Param.Patch1.SmoothingParam=2*Param.Patch1.SmoothingParam; 4393 end 4394 figure 4395 plot(SmoothingParam,DiffVel) 4396 set(handles.TestPatch1,'BackgroundColor',[1 0 0]) 4369 4397 else 4370 4398 corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display … … 4372 4400 delete(corrfig) 4373 4401 end 4374 hview_field=findobj(allchild(0),'tag','view_field');% look for view_field 4402 hview_field=findobj(allchild(0),'tag','view_field');% look for view_field 4375 4403 if ~isempty(hview_field) 4376 4404 delete(hview_field)
Note: See TracChangeset
for help on using the changeset viewer.