Changeset 413


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

various bugs corrected and improvement in civ1_TEST

Location:
trunk/src
Files:
8 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)
  • trunk/src/mouse_down.m

    r410 r413  
    4040    test_zoom=0;
    4141end
     42test_piv=isfield(FigData,'CivHandle');
    4243
    4344%% look for parameters set by the GUI uvmat
     
    5253    test_edit=get(hhuvmat.edit_object,'Value');%test for object editing, third priority
    5354    test_edit_vect=get(hhuvmat.edit_vect,'Value');%test for vector editing,  priority 4
    54     test_create=isequal(get(hhuvmat.MenuObject,'checked'),'on');% test for object creation,  priority 5
    55     if test_create
    56         hset_object=findobj(allchild(0),'tag','set_object');
    57         test_create=~isempty(hset_object)&&~test_edit;
    58     end
     55    %     test_create=isequal(get(hhuvmat.MenuObject,'checked'),'on');% test for object creation,  priority 5
     56    %     if test_create
     57    test_create=0;
     58    hset_object=findobj(allchild(0),'tag','set_object');
     59    if ~isempty(hset_object)
     60        hPLOT=findobj(hset_object,'tag','PLOT');
     61        test_create=strcmp(get(hPLOT,'enable'),'on') &&~test_edit;
     62    end
     63    %         test_create=~isempty(hset_object)&&~test_edit;
     64   
    5965    test_cal=isequal(get(hhuvmat.MenuCalib,'checked'),'on');% test for calibration
    6066    if test_cal% test for calibration popints,  priority 6
     
    194200end
    195201
     202%% PIV test
     203if test_piv
     204    figure
     205    newaxes=axes;
     206    copyobj(AxeData.CurrentCorrImage,newaxes);
     207    set(newaxes,'CLim',[0 1])
     208    copyobj(AxeData.CurrentVector,newaxes)
     209    copyobj(AxeData.TitleHandle,newaxes)
     210    colorbar
     211end
     212
    196213%% selection of an existing projection object (third priority)
    197214if  test_edit && (isequal(tag_obj,'proj_object')||isequal(tag_obj,'DeformPoint'))
  • trunk/src/mouse_motion.m

    r399 r413  
    212212                        xround=Field.X(ind_pt);
    213213                        yround=Field.Y(ind_pt);
    214                         par.Grid=[xround size(Field.A,1)-yround+1];
     214%                         par.Grid=[xround size(Field.A,1)-yround+1];
     215                        par.Grid=[xround yround];
    215216                        % mark the correlation box with a rectangle
    216217                        par.ImageA=Field.A;
     
    258259                                corrfig=findobj(allchild(0),'tag','corrfig');
    259260                                if ~isempty(corrfig)
    260                                     set(0,'CurrentFigure',corrfig(1))
     261                                    set(0,'CurrentFigure',corrfig(1))         
    261262                                    AxeData.CurrentCorrImage=imagesc(rangx,-rangy,result_conv,[0 1]);
    262263                                    AxeData.CurrentVector=line([0 Data.Civ1_U],[0 Data.Civ1_V],'Tag','vector');
     264                                   AxeData.TitleHandle=title(num2str(par.Grid));
    263265                                    colorbar
    264266                                    set(haxes,'UserData',AxeData)
     
    270272                                set(AxeData.CurrentCorrImage,'YData',-rangy)
    271273                                set(AxeData.CurrentVector,'XData',[0 Data.Civ1_U],'YData',[0 Data.Civ1_V])
     274                                set(AxeData.TitleHandle,'String',num2str(par.Grid))
    272275                            end
    273276                        end
  • trunk/src/mouse_up.m

    r410 r413  
    152152            ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData
    153153            if ~isempty(ProjData)
    154                 if strcmp(tagfig,'uvmat')% uvmat plot selected, projection plot seen on view_field
     154                if strcmp(tagfig,'uvmat')% uvmat plot selected, projection plot seen in view_field
    155155                    hview_field=findobj(allchild(0),'tag','view_field');
    156156                    if isempty(hview_field)
    157                         hview_field=view_field;
     157                        hview_field=view_field(ProjData);
     158                    else
     159                       hhview_field=guidata(hview_field);
     160                       [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing field plot
     161                        write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
    158162                    end
    159163                    ViewFieldData=get(hview_field,'UserData');
    160164                    ViewFieldData.axes3=ProjData;
    161165                    set(hview_field,'UserData',ViewFieldData)
    162                     hh_plotfield=guidata(hview_field);
     166 
    163167                else
    164168                    UvData.axes3=ProjData;
    165                     hh_plotfield=hhuvmat;
     169                    [PlotType,PlotParam]=plot_field(ProjData,hhuvmat.axes3,read_GUI(hhuvmat));%update an existing field plot
     170                    write_plot_param(hhuvmat,PlotParam); %update the display of plotting parameters for the current object
    166171                end
    167172                %[PlotType,PlotParam]=plot_field(ProjData,hh_plotfield.axes3,read_plot_param(hh_plotfield));%update an existing field plot
    168                 [PlotType,PlotParam]=plot_field(ProjData,hh_plotfield.axes3,read_GUI(hview_field));%update an existing field plot
    169                 write_plot_param(hh_plotfield,PlotParam); %update the display of plotting parameters for the current object
     173
    170174            end
    171175            set(hhuvmat.edit_object,'BackgroundColor',[1 1 0]);% paint the edit text in yellow
  • trunk/src/set_object.m

    r410 r413  
    415415function PLOT_Callback(hObject, eventdata, handles)
    416416
    417 %% reading the object selection in the GUI uvmat
    418 huvmat=findobj('tag','uvmat');%find the current uvmat GUI handle
    419 UvData=get(huvmat,'UserData');%Data associated to the GUI uvmat
    420 hhuvmat=guidata(huvmat);%handles of the objects children of the  GUI uvmat
    421 ListObject=get(hhuvmat.ListObject,'String');% list of objects displyed in uvmat
    422 IndexObj(1)=get(hhuvmat.ListObject_1,'Value');% index of the selected object for display in uvmat
    423 if get(hhuvmat.ViewObject,'Value')
    424     IndexObj(2)=get(hhuvmat.ListObject,'Value');% index of the object, possibly selected for display in view_field
    425 end
    426 
    427417%% read the object parameters in the GUI set_object
    428418ObjectData=read_GUI(handles.set_object);%read the parameters defining the object in the GUI set_object
     
    438428ObjectName=ObjectData.Name;%name of the current object defined in set_object
    439429if isempty(ObjectName)
    440 %     if get(hhuvmat.edit_object,'Value')% edit mode
    441 %         if isempty(ListObject)
    442 %             ObjectName='Plane';
    443 %         else
    444 %             ObjectName=ListObject{IndexObj(end)};%take the name of the last (second) selected item
    445 %         end
    446 %     else %new object
    447         ObjectName=ObjectData.Type;
    448 %     end
     430     ObjectName=ObjectData.Type;
     431end
     432
     433%% read the object selection in the GUI uvmat
     434huvmat=findobj('tag','uvmat');%find the current uvmat GUI handle
     435UvData=get(huvmat,'UserData');%Data associated to the GUI uvmat
     436hhuvmat=guidata(huvmat);%handles of the objects children of the  GUI uvmat
     437ListObject=get(hhuvmat.ListObject_1,'String');% list of objects displayed in uvmat
     438IndexObj(1)=get(hhuvmat.ListObject_1,'Value');% index of the selected object for display in uvmat
     439if get(hhuvmat.ViewObject,'Value') && get(hhuvmat.edit_object,'Value')
     440    IndexObj(2)=get(hhuvmat.ListObject,'Value');% index of the object, possibly selected for display in view_field
    449441end
    450442if ~get(hhuvmat.edit_object,'Value') %new object is being created
     
    473465    UvData.Object{IndexObj(2)}=[];%initiate a new object (empty yet)
    474466end
    475 testnew=0;
    476 if numel(IndexObj)==1   % if only one object is selected, the projection is in uvmat
    477     plotaxes=hhuvmat.axes3;%handle of axes3 in view_field
    478 else  % if a second object is selected, the projection is in view_field, and this second object is selected
    479     hview_field=findobj(allchild(0),'tag','view_field');
    480     if isempty(hview_field)
    481         hview_field=view_field;%open the GUI view_field if it is not found
    482     end
    483     PlotHandles=guidata(hview_field);
    484     plotaxes=PlotHandles.axes3;%handle of axes3 in view_field
    485 end
    486467
    487468%% naming the object
    488 ListObject{IndexObj(end),1}=ObjectName;
    489 set(hhuvmat.ListObject,'String',ListObject)
    490 set(hhuvmat.ListObject_1,'String',ListObject)
     469% ListObject{IndexObj(end),1}=ObjectName;
     470% set(hhuvmat.ListObject,'String',ListObject)
     471% set(hhuvmat.ListObject_1,'String',ListObject)
    491472
    492473%% update the object plot
    493 % if testnew
    494 %     set(hhuvmat.ListObject,'Value',IndexObj)
    495 %     ObjectData.DisplayHandle_uvmat=hhuvmat.axes3;
    496 %     ObjectData.DisplayHandle_view_field=[];
    497 % else
    498     if IndexObj(end)<=length(UvData.Object) && isfield(UvData.Object{IndexObj(end)},'DisplayHandle_uvmat')% save the previous object graph handles
    499         ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj(end)}.DisplayHandle_uvmat;
    500     else
    501         ObjectData.DisplayHandle_uvmat=hhuvmat.axes3;%there is no object handle, than the axes handles is used as input
    502     end
    503     if isfield(UvData.Object{IndexObj(end)},'DisplayHandle_view_field')% save the previous object graph handles
    504         ObjectData.DisplayHandle_view_field=UvData.Object{IndexObj(end)}.DisplayHandle_view_field;
    505     else
    506         ObjectData.DisplayHandle_view_field=[];
    507     end
    508 % end
     474if IndexObj(end)<=length(UvData.Object) && isfield(UvData.Object{IndexObj(end)},'DisplayHandle_uvmat')% save the previous object graph handles
     475    ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj(end)}.DisplayHandle_uvmat;
     476else
     477    ObjectData.DisplayHandle_uvmat=hhuvmat.axes3;%there is no object handle, than the axes handles is used as input
     478end
     479if isfield(UvData.Object{IndexObj(end)},'DisplayHandle_view_field')% save the previous object graph handles
     480    ObjectData.DisplayHandle_view_field=UvData.Object{IndexObj(end)}.DisplayHandle_view_field;
     481else
     482    ObjectData.DisplayHandle_view_field=[];
     483end
    509484UvData.Object{IndexObj(end)}=ObjectData;%update the current object properties
    510  if numel(IndexObj)==2
     485if numel(IndexObj)==2
    511486    UvData.Object=update_obj(UvData,IndexObj(1),IndexObj(2));
    512  end
     487end
    513488set(huvmat,'UserData',UvData)
    514489
    515 %% plot the field projected on the object and store in the corresponding figue
     490%% plot the field projected on the object
    516491if strcmp(ObjectData.ProjMode,'mask_inside')||strcmp(ObjectData.ProjMode,'mask_outside')||strcmp(ObjectData.ProjMode,'none')
    517492    PlotType='text';
     
    521496        msgbox_uvmat('ERROR', errormsg)
    522497        return
    523     end
    524     fighandle=get(plotaxes,'parent');
    525     PlotParam=read_GUI(fighandle);
    526     PlotType=plot_field(ProjData,plotaxes,PlotParam);%update an existing field plot
     498    end   
     499    if numel(IndexObj)==1   % if only one object is selected, the projection is in uvmat
     500%         plotaxes=hhuvmat.axes3;%handle of axes3 in view_field
     501        PlotType=plot_field(ProjData,hhuvmat.axes3,read_GUI(get(hhuvmat.axes3,'parent')));%update the current uvmat plot
     502    else  % if a second object is selected, the projection is in view_field, and this second object is selected
     503        hview_field=findobj(allchild(0),'tag','view_field');
     504        if isempty(hview_field)
     505            PlotType=view_field(ProjData); %open the view_field GUI for plot
     506          %  hview_field=view_field;%open the GUI view_field if it is not found
     507        else
     508            hhview_field=guidata(hview_field);
     509            [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing  plot in view_field
     510            write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
     511        end
     512%         PlotHandles=guidata(hview_field);
     513%         plotaxes=PlotHandles.axes3;%handle of axes3 in view_field
     514    end
     515%     fighandle=get(plotaxes,'parent');
     516%     PlotParam=read_GUI(fighandle);
     517   % PlotType=plot_field(ProjData,plotaxes,PlotParam);%update an existing field plot
    527518end
    528519if strcmp(PlotType,'text')
  • trunk/src/uvmat.m

    r411 r413  
    25132513        return
    25142514    end
    2515     %     if testnewseries && isfield(ObjectData,'CoordUnit')&& isfield(PlotParam{imap},'Coordinates')
    2516     %         PlotParam{imap}.Coordinates=rmfield(PlotParam{imap}.Coordinates,'CheckFixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field)
    2517     %     end
    25182515    if testnewseries && isfield(ObjectData,'CoordUnit')
    2519         PlotParam{imap}.Coordinates.CheckFixEqual=1;
     2516        PlotParam{imap}.Coordinates.CheckFixEqual=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y)
    25202517    end
    25212518    %use of mask (TODO: check)
     
    44254422hhset_object=guidata(hset_object);
    44264423set(hhset_object.PLOT,'enable','on')% activate the refresh button
    4427 set(handles.MenuObject,'checked','on')
     4424%set(handles.MenuObject,'checked','on')
    44284425set(handles.uvmat,'UserData',UvData)
    44294426set(handles.CheckZoom,'Value',0) %desactivate the zoom for object creation by the mouse
     
    44564453set(handles.edit_object,'Value',0); %suppress the object edit mode
    44574454set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
    4458 set(handles.MenuObject,'checked','on')
     4455%set(handles.MenuObject,'checked','on')
    44594456set(handles.delete_object,'Visible','on')
    44604457
  • trunk/src/view_field.m

    r408 r413  
    9292AxeData.LimEditBox=1; %initialise AxeData, the parent figure sets plot parameters
    9393set(handles.axes3,'UserData',AxeData)
    94 if ~exist('Field','var')
    95     return
    96 end
    97 [PlotType,PlotParamOut]= plot_field(Field,handles.axes3);%,PlotParam,KeepLim,PosColorbar)
    98 
    99 if isfield(PlotParamOut,'Vectors')
    100     set(handles.Vectors,'Visible','on')
    101 end
    102 write_plot_param(handles,PlotParamOut);% update the display of the plotting parameters
    103 
     94if exist('Field','var')
     95    [PlotType,PlotParamOut]= plot_field(Field,handles.axes3);%,PlotParam,KeepLim,PosColorbar)
     96    set(handles.Coordinates,'Visible','on')
     97    if isfield(PlotParamOut,'Vectors')
     98        set(handles.Vectors,'Visible','on')
     99    end
     100    write_plot_param(handles,PlotParamOut);% update the display of the plotting parameters
     101end
    104102%------------------------------------------------------------------------
    105103% --- Outputs from this function are returned to the command menuline.
     
    140138        end
    141139    end
     140end
     141hciv=findobj(allchild(0),'Tag','civ');%find the current civ GUI
     142if ~isempty(hciv)
     143    hhciv=guidata(hciv);
     144    set(hhciv.TestCiv1,'Value',0)% desactivate  TestCiv1 if on
     145    set(hhciv.TestCiv1,'BackgroundColor',[1 0 0])%
     146end
     147corrfig=findobj(allchild(0),'tag','corrfig');% look for a civ correlation window used with TesCiv1
     148if ~isempty(corrfig)
     149    delete(corrfig)
    142150end
    143151
     
    317325if test
    318326    set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
    319     cla(handles.axes3)
    320327else
    321328    set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
     
    328335% --- Executes on button press in 'zoom'.
    329336%-------------------------------------------------------------------
    330 function zoom_Callback(hObject, eventdata, handles)
    331 if (get(handles.zoom,'Value') == 1);
    332     set(handles.zoom,'BackgroundColor',[1 1 0])
    333     set(handles.FixLimits,'Value',1)% propose by default fixed limits for the plotting axes
    334     set(handles.FixLimits,'BackgroundColor',[1 1 0])
    335 else
    336     set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
    337 end
    338 
    339 %-------------------------------------------------------------------
    340 %----Executes on button press in 'record': records the current flags of manual correction.
    341 %-------------------------------------------------------------------
    342 function record_Callback(hObject, eventdata, handles)
    343 % [filebase,num_i1,num_j1,num_i2,num_j2,Ext,NomType,SubDir]=read_input_file(handles);
    344 filename=read_file_boxes(handles);
    345 AxeData=get(gca,'UserData');
    346 [erread,message]=fileattrib(filename);
    347 if ~isempty(message) && ~isequal(message.UserWrite,1)
    348      msgbox_view_field('ERROR',['no writting access to ' filename])
    349      return
    350 end
    351 test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]);
    352 test_civ1=isequal(get(handles.civ1,'BackgroundColor'),[1 1 0]);
    353 if ~test_civ2 && ~test_civ1
    354     msgbox_view_field('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields')
    355 end
    356 if test_civ2
    357     nbname='nb_vectors2';
    358    flagname='vec2_FixFlag';
    359    attrname='fix2';
    360 end
    361 if test_civ1
    362     nbname='nb_vectors';
    363    flagname='vec_FixFlag';
    364    attrname='fix';
    365 end
    366 %write fix flags in the netcdf file
    367 hhh=which('netcdf.open');% look for built-in matlab netcdf library
    368 if ~isequal(hhh,'')% case of new builtin Matlab netcdf library
    369     nc=netcdf.open(filename,'NC_WRITE');
    370     netcdf.reDef(nc)
    371     netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),attrname,1)
    372     dimid = netcdf.inqDimID(nc,nbname);
    373     try
    374         varid = netcdf.inqVarID(nc,flagname);% look for already existing fixflag variable
    375     catch
    376         varid=netcdf.defVar(nc,flagname,'double',dimid);%create fixflag variable if it does not exist
    377     end
    378     netcdf.endDef(nc)
    379     netcdf.putVar(nc,varid,AxeData.FF);
    380     netcdf.close(nc) 
    381 else %old netcdf library
    382     netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)
    383 end
    384 
    385 function netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)
    386 nc=netcdf(filename,'write'); %open netcdf file
    387 result=redef(nc);
    388 eval(['nc.' attrname '=1;']);
    389 theDim=nc(nbname) ;% get the number of velocity vectors
    390 nb_vectors=size(theDim);
    391 var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag
    392 var_FixFlag(1:nb_vectors)=AxeData.FF;%
    393 fin=close(nc);
     337function CheckZoom_Callback(hObject, eventdata, handles)
     338if (get(handles.CheckZoom,'Value') == 1);
     339    set(handles.CheckZoom,'BackgroundColor',[1 1 0])
     340    set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes
     341    set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
     342else
     343    set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
     344end
     345
     346% %-------------------------------------------------------------------
     347% %----Executes on button press in 'record': records the current flags of manual correction.
     348% %-------------------------------------------------------------------
     349% function record_Callback(hObject, eventdata, handles)
     350% % [filebase,num_i1,num_j1,num_i2,num_j2,Ext,NomType,SubDir]=read_input_file(handles);
     351% filename=read_file_boxes(handles);
     352% AxeData=get(gca,'UserData');
     353% [erread,message]=fileattrib(filename);
     354% if ~isempty(message) && ~isequal(message.UserWrite,1)
     355%      msgbox_view_field('ERROR',['no writting access to ' filename])
     356%      return
     357% end
     358% test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]);
     359% test_civ1=isequal(get(handles.civ1,'BackgroundColor'),[1 1 0]);
     360% if ~test_civ2 && ~test_civ1
     361%     msgbox_view_field('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields')
     362% end
     363% if test_civ2
     364%     nbname='nb_vectors2';
     365%    flagname='vec2_FixFlag';
     366%    attrname='fix2';
     367% end
     368% if test_civ1
     369%     nbname='nb_vectors';
     370%    flagname='vec_FixFlag';
     371%    attrname='fix';
     372% end
     373% %write fix flags in the netcdf file
     374% hhh=which('netcdf.open');% look for built-in matlab netcdf library
     375% if ~isequal(hhh,'')% case of new builtin Matlab netcdf library
     376%     nc=netcdf.open(filename,'NC_WRITE');
     377%     netcdf.reDef(nc)
     378%     netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),attrname,1)
     379%     dimid = netcdf.inqDimID(nc,nbname);
     380%     try
     381%         varid = netcdf.inqVarID(nc,flagname);% look for already existing fixflag variable
     382%     catch
     383%         varid=netcdf.defVar(nc,flagname,'double',dimid);%create fixflag variable if it does not exist
     384%     end
     385%     netcdf.endDef(nc)
     386%     netcdf.putVar(nc,varid,AxeData.FF);
     387%     netcdf.close(nc) 
     388% else %old netcdf library
     389%     netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)
     390% end
     391%
     392% function netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)
     393% nc=netcdf(filename,'write'); %open netcdf file
     394% result=redef(nc);
     395% eval(['nc.' attrname '=1;']);
     396% theDim=nc(nbname) ;% get the number of velocity vectors
     397% nb_vectors=size(theDim);
     398% var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag
     399% var_FixFlag(1:nb_vectors)=AxeData.FF;%
     400% fin=close(nc);
    394401
    395402
     
    500507set_vec_col_bar(handles)
    501508update_plot(handles)
    502 %------------------------------------------------------------
    503 %update the slider values after displaying vectors
    504 %--------------------------------------------------------
    505 % function slider_update(handles,auto,minC,colcode1,colcode2,maxC)
    506 % set(handles.slider1,'Min',minC)
    507 % set(handles.slider1,'Max',maxC)
    508 % set(handles.slider2,'Min',minC)
    509 % set(handles.slider2,'Max',maxC)
    510 % set(handles.min_C_title_vec,'String',num2str(minC))
    511 % set(handles.max_vec,'String',num2str(maxC))
    512 % if auto
    513 %         set(handles.colcode1,'String',num2str(colcode1,3))%update display
    514 %         set(handles.colcode2,'String',num2str(colcode2,3))
    515 % end
    516 % set(handles.slider1,'Value',colcode1)%update slider with constant display
    517 % set(handles.slider2,'Value',colcode2)
    518 % set_vec_col_bar(handles)
    519 
    520509
    521510%-------------------------------------------------------
     
    719708set(handles.vec_col_bar,'Cdata',A)
    720709
    721 % %------------------------------------------------------------------------
    722 % function PlotType=update_plot(handles)
    723 % %------------------------------------------------------------------------
    724 % haxes= handles.axes3;
    725 %
    726 % %ProjField=get(haxes,'UserData');
    727 % ViewFieldData=get(handles.view_field,'UserData');
    728 % ProjField=ViewFieldData.axes3;
    729 % %ProjField=get(haxes,'UserData');
    730 % PlotParam=read_GUI(handles.view_field);
    731 % [PlotType,PlotParamOut]= plot_field(ProjField,haxes,PlotParam,1);
    732 % write_plot_param(handles,PlotParamOut); %update the auto plot parameters
    733 
    734710%-------------------------------------------------------------------
    735711function update_plot(handles)
     
    768744
    769745
    770 
    771 
    772746% --- Executes on selection change in ColorCode.
    773747function ColorCode_Callback(hObject, eventdata, handles)
Note: See TracChangeset for help on using the changeset viewer.