Changeset 413 for trunk/src/civ.m


Ignore:
Timestamp:
May 8, 2012, 2:27:50 PM (12 years ago)
Author:
sommeria
Message:

various bugs corrected and improvement in civ1_TEST

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r412 r413  
    39373937
    39383938%------------------------------------------------------------------------
    3939 % --- Executes on button press in TestCiv1: display image correlation function
     3939% --- Executes on button press in TestCiv1: prepare the image correlation function
     3940% activated by mouse motion
    39403941function TestCiv1_Callback(hObject, eventdata, handles)
    39413942%------------------------------------------------------------------------
    3942 set(handles.TestCiv1,'BackgroundColor',[1 1 0])
    39433943drawnow
    39443944if get(handles.TestCiv1,'Value')
    3945     ref_i=str2double(get(handles.ref_i,'String'));
     3945    set(handles.TestCiv1,'BackgroundColor',[0.7 0.7 0.7])% paint TestCiv1 button to grey to confirm civ launch
     3946    ref_i=str2double(get(handles.ref_i,'String'));% read reference i index
    39463947    if strcmp(get(handles.ref_j,'Visible'),'on')
    3947         ref_j=str2double(get(handles.ref_j,'String'));
     3948        ref_j=str2double(get(handles.ref_j,'String'));% read reference j index if relevant
    39483949    else
    3949         ref_j=1;%default
    3950     end
    3951     [filecell,i1,i21,j1,j2,i1_civ2,i2_civ2,j1_civ2,j2_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=...
    3952         set_civ_filenames(handles,ref_i,ref_j,[1 0 0 0 0 0]);
     3950        ref_j=1;%default j index
     3951    end
     3952    [filecell,i1,i2,j1,j2,i1_civ2,i2_civ2,j1_civ2,j2_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=...
     3953        set_civ_filenames(handles,ref_i,ref_j,[1 0 0 0 0 0]);% get the corresponding file name and indices
    39533954    Data.ListVarName={'ny','nx','A'};
    39543955    Data.VarDimName= {'ny','nx',{'ny','nx'}};
    3955     Data.A=imread(filecell.ima1.civ1{1});
     3956    Data.A=imread(filecell.ima1.civ1{1}); % read the first image
    39563957    if ndims(Data.A)==3 %case of color image
    39573958        Data.VarDimName= {'ny','nx',{'ny','nx','rgb'}};
     
    39593960    Data.ny=[size(Data.A,1) 1];
    39603961    Data.nx=[1 size(Data.A,2)];
     3962    Data.CoordUnit='pixel';% used to set equal scaling for x and y in image dispaly
    39613963    par_civ1=read_GUI(handles.Civ1);
    39623964    par_civ1.ImageWidth=size(Data.A,2);
    39633965    par_civ1.ImageHeight=size(Data.A,1);
    39643966    par_civ1.Mask='all';% will provide only the grid set for PIV, no image correlation
    3965     par_civ1.i1=1;%i1_civ1;
    3966     par_civ1.i2=2;%i2_civ1;
     3967    par_civ1.i1=i1;
     3968    par_civ1.i2=i2;
    39673969    Param.Civ1=par_civ1;
    39683970    Grid=civ_matlab(Param);% get the grid of x, y positions set for PIV
     
    39863988    set(handles.TestCiv1,'BackgroundColor',[1 0 0])
    39873989else
     3990    set(handles.TestCiv1,'BackgroundColor',[1 0 0])% paint button to red
    39883991    corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display
    39893992    if ~isempty(corrfig)
Note: See TracChangeset for help on using the changeset viewer.