Changeset 368


Ignore:
Timestamp:
Jan 12, 2012, 3:55:07 PM (12 years ago)
Author:
sommeria
Message:

various bugs fixed

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r367 r368  
    308308NomType=get(handles.NomType,'String');
    309309ImaExt=get(handles.ImaExt,'String');
    310 fileinput=fullfile_uvmat(RootPath,'',RootFile,ImaExt,NomType,ref_i,[],ref_j)
     310fileinput=fullfile_uvmat(RootPath,'',RootFile,ImaExt,NomType,ref_i,[],ref_j);
    311311errormsg=display_file_name(handles,fileinput);
    312312if ~isempty(errormsg)
     
    604604end
    605605
    606 %% update the subdirectory display
     606%% scan files to update the subdirectory list display
    607607listot=dir(RootPath);%directory of RootPath
    608608idir=0;
     
    618618    end
    619619end
    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
     622if ~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)
     627else% 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
     638end
     639
     640%% update the subdirectory menus
     641ValueCiv1=find(strcmp(SubDirCiv1,listdir));%search the index of subdir in the cell listdir
     642if isempty(ValueCiv1)% if the input subdir is not found
     643    ValueCiv1=numel(listdir)+1;%new subdirectory requested for civ1
     644end
     645ValueCiv2=find(strcmp(SubDirCiv2,listdir));%search the index of subdir in the cell listdir
     646if isempty(ValueCiv2)% if the input subdir is not found
     647    ValueCiv2=numel(listdir)+1;%new subdirectory requested for civ2
     648end
     649set(handles.ListSubdirCiv1,'String',[listdir;'new...'])
     650set(handles.ListSubdirCiv2,'String',[listdir;'new...'])
    638651set(handles.ListSubdirCiv1,'Value',ValueCiv1)
    639652set(handles.ListSubdirCiv2,'Value',ValueCiv2)
    640 set(handles.ListSubdirCiv1,'String',[listdir;'new...'])
    641 set(handles.ListSubdirCiv2,'String',[listdir;'new...'])
    642653if isempty(listdir)
    643654    set(handles.SubdirCiv1,'String','CIV')
     
    14971508                if ~strcmp(compare,'stereo PIV')
    14981509                    filename_xml=[OutputFile '.civ.xml'];
    1499                     t=struct2xml(Param);
     1510                    t=struct2xml(Param);           
    15001511                    save(t,filename_xml)
    15011512                    if batch   
  • trunk/src/civ_matlab.m

    r366 r368  
    490490corrmax=0;
    491491sum_square=1;% default
     492mesh=1;% default
     493CheckDecimal=isfield(par_civ,'CheckDecimal')&& par_civ.CheckDecimal==1;
     494if CheckDecimal
     495    mesh=0.2;%mesh in pixels for subpixel image interpolation
     496end
    492497% vector=[0 0];%default
    493498for ivec=1:nbvec
     
    515520            image1_crop=image1_crop-image1_mean;%substract the mean
    516521            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
    517528            sum_square=sum(sum(image1_crop.*image1_crop));
    518529            %reference: Oliver Pust, PIV: Direct Cross-Correlation
     
    529540                        [vector,F(ivec)] = SUBPIX2DGAUSS (result_conv,x,y);
    530541                    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);                 
    533544                    xtable(ivec)=iref+utable(ivec)/2;% convec flow (velocity taken at the point middle from imgae1 and 2)
    534545                    ytable(ivec)=jref+vtable(ivec)/2;
  • trunk/src/fill_GUI.m

    r363 r368  
    33function errormsg=fill_GUI(Param,handles)
    44%------------------------------------------------------------------------
     5
    56errormsg='';
    67fields=fieldnames(Param);
     
    2930        if ~isempty(hh)
    3031            set(hh,'Visible','on')
    31             get(hh,'style')
    32             input_data
     32%             input_data
    3333            switch get(hh,'style')
    3434                case {'checkbox','radiobutton','togglebutton'}
  • trunk/src/uvmat.m

    r360 r368  
    16521652        return
    16531653    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);
    16551665    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);
    16571673    end
    16581674    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);
    16601682    end
    16611683    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   
    16641693end
    16651694filename=fullfile_uvmat(InputFile.RootPath,InputFile.SubDir,InputFile.RootFile,FileExt,NomType,i1,i2,j1,j2);
  • trunk/src/xml2struct.m

    r356 r368  
    2424        end
    2525    case 'char'
    26         if isempty(regexp(s,'\<\d+\>'))
     26        if isempty(regexp(s,'^\d+$'))
    2727            out=s;
    2828        else
Note: See TracChangeset for help on using the changeset viewer.