Changeset 263
- Timestamp:
- Oct 21, 2011, 6:31:43 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r262 r263 1508 1508 return 1509 1509 end 1510 [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc]=... 1511 set_civ_filenames(handles,ref_i,ref_j,box_test); 1510 [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,xx,yy,compare]=... 1511 set_civ_filenames(handles,ref_i,ref_j,box_test) 1512 1512 1513 set(handles.civ,'UserData',filecell);%store for futur use of status callback 1513 1514 if isempty(filecell)% (error message displayed in fct set_civ_filenames) … … 1602 1603 if isfield(sparam,'Civ1Bin') 1603 1604 Civ1Bin=sparam.Civ1Bin; 1604 if ~exist(Civ1Bin,'file') ||isempty(which(Civ1Bin))% if path defined as relative to uvmat1605 if ~exist(Civ1Bin,'file')&&~isempty(which(Civ1Bin))% if path defined as relative to uvmat 1605 1606 sparam.Civ1Bin=fullfile(path_UVMAT,Civ1Bin); 1606 1607 if ~exist(sparam.Civ1Bin,'file') … … 1612 1613 if isfield(sparam,'Civ2Bin') 1613 1614 Civ2Bin=sparam.Civ2Bin; 1614 if ~exist(Civ2Bin,'file') ||isempty(which(Civ2Bin))% if path defined as relative to uvmat1615 if ~exist(Civ2Bin,'file')&&~isempty(which(Civ2Bin))% if path defined as relative to uvmat 1615 1616 sparam.Civ2Bin=fullfile(path_UVMAT,Civ2Bin); 1616 1617 if ~exist(sparam.Civ2Bin,'file') … … 1621 1622 end 1622 1623 if isfield(sparam,'PatchBin') 1623 if ~exist(sparam.PatchBin,'file') ||isempty(which(sparam.PatchBin))% if path defined as relative to uvmat1624 if ~exist(sparam.PatchBin,'file')&&~isempty(which(sparam.PatchBin))% if path defined as relative to uvmat 1624 1625 sparam.PatchBin=fullfile(path_UVMAT,sparam.PatchBin); 1625 1626 end 1626 1627 end 1627 1628 if isfield(sparam,'FixBin') 1628 if ~exist(sparam.FixBin,'file') ||isempty(which(sparam.FixBin))% if path defined as relative to uvmat1629 if ~exist(sparam.FixBin,'file')&&~isempty(which(sparam.FixBin))% if path defined as relative to uvmat 1629 1630 sparam.FixBin=fullfile(path_UVMAT,sparam.FixBin); 1630 1631 end … … 1758 1759 CivAllxml=set(CivAllxml,1,'name','CivDoc'); 1759 1760 end 1760 [Rootbat,Filebat]=fileparts(filecell.nc.civ1{ifile,j});%output netcdf file (without exten tion)1761 [Rootbat,Filebat]=fileparts(filecell.nc.civ1{ifile,j});%output netcdf file (without extension) 1761 1762 flname=fullfile(Rootbat,Filebat); 1762 1763 if batch … … 2164 2165 end 2165 2166 if box_test(3)==1 2166 Param.Patch1.Rho=rho_patch1; 2167 Param.Patch1.Threshold=thresh_patch1; 2168 Param.Patch1.SubDomain=subdomain_patch1; 2167 if strcmp(compare,'stereo PIV') 2168 filebase_A=filecell.filebase; 2169 [pp,ff]=fileparts(filebase_A); 2170 filebase_B=fullfile(pp,get(handles.RootName_1,'String')); 2171 RUN_STLIN(filecell.ncA.civ1{ifile,j},filecell.nc.civ1{ifile,j},'civ1',filecell.st{ifile,j},... 2172 str2num(nx_patch1),str2num(ny_patch1),str2num(thresh_patch1),[filebase_A '.xml'],[filebase_B '.xml']) 2173 else 2174 Param.Patch1.Rho=rho_patch1; 2175 Param.Patch1.Threshold=thresh_patch1; 2176 Param.Patch1.SubDomain=subdomain_patch1; 2177 end 2169 2178 end 2170 2179 if box_test(4)==1 … … 2193 2202 Param.Fix2=fix2; 2194 2203 end 2195 [Data,erromsg]=civ_uvmat(Param,filecell.nc.civ1{ifile,j}); 2196 if isempty(errormsg) 2197 display([filecell.nc.civ1{ifile,j} ' written']) 2198 else 2199 msgbox_uvmat('ERROR',errormsg) 2204 if box_test(6)==1 2205 if strcmp(compare,'stereo PIV') 2206 filebase_A=filecell.filebase; 2207 [pp,ff]=fileparts(filebase_A); 2208 filebase_B=fullfile(pp,get(handles.RootName_1,'String')); 2209 RUN_STLIN(filecell.ncA.civ2{ifile,j},filecell.nc.civ2{ifile,j},'civ2',filecell.st{ifile,j},... 2210 str2num(nx_patch2),str2num(ny_patch2),str2num(thresh_patch2),[filebase_A '.xml'],[filebase_B '.xml']) 2211 end 2212 end 2213 if ~strcmp(compare,'stereo PIV') 2214 [Data,erromsg]=civ_uvmat(Param,filecell.nc.civ1{ifile,j}); 2215 if isempty(errormsg) 2216 display([filecell.nc.civ1{ifile,j} ' written']) 2217 else 2218 msgbox_uvmat('ERROR',errormsg) 2219 end 2200 2220 end 2201 2221 end … … 2273 2293 %------------------------------------------------------------------------ 2274 2294 % --- determine the list of filenames and indices needed for launch_job 2275 function [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2 ]=...2295 function [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2,compare]=... 2276 2296 set_civ_filenames(handles,ref_i,ref_j,box_test) 2277 2297 %------------------------------------------------------------------------ … … 2503 2523 %create the new subdir_civ1 2504 2524 if ~exist(fullfile(Path_ima,subdir_civ1_new),'dir') 2505 cd(Path_ima);2506 [xx,msg1]=mkdir( subdir_civ1_new);2525 % cd(Path_ima); 2526 [xx,msg1]=mkdir(fullfile(Path_ima,subdir_civ1_new)); 2507 2527 2508 2528 if ~strcmp(msg1,'') … … 2518 2538 end 2519 2539 end 2520 cd(currentdir);2540 % cd(currentdir); 2521 2541 end 2522 2542 if strcmp(compare,'stereo PIV')&&(strcmp(mode,'pair j1-j2')||strcmp(mode,'series(Dj)')||strcmp(mode,'series(Di)'))%check second nc series … … 2544 2564 end 2545 2565 %create the new subdir_civ1 2546 if exist(fullfile(Path_ima,subdir_civ1_new),'dir')2547 cd(Path_ima);2548 [xx,msg1]=mkdir( subdir_civ1_new);2549 cd(currentdir);2566 if ~exist(fullfile(Path_ima,subdir_civ1_new),'dir') 2567 % cd(Path_ima); 2568 [xx,msg1]=mkdir(fullfile(Path_ima,subdir_civ1_new)); 2569 % cd(currentdir); 2550 2570 if ~strcmp(msg1,'') 2551 2571 msgbox_uvmat('ERROR',['cannot create ' subdir_civ1_new ': ' msg1]) 2552 cd(currentdir)2572 % cd(currentdir) 2553 2573 filecell={}; 2554 2574 return … … 2557 2577 if ~strcmp(msg2,'') 2558 2578 msgbox_uvmat('ERROR',['pb of permission for ' subdir_civ1_new ': ' msg2])%error message for directory creation 2559 cd(currentdir)2579 % cd(currentdir) 2560 2580 filecell={}; 2561 2581 return … … 4463 4483 %------------------------------------------------------------------------ 4464 4484 test=get(handles.compare,'Value'); 4465 if test==2 || test==3 4485 if test==2 || test==3 % case 'dispalcemen' or 'stereo PIV' 4466 4486 filebase=get(handles.RootName,'String'); 4467 4487 browse=get(handles.browse_root,'Userdata'); … … 4475 4495 if test==2 4476 4496 set(handles.mode,'Visible','off') 4497 set(handles.CivMode,'Value',1) % mode 'civX' selected by default 4477 4498 else 4478 4499 set(handles.mode,'Visible','on') 4500 set(handles.CivMode,'Value',3) % mode 'Matlab' selected for stereo 4479 4501 end 4480 4502 … … 4496 4518 sizf=size(fileinput); 4497 4519 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end %stop if fileinput not a character string 4498 [path,name,ext]=fileparts(fileinput) ;4520 [path,name,ext]=fileparts(fileinput) 4499 4521 [path1]=fileparts(filebase); 4500 % if isunix 4501 % ['readlink ' path] 4502 % [status,path]=system(['readlink ' path]) 4503 % [status,path1]=system(['readlink ' path1])% look for the true path in case of symbolic paths 4504 % end 4522 if isunix 4523 [status,path]=system(['readlink ' path]) 4524 [status,path1]=system(['readlink ' path1])% look for the true path in case of symbolic paths 4525 end 4505 4526 if ~strcmp(path1,path) 4506 msgbox_uvmat('ERROR','The two input image series must be in the same directory')4527 msgbox_uvmat('ERROR','The second image series must be in the same directory as the first one') 4507 4528 return 4508 end4509 set(handles.RootName_1,'String',name);4529 end 4530 % set(handles.RootName_1,'String',name); 4510 4531 [RootPath,RootFile,field_count,str2,str_a,str_b,xx,nom_type,subdir]=name2display(name); 4532 set(handles.RootName_1,'String',RootFile); 4511 4533 browse=get(handles.browse_root,'UserData'); 4512 4534 browse.nom_type_ima_1=nom_type; … … 4515 4537 %check image extension 4516 4538 if ~strcmp(ext,get(handles.ImaExt,'String')) 4517 msgbox_uvmat('ERROR','The two input image series must have the same extension name')4539 msgbox_uvmat('ERROR','The second image series must have the same extension name as the first one') 4518 4540 return 4519 4541 end 4520 4542 4521 4543 %% check coincidence of image sizes 4522 ref_i=get(handles.ref_i,'string');4523 ref_j=get(handles.ref_j,'string');4524 [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc]=set_civ_filenames(handles,ref_i,ref_j,[1 0 0 0 0 0]);4525 A=imread(filecell.ima1.civ1{1});4526 A_1=imread(fileinput);4527 npxy=size(A);4528 npxy_1=size(A_1);4529 if ~isequal(size(A),size(A_1))4530 msgbox_uvmat('ERROR','The two input image series do not have the same size')4531 return4532 end4544 % ref_i=get(handles.ref_i,'string'); 4545 % ref_j=get(handles.ref_j,'string'); 4546 % [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc]=set_civ_filenames(handles,ref_i,ref_j,[1 0 0 0 0 0]); 4547 % A=imread(filecell.ima1.civ1{1}); 4548 % A_1=imread(fileinput); 4549 % npxy=size(A); 4550 % npxy_1=size(A_1); 4551 % if ~isequal(size(A),size(A_1)) 4552 % msgbox_uvmat('ERROR','The two input image series do not have the same size') 4553 % return 4554 % end 4533 4555 else 4534 4556 set(handles.mode,'Visible','on') … … 4541 4563 set(handles.test_stereo1,'Value',0) 4542 4564 set(handles.test_stereo2,'Value',0) 4565 set(handles.CivMode,'Value',1) % mode 'civX' selected by default 4543 4566 end 4544 4567 if test==3 && get(handles.PATCH1,'Value') 4545 set(handles. stereo1,'Visible','on')4546 else 4547 set(handles. stereo1,'Visible','off')4568 set(handles.test_stereo1,'Visible','on') 4569 else 4570 set(handles.test_stereo1,'Visible','off') 4548 4571 end 4549 4572 if test==3 && get(handles.PATCH2,'Value') 4550 set(handles. stereo2,'Visible','on')4551 else 4552 set(handles. stereo2,'Visible','off')4573 set(handles.test_stereo2,'Visible','on') 4574 else 4575 set(handles.test_stereo2,'Visible','off') 4553 4576 end 4554 4577 mode_Callback(hObject, eventdata, handles)
Note: See TracChangeset
for help on using the changeset viewer.