Changeset 692 for trunk/src/series


Ignore:
Timestamp:
Oct 28, 2013, 2:29:07 PM (10 years ago)
Author:
sommeria
Message:

test civ repaired

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ_input.m

    r668 r692  
    17341734    [Path,ref.subdir,File,ref.num1,ref.num2,ref.num_a,ref.num_b,ref.ext,ref.nom_type]=fileparts_uvmat(fileinput);
    17351735    ref.filebase=fullfile(Path,File);
    1736 %     ref.num_a=stra2num(str_a);
    1737 %     ref.num_b=stra2num(str_b);
    1738 %     ref.num1=str2num(field_count);
    1739 %     ref.num2=str2num(str2);
     1736    %     ref.num_a=stra2num(str_a);
     1737    %     ref.num_b=stra2num(str_b);
     1738    %     ref.num1=str2num(field_count);
     1739    %     ref.num2=str2num(str2);
    17401740    browse=[];%initialisation
    17411741    if ~isequal(ref.ext,'.nc')
     
    18311831        ref_j=1;%default j index
    18321832    end
    1833    % [filecell,i1,i2]=set_civ_filenames(handles,ref_i,ref_j,[1 0 0 0 0 0]);% get the corresponding file name and indices
     1833    % [filecell,i1,i2]=set_civ_filenames(handles,ref_i,ref_j,[1 0 0 0 0 0]);% get the corresponding file name and indices
    18341834    Data.ListVarName={'ny','nx','A'};
    18351835    Data.VarDimName= {'ny','nx',{'ny','nx'}};
     
    18411841        ind_A=2;
    18421842    end
    1843     [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=...
    1844             find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j);
    1845  
     1843    list_pair=get(handles.ListPairCiv1,'String');%get the menu of image pairs
     1844    PairString=list_pair{get(handles.ListPairCiv1,'Value')};
     1845    %    [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=...
     1846    %       find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j);
     1847    [ind1,ind2,mode]=find_pair_indices(PairString,ref_i,ref_j)%,MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j)
     1848    switch mode
     1849        case 'Di'
     1850            i1=ref_i+ind1;
     1851            i2=ref_i+ind2;
     1852                        j1=ref_j;
     1853            j2=ref_j;
     1854        case 'Dj'
     1855                           i1=ref_i;
     1856            i2=ref_i;
     1857                        j1=ref_j+ind1;
     1858            j2=ref_j+ind2;
     1859        case 'burst'
     1860
     1861                           i1=ref_i;
     1862            i2=ref_i;
     1863                        j1=ind1;
     1864            j2=ind2;
     1865    end
    18461866    ImageName_A=fullfile_uvmat(InputTable{ind_A,1},InputTable{ind_A,2},InputTable{ind_A,3},InputTable{ind_A,5},InputTable{ind_A,4},...
    1847         ref_i,[],ref_j);
    1848     Data.A=imread(filecell.ima1.civ1{1}); % read the first image
     1867        i1,[],j1);
     1868        ImageName_B=fullfile_uvmat(InputTable{ind_A,1},InputTable{ind_A,2},InputTable{ind_A,3},InputTable{ind_A,5},InputTable{ind_A,4},...
     1869        i2,[],j2);
     1870    Data.A=imread(ImageName_A); % read the first image
    18491871    if ndims(Data.A)==3 %case of color image
    18501872        Data.VarDimName= {'ny','nx',{'ny','nx','rgb'}};
     
    18521874    Data.ny=[size(Data.A,1) 1];
    18531875    Data.nx=[1 size(Data.A,2)];
    1854     Data.CoordUnit='pixel';% used to set equal scaling for x and y in image dispaly
     1876    Data.CoordUnit='pixel';% used to set equal scaling for x and y in image dispa=ly
    18551877    par_civ1=read_GUI(handles.Civ1);
    1856     par_civ1.FileTypeA=get_file_type(filecell.ima1.civ1{1});
     1878    par_civ1.FileTypeA=get_file_type(ImageName_A);
    18571879    par_civ1.ImageWidth=size(Data.A,2);
    18581880    par_civ1.ImageHeight=size(Data.A,1);
     
    18611883    par_civ1.FrameIndexB=num2str(i2);
    18621884    Param.Civ1=par_civ1;
    1863     Grid=civ_matlab(Param);% get the grid of x, y positions set for PIV 
     1885    Grid=civ_matlab(Param);% get the grid of x, y positions set for PIV
    18641886    hview_field=view_field(Data); %view the image in the GUI view_field
    18651887    set(0,'CurrentFigure',hview_field)
     
    18681890    ViewData=get(hview_field,'UserData');
    18691891    ViewData.CivHandle=handles.civ_input;% indicate the handle of the civ GUI in view_field
    1870     ViewData.PlotAxes.B=imread(filecell.ima2.civ1{1});%store the second image in the UserData of the GUI view_field
     1892    ViewData.PlotAxes.B=imread(ImageName_B);%store the second image in the UserData of the GUI view_field
    18711893    ViewData.PlotAxes.X=Grid.Civ1_X; %keep the set of points in memeory
    18721894    ViewData.PlotAxes.Y=Grid.Civ1_Y;
     
    18781900        set(corrfig,'name','image correlation')
    18791901        set(corrfig,'DeleteFcn',{@closeview_field})%
    1880     end
    1881     set(handles.TestCiv1,'BackgroundColor',[1 0 0])
    1882 else
    1883     set(handles.TestCiv1,'BackgroundColor',[1 0 0])% paint button to red
    1884     corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display
    1885     if ~isempty(corrfig)
    1886         delete(corrfig)
    1887     end
    1888     hview_field=findobj(allchild(0),'tag','view_field');% look for view_field   
    1889     if ~isempty(hview_field)
    1890         delete(hview_field)
     1902        % end
     1903        set(handles.TestCiv1,'BackgroundColor',[1 0 0])
     1904    else
     1905        set(handles.TestCiv1,'BackgroundColor',[1 0 0])% paint button to red
     1906        corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display
     1907        if ~isempty(corrfig)
     1908            delete(corrfig)
     1909        end
     1910        hview_field=findobj(allchild(0),'tag','view_field');% look for view_field
     1911        if ~isempty(hview_field)
     1912            delete(hview_field)
     1913        end
    18911914    end
    18921915end
     
    20282051%------------------------------------------------------------------------
    20292052% --- determine the list of index pairs of processing file
    2030 function [ind1,ind2]=...
     2053function [ind1,ind2,mode]=...
    20312054    find_pair_indices(str_civ,i_series,j_series,MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j)
    20322055%------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.