- Timestamp:
- Jan 12, 2012, 3:55:07 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r367 r368 308 308 NomType=get(handles.NomType,'String'); 309 309 ImaExt=get(handles.ImaExt,'String'); 310 fileinput=fullfile_uvmat(RootPath,'',RootFile,ImaExt,NomType,ref_i,[],ref_j) 310 fileinput=fullfile_uvmat(RootPath,'',RootFile,ImaExt,NomType,ref_i,[],ref_j); 311 311 errormsg=display_file_name(handles,fileinput); 312 312 if ~isempty(errormsg) … … 604 604 end 605 605 606 %% update the subdirectorydisplay606 %% scan files to update the subdirectory list display 607 607 listot=dir(RootPath);%directory of RootPath 608 608 idir=0; … … 618 618 end 619 619 end 620 Value=find(strcmp(SubDir,listdir));%search the index of subdir in the cell listdir 621 if isempty(Value)% if the input subdir is not found 622 ValueCiv1=get(handles.ListSubdirCiv1,'Value');%read the currrently selected dir name 623 if ValueCiv1>numel(listdir) 624 ValueCiv1=1; 625 end 626 set(handles.SubdirCiv1,'String',listdir{ValueCiv1}) 627 ValueCiv2=get(handles.ListSubdirCiv2,'Value'); 628 if ValueCiv2>numel(listdir) 629 ValueCiv2=1; 630 end 631 set(handles.SubdirCiv2,'String',listdir{ValueCiv2}) 632 else 633 ValueCiv1=Value; 634 ValueCiv2=Value; 635 set(handles.SubdirCiv1,'String',listdir{Value}) 636 set(handles.SubdirCiv2,'String',listdir{Value}) 637 end 620 621 %% update the selection for civ1 and civ2 622 if ~isempty(SubDir)% subdir for civ1 and civ2 initiated by the input 623 SubdirCiv1=SubDir; 624 SubdirCiv2=SubDir; 625 set(SubdirCiv1,'String',SubDir) 626 set(SubdirCiv2,'String',SubDir) 627 else% currently selected subdir preserved 628 SubDirCiv1=get(handles.SubdirCiv1,'String'); 629 SubDirCiv2=get(handles.SubdirCiv2,'String'); 630 if isempty(SubDirCiv1)% default subdir name='CIV' 631 set(handles.SubdirCiv1,'String','CIV'); 632 SubDirCiv1='CIV'; 633 end 634 if isempty(SubDirCiv2)% default subdir name='CIV' 635 set(handles.SubdirCiv2,'String','CIV'); 636 SubDirCiv2='CIV'; 637 end 638 end 639 640 %% update the subdirectory menus 641 ValueCiv1=find(strcmp(SubDirCiv1,listdir));%search the index of subdir in the cell listdir 642 if isempty(ValueCiv1)% if the input subdir is not found 643 ValueCiv1=numel(listdir)+1;%new subdirectory requested for civ1 644 end 645 ValueCiv2=find(strcmp(SubDirCiv2,listdir));%search the index of subdir in the cell listdir 646 if isempty(ValueCiv2)% if the input subdir is not found 647 ValueCiv2=numel(listdir)+1;%new subdirectory requested for civ2 648 end 649 set(handles.ListSubdirCiv1,'String',[listdir;'new...']) 650 set(handles.ListSubdirCiv2,'String',[listdir;'new...']) 638 651 set(handles.ListSubdirCiv1,'Value',ValueCiv1) 639 652 set(handles.ListSubdirCiv2,'Value',ValueCiv2) 640 set(handles.ListSubdirCiv1,'String',[listdir;'new...'])641 set(handles.ListSubdirCiv2,'String',[listdir;'new...'])642 653 if isempty(listdir) 643 654 set(handles.SubdirCiv1,'String','CIV') … … 1497 1508 if ~strcmp(compare,'stereo PIV') 1498 1509 filename_xml=[OutputFile '.civ.xml']; 1499 t=struct2xml(Param); 1510 t=struct2xml(Param); 1500 1511 save(t,filename_xml) 1501 1512 if batch -
trunk/src/civ_matlab.m
r366 r368 490 490 corrmax=0; 491 491 sum_square=1;% default 492 mesh=1;% default 493 CheckDecimal=isfield(par_civ,'CheckDecimal')&& par_civ.CheckDecimal==1; 494 if CheckDecimal 495 mesh=0.2;%mesh in pixels for subpixel image interpolation 496 end 492 497 % vector=[0 0];%default 493 498 for ivec=1:nbvec … … 515 520 image1_crop=image1_crop-image1_mean;%substract the mean 516 521 image2_crop=image2_crop-image2_mean; 522 if isfield(par_civ,'CheckDecimal')&& par_civ.CheckDecimal==1 523 xi=(1:mesh:size(image1_crop,2)); 524 yi=(1:mesh:size(image1_crop,1))'; 525 image1_crop=interp2(image1_crop,xi,yi); 526 image2_crop=interp2(image2_crop,xi,yi); 527 end 517 528 sum_square=sum(sum(image1_crop.*image1_crop)); 518 529 %reference: Oliver Pust, PIV: Direct Cross-Correlation … … 529 540 [vector,F(ivec)] = SUBPIX2DGAUSS (result_conv,x,y); 530 541 end 531 utable(ivec)=vector(1) +shiftx(ivec);532 vtable(ivec)=vector(2) +shifty(ivec);542 utable(ivec)=vector(1)*mesh+shiftx(ivec); 543 vtable(ivec)=vector(2)*mesh+shifty(ivec); 533 544 xtable(ivec)=iref+utable(ivec)/2;% convec flow (velocity taken at the point middle from imgae1 and 2) 534 545 ytable(ivec)=jref+vtable(ivec)/2; -
trunk/src/fill_GUI.m
r363 r368 3 3 function errormsg=fill_GUI(Param,handles) 4 4 %------------------------------------------------------------------------ 5 5 6 errormsg=''; 6 7 fields=fieldnames(Param); … … 29 30 if ~isempty(hh) 30 31 set(hh,'Visible','on') 31 get(hh,'style') 32 input_data 32 % input_data 33 33 switch get(hh,'style') 34 34 case {'checkbox','radiobutton','togglebutton'} -
trunk/src/uvmat.m
r360 r368 1652 1652 return 1653 1653 end 1654 i1=UvData.i1_series{1}(ref_i+1,ref_j+1,1); 1654 if get(handles.scan_i,'Value')==1% case of scanning along index i 1655 i1_subseries=UvData.i1_series{1}(ref_i+1,:,:); 1656 else 1657 i1_subseries=UvData.i1_series{1}(:,ref_j+1,:); 1658 end 1659 i1_subseries=i1_subseries(i1_subseries>0); 1660 if isempty(i1_subseries) 1661 errormsg='no next file'; 1662 return 1663 end 1664 i1=i1_subseries(end); 1655 1665 if ~isempty(UvData.i2_series{1}) 1656 i2=UvData.i2_series{1}(ref_i+1,ref_j+1,1); 1666 if get(handles.scan_i,'Value')==1% case of scanning along index i 1667 i2_subseries=UvData.i2_series{1}(ref_i+1,:,:); 1668 else 1669 i2_subseries=UvData.i2_series{1}(:,ref_j+1,:); 1670 end 1671 i2_subseries=i2_subseries(i2_subseries>0); 1672 i2=i2_subseries(end); 1657 1673 end 1658 1674 if ~isempty(UvData.j1_series{1}) 1659 j1=UvData.j1_series{1}(ref_i+1,ref_j+1,1); 1675 if get(handles.scan_i,'Value')==1% case of scanning along index i 1676 j1_subseries=UvData.j1_series{1}(ref_i+1,:,:) 1677 else 1678 j1_subseries=UvData.j1_series{1}(:,ref_j+1,:) 1679 end 1680 j1_subseries=j1_subseries(j1_subseries>0); 1681 j1=j1_subseries(end); 1660 1682 end 1661 1683 if ~isempty(UvData.j2_series{1}) 1662 j2=UvData.j2_series{1}(ref_i+1,ref_j+1,1); 1663 end 1684 if get(handles.scan_i,'Value')==1% case of scanning along index i 1685 j2_subseries=UvData.j2_series{1}(ref_i+1,:,:) 1686 else 1687 j2_subseries=UvData.j2_series{1}(:,ref_j+1,:) 1688 end 1689 j2_subseries=j2_subseries(j2_subseries>0); 1690 j2=j2_subseries(end); 1691 end 1692 1664 1693 end 1665 1694 filename=fullfile_uvmat(InputFile.RootPath,InputFile.SubDir,InputFile.RootFile,FileExt,NomType,i1,i2,j1,j2); -
trunk/src/xml2struct.m
r356 r368 24 24 end 25 25 case 'char' 26 if isempty(regexp(s,' \<\d+\>'))26 if isempty(regexp(s,'^\d+$')) 27 27 out=s; 28 28 else
Note: See TracChangeset
for help on using the changeset viewer.