Changeset 292 for trunk/src/uvmat.m


Ignore:
Timestamp:
Nov 21, 2011, 11:12:06 AM (9 years ago)
Author:
sommeria
Message:

GUI civ patch2 corrected (SmoothingParam?).
uvmatand view_field updated with panels.
read_plot_param removed (replaced by the mostgeneral read_GUI)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r278 r292  
    147147%                     = translate: translate an existing object
    148148%                    = calibration: move a calibration point
    149 %                    = zoom: isolate a subregion for zoom in=1 if an object is being currently drawn, 0 else (set to 0 by releasing mouse button)
     149%                    = CheckZoom: isolate a subregion for CheckZoom in=1 if an object is being currently drawn, 0 else (set to 0 by releasing mouse button)
    150150%            .CurrentOrigin: Origin of a curently drawn edit_object
    151151%            .CurrentLine: currently drawn menuline (A REVOIR)
    152152%            .CurrentObject: handle of the currently drawn edit_object
    153 %            .CurrentRectZoom: current rectangle used for zoom
     153%            .CurrentRectZoom: current rectangle used for CheckZoom
    154154
    155155% Properties attached to projection objects (create, menuline, menuplane...):
     
    714714if isfield(imainfo,'Width') && isfield(imainfo,'Height')
    715715    if length(imainfo)>1
    716         set(handles.npx,'String',num2str(imainfo(1).Width));%fills nbre of pixels x box
    717         set(handles.npy,'String',num2str(imainfo(1).Height));%fills nbre of pixels x box
     716        set(handles.num_Npx,'String',num2str(imainfo(1).Width));%fills nbre of pixels x box
     717        set(handles.num_Npy,'String',num2str(imainfo(1).Height));%fills nbre of pixels x box
    718718    else
    719         set(handles.npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box
    720         set(handles.npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box
    721     end
    722 else
    723     set(handles.npx,'String','');%fills nbre of pixels x box
    724     set(handles.npy,'String','');%fills nbre of pixels x box
    725 end
    726 set(handles.BW,'Value',strcmp(ColorType,'grayscale'))% select handles.BW if grayscale image
     719        set(handles.num_Npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box
     720        set(handles.num_Npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box
     721    end
     722else
     723    set(handles.num_Npx,'String','');%fills nbre of pixels x box
     724    set(handles.num_Npy,'String','');%fills nbre of pixels x box
     725end
     726set(handles.CheckBW,'Value',strcmp(ColorType,'grayscale'))% select handles.CheckBW if grayscale image
    727727
    728728% read parameters (time, geometric calibration..) from a documentation file (.xml advised)
     
    783783    elseif error==1, warntext='inconsistent number of fields in the .civ file';
    784784    end 
    785     set(handles.npx,'String',num2str(npx));%fills nbre of pixels x box
    786     set(handles.npy,'String',num2str(npy));%fills nbre of pixels y box
     785    set(handles.num_Npx,'String',num2str(npx));%fills nbre of pixels x box
     786    set(handles.num_Npy,'String',num2str(npy));%fills nbre of pixels y box
    787787    set(handles.pxcm,'String',num2str(pxcmx));%fills scale x (pixel/cm) box
    788788    set(handles.pycm,'String',num2str(pxcmy));%fills scale y (pixel/cm) box
     
    842842            set(handles.pycm,'String',num2str(pixcmy))
    843843        end
    844         if ~get(handles.FixLimits,'Value')
     844        if ~get(handles.CheckFixLimits,'Value')
    845845            set(handles.transform_fct,'Value',2); % phys transform by default if fixedLimits is off
    846846        end
     
    900900            col_vec={'get_field...'};
    901901        end
    902         set(handles.col_vec,'String',col_vec)
     902        set(handles.ListColorScalar,'String',col_vec)
    903903    end
    904904end
     
    12461246end
    12471247if ~isempty(imainfo)% (an image has been introduced as second fierld input)
    1248     if strcmp(get(handles.npx,'String'),'') || strcmp(get(handles.npy,'String'),'')%update npx and npy if it is not already filled by the first input field
     1248    if strcmp(get(handles.num_Npx,'String'),'') || strcmp(get(handles.num_Npy,'String'),'')%update npx and npy if it is not already filled by the first input field
    12491249        if  isfield(imainfo,'Width') && isfield(imainfo,'Height')
    1250             set(handles.npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box
    1251             set(handles.npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box
     1250            set(handles.num_Npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box
     1251            set(handles.num_Npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box
    12521252        else
    1253             set(handles.npx,'String','');%fills nbre of pixels x box
    1254             set(handles.npy,'String','');%fills nbre of pixels x box
    1255         end
    1256         set(handles.BW,'Value',strcmp(ColorType,'grayscale'))% select handles.BW if grayscale image
     1253            set(handles.num_Npx,'String','');%fills nbre of pixels x box
     1254            set(handles.num_Npy,'String','');%fills nbre of pixels x box
     1255        end
     1256        set(handles.CheckBW,'Value',strcmp(ColorType,'grayscale'))% select handles.CheckBW if grayscale image
    12571257    end
    12581258end
     
    12901290    end
    12911291   
    1292     set(handles.npx,'String',num2str(npx));%fills nbre of pixels x box
    1293     set(handles.npy,'String',num2str(npy));%fills nbre of pixels y box
     1292    set(handles.num_Npx,'String',num2str(npx));%fills nbre of pixels x box
     1293    set(handles.num_Npy,'String',num2str(npy));%fills nbre of pixels y box
    12941294    set(handles.pxcm,'String',num2str(pxcmx));%fills scale x (pixel/cm) box
    12951295    set(handles.pycm,'String',num2str(pxcmy));%fills scale y (pixel/cm) box
     
    16831683function runplus_Callback(hObject, eventdata, handles)
    16841684%-------------------------------------------------------------------
    1685 eventdata
    16861685set(handles.runplus,'BackgroundColor',[1 1 0])%paint the command button in yellow
    16871686drawnow
     
    21152114        end
    21162115        if strcmp(FieldName,'velocity')
    2117             list_code=get(handles.color_code,'String');% list menu fields
    2118             index_code=get(handles.color_code,'Value');% selected string index
     2116            list_code=get(handles.ListColorCode,'String');% list menu fields
     2117            index_code=get(handles.ListColorCode,'Value');% selected string index
    21192118            if  ~strcmp(list_code{index_code},'black') &&  ~strcmp(list_code{index_code},'white')
    2120                 list_code=get(handles.col_vec,'String');% list menu fields
    2121                 index_code=get(handles.col_vec,'Value');% selected string index
     2119                list_code=get(handles.ListColorScalar,'String');% list menu fields
     2120                index_code=get(handles.ListColorScalar,'Value');% selected string index
    21222121                ParamIn.ColorVar= list_code{index_code}; % selected field
    21232122            end
     
    21562155    end       
    21572156    if isfield(ParamOut,'Npx')&& isfield(ParamOut,'Npy')
    2158         set(handles.npx,'String',num2str(ParamOut.Npx));% display image size on the interface
    2159         set(handles.npy,'String',num2str(ParamOut.Npy));
     2157        set(handles.num_Npx,'String',num2str(ParamOut.Npx));% display image size on the interface
     2158        set(handles.num_Npy,'String',num2str(ParamOut.Npy));
    21602159    end
    21612160    if isfield(ParamOut,'TimeIndex')
     
    22352234            end
    22362235            if strcmp(FieldName_1,'velocity')
    2237                 list_code=get(handles.color_code,'String');% list menu fields
    2238                 index_code=get(handles.color_code,'Value');% selected string index
     2236                list_code=get(handles.ListColorCode,'String');% list menu fields
     2237                index_code=get(handles.ListColorCode,'Value');% selected string index
    22392238                if  ~strcmp(list_code{index_code},'black') &&  ~strcmp(list_code{index_code},'white')
    2240                     list_code=get(handles.col_vec,'String');% list menu fields
    2241                     index_code=get(handles.col_vec,'Value');% selected string index
     2239                    list_code=get(handles.ListColorScalar,'String');% list menu fields
     2240                    index_code=get(handles.ListColorScalar,'Value');% selected string index
    22422241                    ParamIn.ColorVar= list_code{index_code}; % selected field
    22432242                end
     
    22682267%% update uvmat interface
    22692268if isfield(ParamOut,'Npx')
    2270     set(handles.npx,'String',num2str(ParamOut.Npx));% display image size on the interface
    2271     set(handles.npy,'String',num2str(ParamOut.Npy));
     2269    set(handles.num_Npx,'String',num2str(ParamOut.Npx));% display image size on the interface
     2270    set(handles.num_Npy,'String',num2str(ParamOut.Npy));
    22722271elseif isfield(ParamOut_1,'Npx')
    2273     set(handles.npx,'String',num2str(ParamOut_1.Npx));% display image size on the interface
    2274     set(handles.npy,'String',num2str(ParamOut_1.Npy));
     2272    set(handles.num_Npx,'String',num2str(ParamOut_1.Npx));% display image size on the interface
     2273    set(handles.num_Npy,'String',num2str(ParamOut_1.Npy));
    22752274end
    22762275
     
    25812580    UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat
    25822581    set(handles.list_object_1,'Value',1);
    2583     list_object=get(handles.list_object_1,'String')
     2582    list_object=get(handles.list_object_1,'String');
    25842583    if isempty(list_object)
    25852584        list_object={''};
     
    25992598%% reset the min and max of scalar if only the mask is displayed(TODO: check the need)
    26002599if isfield(UvData,'Mask')&& ~isfield(UvData,'A')
    2601     set(handles.MinA,'String','0')
    2602     set(handles.MaxA,'String','255')
     2600    set(handles.num_MinA,'String','0')
     2601    set(handles.num_MaxA,'String','255')
    26032602end
    26042603
     
    26252624    haxes(1)=handles.axes3;
    26262625end
    2627 PlotParam{1}=read_plot_param(handles);%read plotting parameters on the uvmat interfac
    2628 keeplim(1)=get(handles.FixLimits,'Value');% test for fixed graph limits
     2626%PlotParam{1}=read_plot_param(handles);%read plotting parameters on the uvmat interfac
     2627PlotParam{1}=read_GUI(handles.uvmat);
     2628keeplim(1)=get(handles.CheckFixLimits,'Value');% test for fixed graph limits
    26292629PosColorbar{1}=UvData.OpenParam.PosColorbar;%prescribe the colorbar position on the uvmat interface
    26302630
     
    26402640        plot_handles{2}=guidata(view_field_handle);
    26412641        haxes(2)=plot_handles{2}.axes3;
    2642         PlotParam{2}=read_plot_param(plot_handles{2});%read plotting parameters on the uvmat interface
    2643         keeplim(2)=get(plot_handles{2}.FixLimits,'Value');
     2642        %PlotParam{2}=read_plot_param(plot_handles{2});%read plotting parameters on the viewinterface
     2643        PlotParam{2}=read_GUI(handles.uvmat);%read plotting parameters on the uvmat interface
     2644        keeplim(2)=get(plot_handles{2}.CheckFixLimits,'Value');
    26442645        PosColorbar{2}='*'; %TODO: deal with colorbar position on view_field
    26452646    end
     
    26502651    iobj=IndexObj(imap);
    26512652    [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj});% project field on the object
    2652     if testnewseries && isfield(ObjectData,'CoordUnit')
    2653         PlotParam{imap}=rmfield(PlotParam{imap},'FixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field)
     2653    if testnewseries && isfield(ObjectData,'CoordUnit')&& isfield(PlotParam{imap},'Coordinates')
     2654        PlotParam{imap}=rmfield(PlotParam{imap}.Coordinates,'CheckFixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field)
    26542655    end
    26552656    if ~isempty(errormsg)
     
    28722873
    28732874%-------------------------------------------------------------------
    2874 % --- Executes on button press in 'FixLimits'.
    2875 %-------------------------------------------------------------------
    2876 function FixLimits_Callback(hObject, eventdata, handles)
    2877 test=get(handles.FixLimits,'Value');
     2875% --- Executes on button press in 'CheckFixLimits'.
     2876%-------------------------------------------------------------------
     2877function CheckFixLimits_Callback(hObject, eventdata, handles)
     2878test=get(handles.CheckFixLimits,'Value');
    28782879if test
    2879     set(handles.FixLimits,'BackgroundColor',[1 1 0])
    2880 else
    2881     set(handles.FixLimits,'BackgroundColor',[0.7 0.7 0.7])
     2880    set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
     2881else
     2882    set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7])
    28822883    update_plot(handles);
    28832884end
    28842885
    28852886%-------------------------------------------------------------------
    2886 % --- Executes on button press in FixEqual.
    2887 function FixEqual_Callback(hObject, eventdata, handles)
    2888 test=get(handles.FixEqual,'Value');
     2887% --- Executes on button press in CheckFixEqual.
     2888function CheckFixEqual_Callback(hObject, eventdata, handles)
     2889test=get(handles.CheckFixEqual,'Value');
    28892890if test
    2890     set(handles.FixEqual,'BackgroundColor',[1 1 0])
     2891    set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
    28912892    cla(handles.axes3)
    28922893    update_plot(handles);
    28932894else
    2894     set(handles.FixEqual,'BackgroundColor',[0.7 0.7 0.7])
     2895    set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
    28952896    update_plot(handles);
    28962897%     axis(handles.axes3,'image')
     
    29012902
    29022903%-------------------------------------------------------------------
    2903 % --- Executes on button press in 'zoom'.
    2904 %-------------------------------------------------------------------
    2905 function zoom_Callback(hObject, eventdata, handles)
    2906 
    2907 if (get(handles.zoom,'Value') == 1);
    2908     set(handles.zoom,'BackgroundColor',[1 1 0])
    2909     set(handles.FixLimits,'Value',1)% propose by default fixed limits for the plotting axes
    2910     set(handles.FixLimits,'BackgroundColor',[1 1 0])
    2911 else
    2912     set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
     2904% --- Executes on button press in 'CheckZoom'.
     2905%-------------------------------------------------------------------
     2906function CheckZoom_Callback(hObject, eventdata, handles)
     2907
     2908if (get(handles.CheckZoom,'Value') == 1);
     2909    set(handles.CheckZoom,'BackgroundColor',[1 1 0])
     2910    set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes
     2911    set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
     2912else
     2913    set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
    29132914end
    29142915
     
    32583259%common to Fields_1_Callback
    32593260if isequal(field,'image')||isequal(field_1,'image')
    3260     set(handles.npx_title,'Visible','on')% visible npx,pxcm... buttons
    3261     set(handles.npy_title,'Visible','on')
    3262     set(handles.npx,'Visible','on')
    3263     set(handles.npy,'Visible','on')
    3264 else
    3265     set(handles.npx_title,'Visible','off')% visible npx,pxcm... buttons
    3266     set(handles.npy_title,'Visible','off')
    3267     set(handles.npx,'Visible','off')
    3268     set(handles.npy,'Visible','off')
     3261    set(handles.TitleNpx,'Visible','on')% visible npx,pxcm... buttons
     3262    set(handles.TitleNpy,'Visible','on')
     3263    set(handles.num_Npx,'Visible','on')
     3264    set(handles.num_Npy,'Visible','on')
     3265else
     3266    set(handles.TitleNpx,'Visible','off')% visible npx,pxcm... buttons
     3267    set(handles.TitleNpy,'Visible','off')
     3268    set(handles.num_Npx,'Visible','off')
     3269    set(handles.num_Npy,'Visible','off')
    32693270end
    32703271setfield(handles);% update the field structure ('civ1'....)
     
    34463447%common to Fields_Callback
    34473448if isequal(field,'image')||isequal(field_1,'image')
    3448     set(handles.npx_title,'Visible','on')% visible npx,pxcm... buttons
    3449     set(handles.npy_title,'Visible','on')
    3450     set(handles.npx,'Visible','on')
    3451     set(handles.npy,'Visible','on')
     3449    set(handles.TitleNpx,'Visible','on')% visible npx,pxcm... buttons
     3450    set(handles.TitleNpy,'Visible','on')
     3451    set(handles.num_Npx,'Visible','on')
     3452    set(handles.num_Npy,'Visible','on')
    34523453%     set(handles.fix_pair,'Value',0)
    34533454else
    3454     set(handles.npx_title,'Visible','off')% visible npx,pxcm... buttons
    3455     set(handles.npy_title,'Visible','off')
    3456     set(handles.npx,'Visible','off')
    3457     set(handles.npy,'Visible','off')
     3455    set(handles.TitleNpx,'Visible','off')% visible npx,pxcm... buttons
     3456    set(handles.TitleNpy,'Visible','off')
     3457    set(handles.num_Npx,'Visible','off')
     3458    set(handles.num_Npy,'Visible','off')
    34583459%     set(handles.fix_pair,'Value',1)
    34593460end
     
    35743575UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    35753576if isequal(get(handles.VOLUME,'Value'),1)
    3576     set(handles.zoom,'Value',0)
    3577     set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
     3577    set(handles.CheckZoom,'Value',0)
     3578    set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
    35783579    set(handles.edit_vect,'Value',0)
    35793580    edit_vect_Callback(hObject, eventdata, handles)
     
    36333634    set(handles.edit_vect,'BackgroundColor',[1 1 0])
    36343635    set(handles.edit_object,'Value',0)
    3635     set(handles.zoom,'Value',0)
    3636     set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
     3636    set(handles.CheckZoom,'Value',0)
     3637    set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
    36373638%     set(handles.create,'Value',0)
    36383639%     set(handles.create,'BackgroundColor',[0 1 0])
     
    37413742
    37423743%------------------------------------------------------------------
    3743 % --- Executes on selection change in col_vec: choice of the color code.
     3744% --- Executes on selection change in ListColorScalar: choice of the color code.
    37443745%
    3745 function col_vec_Callback(hObject, eventdata, handles)
     3746function ListColorScalar_Callback(hObject, eventdata, handles)
    37463747%------------------------------------------------------------------
    37473748% edit the choice for color code
    3748 list_code=get(handles.col_vec,'String');% list menu fields
    3749 index_code=get(handles.col_vec,'Value');% selected string index
     3749list_code=get(handles.ListColorScalar,'String');% list menu fields
     3750index_code=get(handles.ListColorScalar,'Value');% selected string index
    37503751col_code= list_code{index_code(1)}; % selected field
    37513752if isequal(col_code,'black') || isequal(col_code,'white')
    3752    set(handles.slider1,'Visible','off')
    3753    set(handles.slider2,'Visible','off')
    3754    set(handles.colcode1,'Visible','off')
    3755    set(handles.colcode2,'Visible','off')
    3756    set(handles.AutoVecColor,'Visible','off')
     3753   set(handles.Slider1,'Visible','off')
     3754   set(handles.Slider2,'Visible','off')
     3755   set(handles.num_ColCode1,'Visible','off')
     3756   set(handles.num_ColCode2,'Visible','off')
     3757   set(handles.CheckFixVecColor,'Visible','off')
    37573758   set_vec_col_bar(handles)
    37583759else
    3759    set(handles.slider1,'Visible','on')
    3760    set(handles.slider2,'Visible','on')
    3761    set(handles.colcode1,'Visible','on')
    3762    set(handles.colcode2,'Visible','on')
    3763    set(handles.AutoVecColor,'Visible','on') 
     3760   set(handles.Slider1,'Visible','on')
     3761   set(handles.Slider2,'Visible','on')
     3762   set(handles.num_ColCode1,'Visible','on')
     3763   set(handles.num_ColCode2,'Visible','on')
     3764   set(handles.CheckFixVecColor,'Visible','on') 
    37643765   if isequal(col_code,'ima_cor')
    3765        set(handles.AutoVecColor,'Value',0)%fixed scale by default
    3766        set(handles.vec_col_bar,'Value',0)% 3 colors r,g,b by default
    3767        set(handles.slider1,'Min',0);
    3768        set(handles.slider1,'Max',1);
    3769        set(handles.slider2,'Min',0);
    3770        set(handles.slider2,'Max',1);
     3766       set(handles.CheckFixVecColor,'Value',0)%fixed scale by default
     3767       set(handles.VecColBar,'Value',0)% 3 colors r,g,b by default
     3768       set(handles.Slider1,'Min',0);
     3769       set(handles.Slider1,'Max',1);
     3770       set(handles.Slider2,'Min',0);
     3771       set(handles.Slider2,'Max',1);
    37713772 %      set(handles.min_title_vec,'String','0')
    3772        set(handles.max_vec,'String','1')
    3773        set(handles.colcode1,'String','0.333')
     3773       set(handles.num_MaxVec,'String','1')
     3774       set(handles.num_ColCode1,'String','0.333')
    37743775       colcode1_Callback(hObject, eventdata, handles)
    3775        set(handles.colcode2,'String','0.666')
     3776       set(handles.num_ColCode2,'String','0.666')
    37763777       colcode2_Callback(hObject, eventdata, handles)
    37773778   else
    3778        set(handles.AutoVecColor,'Value',1)%auto scale between min,max by default
    3779        set(handles.vec_col_bar,'Value',1)% colormap 'jet' by default
    3780        minval=get(handles.slider1,'Min');
    3781        maxval=get(handles.slider1,'Max');
    3782        set(handles.slider1,'Value',minval)
    3783        set(handles.slider2,'Value',maxval)
     3779       set(handles.CheckFixVecColor,'Value',1)%auto scale between min,max by default
     3780       set(handles.VecColBar,'Value',1)% colormap 'jet' by default
     3781       minval=get(handles.Slider1,'Min');
     3782       maxval=get(handles.Slider1,'Max');
     3783       set(handles.Slider1,'Value',minval)
     3784       set(handles.Slider2,'Value',maxval)
    37843785       set_vec_col_bar(handles)
    37853786   end
     
    37933794% -- Executes on slider movement to set the color code
    37943795%
    3795 function slider1_Callback(hObject, eventdata, handles)
     3796function Slider1_Callback(hObject, eventdata, handles)
    37963797%------------------------------------------------------------------
    3797 slider1=get(handles.slider1,'Value');
    3798 min_val=str2num(get(handles.min_vec,'String'));
    3799 max_val=str2num(get(handles.max_vec,'String'));
     3798slider1=get(handles.Slider1,'Value');
     3799min_val=str2num(get(handles.num_MinVec,'String'));
     3800max_val=str2num(get(handles.num_MaxVec,'String'));
    38003801col=min_val+(max_val-min_val)*slider1;
    3801 set(handles.colcode1,'String',num2str(col))
    3802 if(get(handles.slider2,'Value') < col)%move also the second slider at the same value if needed
    3803     set(handles.slider2,'Value',col)
    3804     set(handles.colcode2,'String',num2str(col))
     3802set(handles.num_ColCode1,'String',num2str(col))
     3803if(get(handles.Slider2,'Value') < col)%move also the second slider at the same value if needed
     3804    set(handles.Slider2,'Value',col)
     3805    set(handles.num_ColCode2,'String',num2str(col))
    38053806end
    38063807colcode1_Callback(hObject, eventdata, handles)
     
    38093810% Executes on slider movement to set the color code
    38103811%----------------------------------------------------------------
    3811 function slider2_Callback(hObject, eventdata, handles)
    3812 slider2=get(handles.slider2,'Value');
    3813 min_val=str2num(get(handles.min_vec,'String'));
    3814 max_val=str2num(get(handles.max_vec,'String'));
     3812function Slider2_Callback(hObject, eventdata, handles)
     3813slider2=get(handles.Slider2,'Value');
     3814min_val=str2num(get(handles.num_MinVec,'String'));
     3815max_val=str2num(get(handles.num_MaxVec,'String'));
    38153816col=min_val+(max_val-min_val)*slider2;
    3816 set(handles.colcode2,'String',num2str(col))
    3817 if(get(handles.slider1,'Value') > col)%move also the first slider at the same value if needed
    3818     set(handles.slider1,'Value',col)
    3819     set(handles.colcode1,'String',num2str(col))
     3817set(handles.num_ColCode2,'String',num2str(col))
     3818if(get(handles.Slider1,'Value') > col)%move also the first slider at the same value if needed
     3819    set(handles.Slider1,'Value',col)
     3820    set(handles.num_ColCode1,'String',num2str(col))
    38203821end
    38213822colcode2_Callback(hObject, eventdata, handles)
     
    38243825%execute on return carriage on the edit box corresponding to slider 1
    38253826%----------------------------------------------------------------
    3826 function colcode1_Callback(hObject, eventdata, handles)
    3827 % col=str2num(get(handles.colcode1,'String'));
    3828 % set(handles.slider1,'Value',col)
     3827function num_ColCode1_Callback(hObject, eventdata, handles)
     3828% col=str2num(get(handles.num_ColCode1,'String'));
     3829% set(handles.Slider1,'Value',col)
    38293830set_vec_col_bar(handles)
    38303831update_plot(handles);
     
    38333834%execute on return carriage on the edit box corresponding to slider 2
    38343835%----------------------------------------------------------------
    3835 function colcode2_Callback(hObject, eventdata, handles)
    3836 % col=str2num(get(handles.colcode2,'String'));
    3837 % set(handles.slider2,'Value',col)
     3836function num_ColCode2_Callback(hObject, eventdata, handles)
     3837% col=str2num(get(handles.num_ColCode2,'String'));
     3838% set(handles.Slider2,'Value',col)
    38383839% slider2_Callback(hObject, eventdata, handles)
    38393840set_vec_col_bar(handles)
     
    38423843%update the slider values after displaying vectors
    38433844%--------------------------------------------------------
    3844 % function slider_update(handles,auto,minC,colcode1,colcode2,maxC)
    3845 % set(handles.slider1,'Min',minC)
    3846 % set(handles.slider1,'Max',maxC)
    3847 % set(handles.slider2,'Min',minC)
    3848 % set(handles.slider2,'Max',maxC)
     3845% function slider_update(handles,auto,minC,num_ColCode1,num_ColCode2,maxC)
     3846% set(handles.Slider1,'Min',minC)
     3847% set(handles.Slider1,'Max',maxC)
     3848% set(handles.Slider2,'Min',minC)
     3849% set(handles.Slider2,'Max',maxC)
    38493850% set(handles.min_title_vec,'String',num2str(minC))
    3850 % set(handles.max_vec,'String',num2str(maxC))
     3851% set(handles.num_MaxVec,'String',num2str(maxC))
    38513852% if auto
    3852 %         set(handles.colcode1,'String',num2str(colcode1,3))%update display
    3853 %         set(handles.colcode2,'String',num2str(colcode2,3))
     3853%         set(handles.num_ColCode1,'String',num2str(num_ColCode1,3))%update display
     3854%         set(handles.num_ColCode2,'String',num2str(num_ColCode2,3))
    38543855% end
    3855 % set(handles.slider1,'Value',colcode1)%update slider with constant display
    3856 % set(handles.slider2,'Value',colcode2)
     3856% set(handles.Slider1,'Value',num_ColCode1)%update slider with constant display
     3857% set(handles.Slider2,'Value',num_ColCode2)
    38573858% set_vec_col_bar(handles)
    38583859
    38593860
    38603861%-------------------------------------------------------
    3861 % --- Executes on button press in AutoVecColor.
     3862% --- Executes on button press in CheckFixVecColor.
    38623863%-------------------------------------------------------
    3863 function vec_col_bar_Callback(hObject, eventdata, handles)
     3864function VecColBar_Callback(hObject, eventdata, handles)
    38643865set_vec_col_bar(handles)
    38653866
     
    39243925end
    39253926
    3926 set(handles.FixLimits,'Value',0)
    3927 set(handles.FixLimits,'BackgroundColor',[0.7 0.7 0.7])
     3927set(handles.CheckFixLimits,'Value',0)
     3928set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7])
    39283929
    39293930%delete drawn objects
     
    40414042            end
    40424043        end
    4043 %         set(haxes,'XLimMode','auto')%reset auto mode (after zoom effect)
     4044%         set(haxes,'XLimMode','auto')%reset auto mode (after CheckZoom effect)
    40444045%         set(haxes,'YLimMode','auto')
    40454046%         PlotParam.Auto_xy=1;
     
    40534054
    40544055%------------------------------------------------------------------------
    4055 function MinX_Callback(hObject, eventdata, handles)
    4056 %------------------------------------------------------------------------
    4057 set(handles.FixLimits,'Value',1) %suppress auto mode
    4058 set(handles.FixLimits,'BackgroundColor',[1 1 0])
     4056function num_MinX_Callback(hObject, eventdata, handles)
     4057%------------------------------------------------------------------------
     4058set(handles.CheckFixLimits,'Value',1) %suppress auto mode
     4059set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
    40594060update_plot(handles);
    40604061
    40614062%------------------------------------------------------------------------
    4062 function MaxX_Callback(hObject, eventdata, handles)
    4063 %------------------------------------------------------------------------
    4064 set(handles.FixLimits,'Value',1) %suppress auto mode
    4065 set(handles.FixLimits,'BackgroundColor',[1 1 0])
     4063function num_MaxX_Callback(hObject, eventdata, handles)
     4064%------------------------------------------------------------------------
     4065set(handles.CheckFixLimits,'Value',1) %suppress auto mode
     4066set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
    40664067update_plot(handles);
    40674068
    40684069%------------------------------------------------------------------------
    4069 function MinY_Callback(hObject, eventdata, handles)
     4070function num_MinY_Callback(hObject, eventdata, handles)
    40704071%------------------------------------------
    4071 set(handles.FixLimits,'Value',1) %suppress auto mode
    4072 set(handles.FixLimits,'BackgroundColor',[1 1 0])
     4072set(handles.CheckFixLimits,'Value',1) %suppress auto mode
     4073set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
    40734074update_plot(handles);
    40744075
    40754076%------------------------------------------------------------------------
    4076 function MaxY_Callback(hObject, eventdata, handles)
    4077 %------------------------------------------------------------------------
    4078 set(handles.FixLimits,'Value',1) %suppress auto mode
    4079 set(handles.FixLimits,'BackgroundColor',[1 1 0])
     4077function num_MaxY_Callback(hObject, eventdata, handles)
     4078%------------------------------------------------------------------------
     4079set(handles.CheckFixLimits,'Value',1) %suppress auto mode
     4080set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
    40804081update_plot(handles);
    40814082
    40824083%------------------------------------------------------------------------
    4083 function MinA_Callback(hObject, eventdata, handles)
     4084function num_MinA_Callback(hObject, eventdata, handles)
    40844085%------------------------------------------
    4085 set(handles.FixScal,'Value',1) %suppress auto mode
    4086 set(handles.FixScal,'BackgroundColor',[1 1 0])
    4087 MinA=str2double(get(handles.MinA,'String'));
    4088 MaxA=str2double(get(handles.MaxA,'String'));
     4086set(handles.CheckFixScalar,'Value',1) %suppress auto mode
     4087set(handles.CheckFixScalar,'BackgroundColor',[1 1 0])
     4088MinA=str2double(get(handles.num_MinA,'String'));
     4089MaxA=str2double(get(handles.num_MaxA,'String'));
    40894090if MinA>MaxA% switch minA and maxA in case of error
    40904091    MinA_old=MinA;
    40914092    MinA=MaxA;
    40924093    MaxA=MinA_old;
    4093     set(handles.MinA,'String',num2str(MinA,5));
    4094     set(handles.MaxA,'String',num2str(MaxA,5));
     4094    set(handles.num_MinA,'String',num2str(MinA,5));
     4095    set(handles.num_MaxA,'String',num2str(MaxA,5));
    40954096end
    40964097update_plot(handles);
    40974098
    40984099%------------------------------------------------------------------------
    4099 function MaxA_Callback(hObject, eventdata, handles)
    4100 %------------------------------------------------------------------------
    4101 set(handles.FixScal,'Value',1) %suppress auto mode
    4102 set(handles.FixScal,'BackgroundColor',[1 1 0])
    4103 MinA=str2double(get(handles.MinA,'String'));
    4104 MaxA=str2double(get(handles.MaxA,'String'));
     4100function num_MaxA_Callback(hObject, eventdata, handles)
     4101%------------------------------------------------------------------------
     4102set(handles.CheckFixScalar,'Value',1) %suppress auto mode
     4103set(handles.CheckFixScalar,'BackgroundColor',[1 1 0])
     4104MinA=str2double(get(handles.num_MinA,'String'));
     4105MaxA=str2double(get(handles.num_MaxA,'String'));
    41054106if MinA>MaxA% switch minA and maxA in case of error
    41064107        MinA_old=MinA;
    41074108    MinA=MaxA;
    41084109    MaxA=MinA_old;
    4109     set(handles.MinA,'String',num2str(MinA,5));
    4110     set(handles.MaxA,'String',num2str(MaxA,5));
     4110    set(handles.num_MinA,'String',num2str(MinA,5));
     4111    set(handles.num_MaxA,'String',num2str(MaxA,5));
    41114112end
    41124113update_plot(handles);
    41134114
    41144115%------------------------------------------------------------------------
    4115 function FixScal_Callback(hObject, eventdata, handles)
    4116 %------------------------------------------------------------------------
    4117 test=get(handles.FixScal,'Value');
     4116function CheckFixScalar_Callback(hObject, eventdata, handles)
     4117%------------------------------------------------------------------------
     4118test=get(handles.CheckFixScalar,'Value');
    41184119if test
    4119     set(handles.FixScal,'BackgroundColor',[1 1 0])
    4120 else
    4121     set(handles.FixScal,'BackgroundColor',[0.7 0.7 0.7])
     4120    set(handles.CheckFixScalar,'BackgroundColor',[1 1 0])
     4121else
     4122    set(handles.CheckFixScalar,'BackgroundColor',[0.7 0.7 0.7])
    41224123    update_plot(handles);
    41234124end
    41244125
    41254126%-------------------------------------------------------------------
    4126 function BW_Callback(hObject, eventdata, handles)
     4127function CheckBW_Callback(hObject, eventdata, handles)
    41274128%-------------------------------------------------------------------
    41284129update_plot(handles);
    41294130
    41304131%-------------------------------------------------------------------
    4131 function Contours_Callback(hObject, eventdata, handles)
    4132 %-------------------------------------------------------------------
    4133 val=get(handles.Contours,'Value');
     4132function ListContour_Callback(hObject, eventdata, handles)
     4133%-------------------------------------------------------------------
     4134val=get(handles.ListContour,'Value');
    41344135if val==2
    41354136    set(handles.interval_txt,'Visible','on')
    4136     set(handles.IncrA,'Visible','on')
     4137    set(handles.num_IncrA,'Visible','on')
    41374138else
    41384139    set(handles.interval_txt,'Visible','off')
    4139     set(handles.IncrA,'Visible','off')
     4140    set(handles.num_IncrA,'Visible','off')
    41404141end
    41414142update_plot(handles);
    41424143
    41434144%-------------------------------------------------------------------
    4144 function IncrA_Callback(hObject, eventdata, handles)
     4145function num_IncrA_Callback(hObject, eventdata, handles)
    41454146%-------------------------------------------------------------------
    41464147update_plot(handles);
    41474148
    41484149%-------------------------------------------------------------------
    4149 function HideWarning_Callback(hObject, eventdata, handles)
     4150function CheckHideWarning_Callback(hObject, eventdata, handles)
    41504151%-------------------------------------------------------------------
    41514152update_plot(handles);
    41524153
    41534154%-------------------------------------------------------------------
    4154 function HideFalse_Callback(hObject, eventdata, handles)
     4155function CheckHideFalse_Callback(hObject, eventdata, handles)
    41554156%-------------------------------------------------------------------
    41564157update_plot(handles);
    41574158
    41584159%-------------------------------------------------------------------
    4159 function VecScale_Callback(hObject, eventdata, handles)
    4160 %-------------------------------------------------------------------
    4161 set(handles.FixVec,'Value',1);
    4162 set(handles.FixVec,'BackgroundColor',[1 1 0])
     4160function num_VecScale_Callback(hObject, eventdata, handles)
     4161%-------------------------------------------------------------------
     4162set(handles.CheckFixVectors,'Value',1);
     4163set(handles.CheckFixVectors,'BackgroundColor',[1 1 0])
    41634164update_plot(handles);
    41644165
    41654166%-------------------------------------------------------------------
    4166 function FixVec_Callback(hObject, eventdata, handles)
    4167 %-------------------------------------------------------------------
    4168 test=get(handles.FixVec,'Value');
     4167function CheckFixVectors_Callback(hObject, eventdata, handles)
     4168%-------------------------------------------------------------------
     4169test=get(handles.CheckFixVectors,'Value');
    41694170if test
    4170     set(handles.FixVec,'BackgroundColor',[1 1 0])
     4171    set(handles.CheckFixVectors,'BackgroundColor',[1 1 0])
    41714172else
    41724173    update_plot(handles);
    4173     %set(handles.VecScale,'String',num2str(ScalOut.VecScale,3))
    4174     set(handles.FixVec,'BackgroundColor',[0.7 0.7 0.7])
    4175 end
    4176 
    4177 %------------------------------------------------------------------------
    4178 % --- Executes on selection change in decimate4 (nb_vec/4).
    4179 function decimate4_Callback(hObject, eventdata, handles)
     4174    %set(handles.num_VecScale,'String',num2str(ScalOut.num_VecScale,3))
     4175    set(handles.CheckFixVectors,'BackgroundColor',[0.7 0.7 0.7])
     4176end
     4177
     4178%------------------------------------------------------------------------
     4179% --- Executes on selection change in CheckDecimate4 (nb_vec/4).
     4180function CheckDecimate4_Callback(hObject, eventdata, handles)
    41804181%------------------------------------------------------------------------
    41814182update_plot(handles);
    41824183
    41834184%------------------------------------------------------------------------
    4184 % --- Executes on selection change in color_code menu
    4185 function color_code_Callback(hObject, eventdata, handles)
     4185% --- Executes on selection change in ListColorCode menu
     4186function ListColorCode_Callback(hObject, eventdata, handles)
    41864187%------------------------------------------------------------------------
    41874188set_vec_col_bar(handles)
     
    41894190
    41904191%------------------------------------------------------------------------
    4191 % --- Executes on button press in AutoVecColor.
    4192 function AutoVecColor_Callback(hObject, eventdata, handles)
    4193 %------------------------------------------------------------------------
    4194 test=get(handles.AutoVecColor,'Value');
     4192% --- Executes on button press in CheckFixVecColor.
     4193function CheckFixVecColor_Callback(hObject, eventdata, handles)
     4194%------------------------------------------------------------------------
     4195test=get(handles.CheckFixVecColor,'Value');
    41954196if test
    4196     set(handles.AutoVecColor,'BackgroundColor',[1 1 0])
     4197    set(handles.CheckFixVecColor,'BackgroundColor',[1 1 0])
    41974198else
    41984199    update_plot(handles);
    4199     %set(handles.VecScale,'String',num2str(ScalOut.VecScale,3))
    4200     set(handles.AutoVecColor,'BackgroundColor',[0.7 0.7 0.7])
    4201 end
    4202 
    4203 %------------------------------------------------------------------------
    4204 % --- Executes on selection change in max_vec.
    4205 function min_vec_Callback(hObject, eventdata, handles)
     4200    %set(handles.num_VecScale,'String',num2str(ScalOut.num_VecScale,3))
     4201    set(handles.CheckFixVecColor,'BackgroundColor',[0.7 0.7 0.7])
     4202end
     4203
     4204%------------------------------------------------------------------------
     4205% --- Executes on selection change in num_MaxVec.
     4206function num_MinVec_Callback(hObject, eventdata, handles)
    42064207%------------------------------------------------------------------------
    42074208max_vec_Callback(hObject, eventdata, handles)
    42084209
    42094210%------------------------------------------------------------------------
    4210 % --- Executes on selection change in max_vec.
    4211 function max_vec_Callback(hObject, eventdata, handles)
    4212 %------------------------------------------------------------------------
    4213 set(handles.AutoVecColor,'Value',1)
     4211% --- Executes on selection change in num_MaxVec.
     4212function num_MaxVec_Callback(hObject, eventdata, handles)
     4213%------------------------------------------------------------------------
     4214set(handles.CheckFixVecColor,'Value',1)
    42144215AutoVecColor_Callback(hObject, eventdata, handles)
    4215 min_val=str2num(get(handles.min_vec,'String'));
    4216 max_val=str2num(get(handles.max_vec,'String'));
    4217 slider1=get(handles.slider1,'Value');
    4218 slider2=get(handles.slider2,'Value');
     4216min_val=str2num(get(handles.num_MinVec,'String'));
     4217max_val=str2num(get(handles.num_MaxVec,'String'));
     4218slider1=get(handles.Slider1,'Value');
     4219slider2=get(handles.Slider2,'Value');
    42194220colcode1=min_val+(max_val-min_val)*slider1;
    42204221colcode2=min_val+(max_val-min_val)*slider2;
    4221 set(handles.colcode1,'String',num2str(colcode1))
    4222 set(handles.colcode2,'String',num2str(colcode2))
     4222set(handles.num_ColCode1,'String',num2str(colcode1))
     4223set(handles.num_ColCode2,'String',num2str(colcode2))
    42234224update_plot(handles);
    42244225
     
    42274228function set_vec_col_bar(handles)
    42284229%------------------------------------------------------------------------
    4229 %get the image of the color display button 'vec_col_bar' in pixels
    4230 set(handles.vec_col_bar,'Unit','pixel');
    4231 pos_vert=get(handles.vec_col_bar,'Position');
    4232 set(handles.vec_col_bar,'Unit','Normalized');
     4230%get the image of the color display button 'VecColBar' in pixels
     4231set(handles.VecColBar,'Unit','pixel');
     4232pos_vert=get(handles.VecColBar,'Position');
     4233set(handles.VecColBar,'Unit','Normalized');
    42334234width=ceil(pos_vert(3));
    42344235height=ceil(pos_vert(4));
    42354236
    42364237%get slider indications
    4237 list=get(handles.color_code,'String');
    4238 ichoice=get(handles.color_code,'Value');
     4238list=get(handles.ListColorCode,'String');
     4239ichoice=get(handles.ListColorCode,'Value');
    42394240colcode.ColorCode=list{ichoice};
    4240 colcode.MinC=str2num(get(handles.min_vec,'String'));
    4241 colcode.MaxC=str2num(get(handles.max_vec,'String'));
     4241colcode.MinC=str2num(get(handles.num_MinVec,'String'));
     4242colcode.MaxC=str2num(get(handles.num_MaxVec,'String'));
    42424243test3color=strcmp(colcode.ColorCode,'rgb') || strcmp(colcode.ColorCode,'bgr');
    42434244if test3color
    4244     colcode.colcode1=str2num(get(handles.colcode1,'String'));
    4245     colcode.colcode2=str2num(get(handles.colcode2,'String'));
     4245    colcode.colcode1=str2num(get(handles.num_ColCode1,'String'));
     4246    colcode.colcode2=str2num(get(handles.num_ColCode2,'String'));
    42464247end
    42474248colcode.FixedCbounds=0;
     
    42564257A(:,:,2)=A2';
    42574258A(:,:,3)=A3';
    4258 set(handles.vec_col_bar,'Cdata',A)
     4259set(handles.VecColBar,'Cdata',A)
    42594260
    42604261
     
    42654266UvData=get(handles.uvmat,'UserData');
    42664267AxeData=UvData.axes3;
    4267 PlotParam=read_plot_param(handles);
     4268%PlotParam=read_plot_param(handles);
     4269PlotParam=read_GUI(handles.uvmat);
    42684270[PP,PlotParamOut]= plot_field(AxeData,haxes,PlotParam);
    42694271write_plot_param(handles,PlotParamOut); %update the auto plot parameters
     
    42834285    set(handles.edit_object,'BackgroundColor',[1,1,0]) 
    42844286    %suppress the other options
    4285     set(handles.zoom,'Value',0)
     4287    set(handles.CheckZoom,'Value',0)
    42864288    zoom_Callback(hObject, eventdata, handles)
    42874289    hgeometry_calib=findobj(allchild(0),'tag','geometry_calib');
     
    43964398if option==1 ||option==2% lefet mouse selection, peroject the field:
    43974399    ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData
    4398     plot_field(ProjData,PlotHandles.axes3,read_plot_param(PlotHandles));%read plotting parameters on the uvmat interfacPlotHandles);
     4400    %plot_field(ProjData,PlotHandles.axes3,read_plot_param(PlotHandles));%read plotting parameters on the uvmat interfacPlotHandles);
     4401    plot_field(ProjData,PlotHandles.axes3,read_GUI(get(PlotHandles.axes3,'Parent')));%read plotting parameters on the uvmat interfacPlotHandles);
    43994402    UvData.Object=update_obj(UvData,IndexObj,[]);
    44004403    set(handles.uvmat,'UserData',UvData)
     
    45874590
    45884591%suppress competing options
    4589 set(handles.zoom,'Value',0)
    4590 set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
     4592set(handles.CheckZoom,'Value',0)
     4593set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
    45914594set(handles.list_object_1,'Value',1)     
    45924595% initiate display of GUI geometry_calib
     
    50285031set(handles.MenuObject,'checked','on')
    50295032set(handles.uvmat,'UserData',UvData)
    5030 set(handles.zoom,'Value',0)
    5031 zoom_Callback(handles.uvmat, [], handles)
     5033set(handles.CheckZoom,'Value',0)
     5034CheckZoom_Callback(handles.uvmat, [], handles)
    50325035set(handles.delete_object,'Visible','on')
    50335036set(handles.uvmat_title,'Visible','on')
     
    50375040function MenuRuler_Callback(hObject, eventdata, handles)
    50385041%------------------------------------------------------------------------
    5039 set(handles.zoom,'Value',0)
    5040 zoom_Callback(handles.uvmat, [], handles)
     5042set(handles.CheckZoom,'Value',0)
     5043CheckZoom_Callback(handles.uvmat, [], handles)
    50415044set(handles.MenuRuler,'checked','on')
    50425045UvData=get(handles.uvmat,'UserData');
Note: See TracChangeset for help on using the changeset viewer.