Changeset 191


Ignore:
Timestamp:
Feb 5, 2011, 11:25:38 PM (14 years ago)
Author:
sommeria
Message:

introduce edit boxes to set axis limits. rationalisation of names FixScal?, FixLimits?....
introduce volume scan in calibration procedures

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r177 r191  
    204204
    205205% store the calibration data, by default in the xml file of the currently displayed image
    206 hhuvmat=guidata(findobj(allchild(0),'Name','uvmat'));%handles of elements in the GUI uvmat
     206huvmat=findobj(allchild(0),'Name','uvmat');
     207UvData=get(huvmat,'UserData');
     208NbSlice_j=1;%default
     209ZStart=Z_plane;
     210ZEnd=Z_plane;
     211if isfield(UvData,'XmlData')
     212    UvData.XmlData
     213    if isfield(UvData.XmlData,'TranslationMotor')
     214        NbSlice_j=UvData.XmlData.TranslationMotor.Nbslice;
     215        ZStart=UvData.XmlData.TranslationMotor.ZStart;
     216        ZEnd=UvData.XmlData.TranslationMotor.ZEnd;
     217    end
     218end
     219hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat
    207220RootPath='';
    208221RootFile='';
     
    227240if strcmp(answer,'Yes')
    228241    if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration
    229         answer_1=msgbox_uvmat('INPUT_TXT',' Z= ',num2str(Z_plane));
    230         if strcmp(answer_1,'Cancel')
     242       input_key={'Z (first position)','Z (last position)','Z (water surface)', 'refractive index','NbSlice','volume scan (y/n)','tilt angle'};
     243       input_val=[{num2str(ZEnd/10)} {num2str(ZStart/10)} {num2str(ZStart/10)} {'1.33'} num2str(NbSlice_j) {'y'} {'0'}];
     244        answer=inputdlg(input_key,'slice position(s)',ones(1,7), input_val,'on');
     245        %answer_1=msgbox_uvmat('INPUT_TXT',' Z= ',num2str(Z_plane));
     246        GeometryCalib.NbSlice=str2double(answer{5});
     247        GeometryCalib.VolumeScan=answer{6};
     248        if isempty(answer)
    231249            Z_plane=0; %default
    232250        else
    233             Z_plane=str2double(answer_1);
    234         end
    235         GeometryCalib.NbSlice=1;
    236         GeometryCalib.SliceCoord=[0 0 Z_plane];
     251            Z_plane=linspace(str2double(answer{1}),str2double(answer{2}),GeometryCalib.NbSlice);
     252        end     
     253        GeometryCalib.SliceCoord=Z_plane'*[0 0 1]
    237254    end
    238255    errormsg=update_imadoc(GeometryCalib,outputfile);% introduce the calibration data in the xml file
     
    250267        delete(hhh);
    251268    end
    252     set(hhuvmat.FixedLimits,'Value',0)% put FixedLimits option to 'off'
    253     set(hhuvmat.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
     269    set(hhuvmat.FixLimits,'Value',0)% put FixedLimits option to 'off'
     270    set(hhuvmat.FixLimits,'BackgroundColor',[0.7 0.7 0.7])
    254271    UserData=get(handles.geometry_calib,'UserData');
    255272    UserData.XmlInputFile=outputfile;%save the current xml file name
  • trunk/src/imadoc2struct.m

    r185 r191  
    112112end
    113113
     114%% motor
     115if strcmp(option,'*') || strcmp(option,'GeometryCalib')
     116    uid_subtree=find(t,'/ImaDoc/TranslationMotor');
     117    if length(uid_subtree)==1
     118        subt=branch(t,uid_subtree);%subtree under GeometryCalib
     119       [s.TranslationMotor,errormsg]=read_subtree(subt,{'Nbslice','ZStart','ZEnd'},[1 1 1],[1 1 1])
     120    end
     121end
    114122%%  geometric calibration
    115123if strcmp(option,'*') || strcmp(option,'GeometryCalib')
     
    200208                end
    201209            end
     210            uid_VolumeScan=find(subt,'/GeometryCalib/VolumeScan');
     211            if ~isempty(uid_VolumeScan)
     212                tsai.VolumeScan=get(subt,children(subt,uid_VolumeScan),'value');
     213            end
    202214            if strcmp(option,'GeometryCalib')
    203215                tsai.PointCoord=get_value(subt,'/GeometryCalib/SourceCalib/PointCoord',[0 0 0 0 0]);
     
    207219    end
    208220end
     221
     222%--------------------------------------------------
     223%  read a subtree
     224% INPUT:
     225% t: xltree
     226% head_element: head elelemnt of the subtree
     227% Data, structure containing
     228%    .Key: element name
     229%    .Type: type of element ('charg', 'float'....)
     230%    .NbOccur: nbre of occurrence, NaN for un specified number
     231function [s,errormsg]=read_subtree(subt,Data,NbOccur,NumTest)
     232%--------------------------------------------------
     233s=[];%default
     234errormsg='';
     235head_element=get(subt,1,'name')
     236    cont=get(subt,1,'contents');
     237    if ~isempty(cont)
     238        for ilist=1:length(Data)
     239            uid_key=find(subt,[head_element '/' Data{ilist}])
     240            if ~isequal(length(uid_key),NbOccur(ilist))
     241                errormsg=['wrong number of occurence for ' Data{ilist}]
     242                return
     243            end
     244            for ival=1:length(uid_key)
     245                val=get(subt,children(subt,uid_key(ival)),'value')
     246                if ~NumTest(ilist)
     247                    eval(['s.' Data{ilist} '=val;']);
     248                else
     249                    eval(['s.' Data{ilist} '=str2double(val);'])
     250                end
     251            end
     252        end
     253    end
     254
    209255
    210256%--------------------------------------------------
  • trunk/src/plot_field.m

    r188 r191  
    5353%
    5454%   PlotParam: parameters for plotting, as read on the uvmat interface (by function 'read_plot_param.m')
    55 %     .FixedLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits
    56 %     .Auto_xy: =0 (default): kepp 1 to 1 aspect ratio for x and y scales, =1: automatic adjustment of the graph
     55%     .FixLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits
     56%     .FixEqual: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales.
    5757%            --scalars--
    5858%    .Scalar.MaxA: upper bound (saturation color) for the scalar representation, max(field) by default
    5959%    .Scalar.MinA: lower bound (saturation) for the scalar representation, min(field) by default
    60 %    .Scalar.AutoScal: =1 (default) lower and upper bounds of the scalar representation set to the min and max of the field
    61 %               =0 lower and upper bound imposed by .AMax and .MinA
     60%    .Scalar.FixScal: =0 (default) lower and upper bounds of the scalar representation set to the min and max of the field
     61%               =1 lower and upper bound imposed by .AMax and .MinA
    6262%    .Scalar.BW= 1 black and white representation imposed, =0 by default.
    6363%    .Scalar.Contours= 1: represent scalars by contour plots (Matlab function 'contour'); =0 by default
     
    6565%            -- vectors--
    6666%    .Vectors.VecScale: scale for the vector representation
    67 %    .Vectors.AutoVec: =0 (default) automatic length for vector representation, =1: length set by .VecScale
     67%    .Vectors.FixVec: =0 (default) automatic length for vector representation, =1: length set by .VecScale
    6868%    .Vectors.HideFalse= 0 (default) false vectors represented in magenta, =1: false vectors not represented;
    6969%    .Vectors.HideWarning= 0 (default) vectors marked by warnflag~=0 marked in black, 1: no warning representation;
     
    177177   
    178178        %% set axes properties
    179     if isfield(PlotParam,'FixedLimits') && isequal(PlotParam.FixedLimits,1)  %adjust the graph limits*
     179    if isfield(PlotParam,'FixLimits') && isequal(PlotParam.FixLimits,1)  %adjust the graph limits*
    180180        set(haxes,'XLimMode', 'manual')
    181181        set(haxes,'YLimMode', 'manual')
     
    184184        set(haxes,'YLimMode', 'auto')
    185185    end
    186     if isfield(PlotParam,'Auto_xy') && isequal(PlotParam.Auto_xy,1)
     186    if ~isfield(PlotParam,'FixEqual')&& isfield(Data,'CoordUnit')
     187        PlotParam.FixEqual=1;
     188    end
     189    if isfield(PlotParam,'FixEqual') && isequal(PlotParam.FixEqual,1)
     190        set(haxes,'DataAspectRatioMode','manual')
     191       set(haxes,'DataAspectRatio',[1 1 1])
     192    else
    187193        set(haxes,'DataAspectRatioMode','auto')%automatic aspect ratio
    188     else
    189         set(haxes,'DataAspectRatioMode','manual')
    190194    end
    191195else
     
    199203errormsg=[];
    200204AxeData=get(haxes,'UserData');
     205if isempty(index_1D)
     206     plot_profile([],[],[],haxes);%
     207else
     208        PlotParamOut=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,PlotParam);%
     209        if testzoomaxes
     210            [zoomaxes,PlotParamOut]=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),zoomaxes,PlotParam);
     211            AxeData.ZoomAxes=zoomaxes;
     212        end
     213        PlotType='line';
     214end
    201215if isempty(index_2D)
    202216    plot_plane([],[],[],haxes);%removes images or vector plots if any
     
    209223            end
    210224end
    211 if isempty(index_1D)
    212      plot_profile([],[],[],haxes);%
    213 else
    214         plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,PlotParam);%
    215         if testzoomaxes
    216             [zoomaxes,PlotParamOut]=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),zoomaxes,PlotParam);
    217             AxeData.ZoomAxes=zoomaxes;
    218         end
    219         PlotType='line';
    220 end
    221225htext=findobj(hfig,'Tag','text_display');
    222226if ~isempty(htext)
     
    230234if ~isempty(errormsg)
    231235    msgbox_uvmat('ERROR', errormsg)
     236end
     237if isfield(PlotParamOut,'MinX')
     238set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX])
     239set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY])
    232240end
    233241
     
    320328
    321329%-------------------------------------------------------------------
    322 function [haxes]=plot_profile(data,CellVarIndex,VarType,haxes,PlotParam)
     330function PlotParamOut=plot_profile(data,CellVarIndex,VarType,haxes,PlotParam)
    323331%-------------------------------------------------------------------
     332PlotParamOut=PlotParam; %default
    324333hfig=get(haxes,'parent');
    325334%suppress existing plot isf empty data
     
    504513    PlotParam.Vectors=[];
    505514end
     515
    506516PlotParamOut=PlotParam;%default
    507517hfig=get(haxes,'parent');
    508518hcol=findobj(hfig,'Tag','Colorbar'); %look for colorbar axes
    509519hima=findobj(haxes,'Tag','ima');% search existing image in the current axes
    510 % AxeData=get(haxes,'UserData'); %default
    511 % if ~isstruct(AxeData)% AxeData must be a structure
    512 %     AxeData=[];
    513 % end
    514 % AxeData.NbDim=2;
    515 % if isfield(Data,'ObjectCoord')
    516 %     AxeData.ObjectCoord=Data.ObjectCoord;
    517 % end
    518520errormsg=[];%default
    519521test_ima=0; %default: test for image or map plot
     
    720722    %case of grey level images or contour plot
    721723    if siz==2
    722         if ~isfield(PlotParam.Scalar,'AutoScal')
    723             PlotParam.Scalar.AutoScal=0;%default
     724        if ~isfield(PlotParam.Scalar,'FixScal')
     725            PlotParam.Scalar.FixScal=0;%default
    724726        end
    725727        if ~isfield(PlotParam.Scalar,'MinA')
     
    729731            PlotParam.Scalar.MaxA=[];%default
    730732        end
    731         if isequal(PlotParam.Scalar.AutoScal,0)||isempty(PlotParam.Scalar.MinA)||~isa(PlotParam.Scalar.MinA,'double')  %correct if there is no numerical data in edit box
     733        if isequal(PlotParam.Scalar.FixScal,0)||isempty(PlotParam.Scalar.MinA)||~isa(PlotParam.Scalar.MinA,'double')  %correct if there is no numerical data in edit box
    732734            MinA=double(min(min(A)));
    733735        else
    734736            MinA=PlotParam.Scalar.MinA; 
    735737        end;
    736         if isequal(PlotParam.Scalar.AutoScal,0)||isempty(PlotParam.Scalar.MaxA)||~isa(PlotParam.Scalar.MaxA,'double') %correct if there is no numerical data in edit box
     738        if isequal(PlotParam.Scalar.FixScal,0)||isempty(PlotParam.Scalar.MaxA)||~isa(PlotParam.Scalar.MaxA,'double') %correct if there is no numerical data in edit box
    737739            MaxA=double(max(max(A)));
    738740        else
     
    10491051    AxeData.RangeX=Xlim;
    10501052    AxeData.RangeY=Ylim;
     1053
    10511054%    adjust the size of the plot to include the whole field, except if PlotParam.FixedLimits=1
    1052     if ~(isfield(PlotParam,'FixedLimits') && PlotParam.FixedLimits) && test_lim
    1053             if Xlim(2)>Xlim(1)
    1054                 set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates
    1055             end
    1056             if Ylim(2)>Ylim(1)
    1057                 set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate
    1058             end
    1059     end
    1060     if ~(isfield(PlotParam,'Auto_xy') && isequal(PlotParam.Auto_xy,1))
    1061          set(haxes,'DataAspectRatio',[1 1 1])
    1062     end
     1055    if ~(isfield(PlotParam,'FixLimits') && PlotParam.FixLimits) && test_lim
     1056        PlotParamOut.MinX=Xlim(1);
     1057        PlotParamOut.MaxX=Xlim(2);
     1058        PlotParamOut.MinY=Ylim(1);
     1059        PlotParamOut.MaxY=Ylim(2);
     1060        if Xlim(2)>Xlim(1)
     1061            set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates
     1062        end
     1063        if Ylim(2)>Ylim(1)
     1064            set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate
     1065        end
     1066    end
     1067
    10631068    set(haxes,'YDir','normal')
    10641069    set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']);
  • trunk/src/read_plot_param.m

    r61 r191  
    1313function PlotParam=read_plot_param(handles)
    1414
    15 PlotParam.Auto_xy=get(handles.auto_xy,'Value');
    16 PlotParam.FixedLimits=get(handles.FixedLimits,'Value');
    17 
     15PlotParam.FixEqual=get(handles.FixEqual,'Value');
     16PlotParam.FixLimits=get(handles.FixLimits,'Value');
     17if PlotParam.FixLimits
     18PlotParam.MinX=str2double(get(handles.MinX,'String'));
     19PlotParam.MaxX=str2double(get(handles.MaxX,'String'));
     20PlotParam.MinY=str2double(get(handles.MinY,'String'));
     21PlotParam.MaxY=str2double(get(handles.MaxY,'String'));
     22end
    1823% scalars
    1924Scalar.MaxA=str2double(get(handles.MaxA,'String'));
    2025Scalar.MinA=str2double(get(handles.MinA,'String'));
    21 Scalar.AutoScal=get(handles.AutoScal,'Value');
     26Scalar.FixScal=get(handles.FixScal,'Value');
    2227Scalar.BW=get(handles.BW,'Value');
    2328Scalar.Contours=get(handles.Contours,'Value')==2;
     
    2732%vectors
    2833Vectors.VecScale=str2double(get(handles.VecScale,'String'));
    29 Vectors.AutoVec=get(handles.AutoVec,'Value');%automatic vector length
     34Vectors.FixVec=get(handles.FixVec,'Value');%automatic vector length
    3035Vectors.HideFalse=get(handles.HideFalse,'Value');
    3136Vectors.HideWarning=get(handles.HideWarning,'Value');
     
    4247Vectors.ColorCode=code_list{val}; % option of color code for vectors
    4348Vectors.FixedCbounds=get(handles.AutoVecColor,'Value');% =1; fixed scale for color vector, =0 otherwise (default)
    44 Vectors.MinC=str2num(get(handles.min_vec,'String')); % imposed min of C, (needed if .FixedCbounds=1)
    45 Vectors.MaxC=str2num(get(handles.max_vec,'String')); % imposed max of C, needed if .FixedCbounds=1
     49Vectors.MinC=str2double(get(handles.min_vec,'String')); % imposed min of C, (needed if .FixedCbounds=1)
     50Vectors.MaxC=str2double(get(handles.max_vec,'String')); % imposed max of C, needed if .FixedCbounds=1
    4651if Vectors.MaxC <= Vectors.MinC
    4752    Vectors.ColorCode='black';
  • trunk/src/update_imadoc.m

    r156 r191  
    88%-------------------------------------------------------------
    99function errormsg=update_imadoc(GeometryCalib,outputfile)
    10 tic
    1110errormsg='';
    1211testappend=0;
     
    6463   [t,uid_calib]=add(t,1,'element','GeometryCalib');
    6564end
     65'TESTupdate'
     66GeometryCalib
    6667t=struct2xml(GeometryCalib,t,uid_calib);
    6768save(t,outputfile);
    68 toc
  • trunk/src/uvmat.m

    r187 r191  
    309309set(handles.transform_fct,'UserData',fct_handle)% store the list of path in UserData of ACTION
    310310set(handles.uvmat,'UserData',UvData)
    311 %initiates menu of vector colors
    312 % list_menu=calc_field;
    313 % %list_menu=[{'ima_cor'};{'black'};{'white'};list_menu(3:end)];
    314 % set(handles.col_vec,'String',list_menu)
     311%set(handles.FixEqual,'Value',1)% by default: axes free to adapt in aspect ratio
     312%set(handles.FixEqual,'BackgroundColor',[1 1 0])
    315313
    316314%check the path and date of modification of all functions in uvmat
     
    352350        testinputfield=1;
    353351    end
    354 %     if ~isempty(Field)
    355 %         menu_str=update_menu(handles.Fields,'get_field...');
    356 % %         set(handles.Fields,'Value',1)
    357 % %         set(handles.Fields,'String',{'get_field...'})   
    358 %         testinputfield=1;
    359 %     elseif ischar(input)
    360 %         scan_i_Callback(handles.scan_i, eventdata, handles);   
    361 %     end
    362352else
    363353   if ishandle(handles.UVMAT_title)
     
    749739    drawnow
    750740    if isfield(XmlData, 'GeometryCalib') && ~isempty(XmlData.GeometryCalib)
     741        XmlData.GeometryCalib
     742        if isfield(XmlData.GeometryCalib,'VolumeScan') && isequal(XmlData.GeometryCalib.VolumeScan,'y')
     743            'TESTvol'
     744            set (handles.nb_slice,'String','volume')
     745        end
    751746        hgeometry_calib=findobj('tag','geometry_calib');
    752747        if ~isempty(hgeometry_calib)
     
    837832            set(handles.pycm,'String',num2str(pixcmy))
    838833        end
    839         if ~get(handles.FixedLimits,'Value')
     834        if ~get(handles.FixLimits,'Value')
    840835            set(handles.transform_fct,'Value',2); % phys transform by default if fixedLimits is off
    841836        end
     
    848843               set(handles.slices,'Value',1)
    849844           end
    850            if isfield(GeometryCalib,'NbSlice') && isequal(GeometryCalib.NbSlice,'volume')
     845           if isfield(GeometryCalib,'VolumeScan') && isequal(GeometryCalib.VolumeScan,'y')
    851846               set(handles.nb_slice,'String','volume')
    852847           else
     
    20982093%update the z position index
    20992094nbslice_str=get(handles.nb_slice,'String');
    2100 if isequal(nbslice_str,'volume')
     2095if isequal(nbslice_str,'volume')%NOT USED
    21012096    z_index=num_j1;
    21022097    set(handles.z_index,'String',num2str(z_index))
     
    25232518    UvData.Object{1}.plotaxes=handles.axes3;%default plotting axis
    25242519end
     2520testnewseries=UvData.NewSeries;
    25252521UvData.NewSeries=0;% put to 0 the test for a new field series (set by RootPath_callback)
    25262522set(handles.uvmat,'UserData',UvData)
     
    25432539haxes(1)=handles.axes3;
    25442540PlotParam{1}=read_plot_param(handles);%read plotting parameters on the uvmat interfac
    2545 keeplim(1)=get(handles.FixedLimits,'Value');% test for fixed graph limits
     2541keeplim(1)=get(handles.FixLimits,'Value');% test for fixed graph limits
    25462542PosColorbar{1}=UvData.OpenParam.PosColorbar;%prescribe the colorbar position on the uvmat interface
    25472543
     
    25642560    iobj=IndexObj(imap);   
    25652561    [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj});% project field on the object
     2562    if testnewseries && isfield(ObjectData,'CoordUnit')
     2563        PlotParam{imap}=rmfield(PlotParam{imap},'FixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field)
     2564    end
    25662565    if ~isempty(errormsg)
    25672566        return
     
    26102609            ObjectData.DimValue(ind_off)=[];
    26112610        end
    2612     end
    2613    
     2611    end   
    26142612    if ~isempty(ObjectData)
    26152613        PlotType='none'; %default
     
    26222620                ObjectData.Mesh=Field.Mesh; % gives an estimated mesh size (useful for mouse action on the plot)
    26232621            end
    2624 %             if imap==1           
    2625 %                 UvData.axes3=ObjectData;
    2626 %             else
    2627 %                 ViewFieldData=get(view_field_handle,'UserData');
    2628 %                 ViewFieldData.axes3=ObjectData;
    2629 %                 set(view_field_handle,'UserData',ViewFieldData)
    2630 %             end
    26312622        end
    26322623        if isequal(PlotType,'none')
     
    26402631    end
    26412632end
    2642 
    26432633
    26442634%% update the mask
     
    27642754
    27652755%-------------------------------------------------------------------
    2766 % --- Executes on button press in 'FixedLimits'.
    2767 %-------------------------------------------------------------------
    2768 function FixedLimits_Callback(hObject, eventdata, handles)
    2769 test=get(handles.FixedLimits,'Value');
     2756% --- Executes on button press in 'FixLimits'.
     2757%-------------------------------------------------------------------
     2758function FixLimits_Callback(hObject, eventdata, handles)
     2759test=get(handles.FixLimits,'Value');
    27702760if test
    2771     set(handles.FixedLimits,'BackgroundColor',[1 1 0])
    2772 else
    2773     set(handles.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
     2761    set(handles.FixLimits,'BackgroundColor',[1 1 0])
     2762else
     2763    set(handles.FixLimits,'BackgroundColor',[0.7 0.7 0.7])
    27742764    update_plot(handles);
    27752765end
    27762766
    27772767%-------------------------------------------------------------------
    2778 % --- Executes on button press in auto_xy.
    2779 function auto_xy_Callback(hObject, eventdata, handles)
    2780 test=get(handles.auto_xy,'Value');
     2768% --- Executes on button press in FixEqual.
     2769function FixEqual_Callback(hObject, eventdata, handles)
     2770test=get(handles.FixEqual,'Value');
    27812771if test
    2782     set(handles.auto_xy,'BackgroundColor',[1 1 0])
     2772    set(handles.FixEqual,'BackgroundColor',[1 1 0])
    27832773    cla(handles.axes3)
    27842774    update_plot(handles);
    27852775else
    2786     set(handles.auto_xy,'BackgroundColor',[0.7 0.7 0.7])
     2776    set(handles.FixEqual,'BackgroundColor',[0.7 0.7 0.7])
    27872777    update_plot(handles);
    27882778%     axis(handles.axes3,'image')
     
    27992789if (get(handles.zoom,'Value') == 1);
    28002790    set(handles.zoom,'BackgroundColor',[1 1 0])
    2801     set(handles.FixedLimits,'Value',1)% propose by default fixed limits for the plotting axes
    2802     set(handles.FixedLimits,'BackgroundColor',[1 1 0])
     2791    set(handles.FixLimits,'Value',1)% propose by default fixed limits for the plotting axes
     2792    set(handles.FixLimits,'BackgroundColor',[1 1 0])
    28032793else
    28042794    set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
     
    31483138setfield(handles);% update the field structure ('civ1'....)
    31493139
    3150 if ~isfield(UvData,'NewSeries')||isequal(UvData.NewSeries,0)
     3140if ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1))
    31513141    run0_Callback(hObject, eventdata, handles)
    31523142end
     
    33533343set(handles.uvmat,'UserData',UvData)
    33543344setfield(handles);% update the field structure ('civ1'....)
    3355 if ~isfield(UvData,'NewSeries')||isequal(UvData.NewSeries,0)
     3345if ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1))
    33563346    run0_Callback(hObject, eventdata, handles)
    33573347end
     
    38833873end
    38843874
    3885 set(handles.FixedLimits,'Value',0)
    3886 set(handles.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
     3875set(handles.FixLimits,'Value',0)
     3876set(handles.FixLimits,'BackgroundColor',[0.7 0.7 0.7])
    38873877
    38883878UvData=get(huvmat,'UserData');
     
    40043994%         set(haxes,'XLimMode','auto')%reset auto mode (after zoom effect)
    40053995%         set(haxes,'YLimMode','auto')
    4006         PlotParam.Auto_xy=1;
    4007         plot_field(Histo,haxes,PlotParam);
    4008     end
    4009 end
    4010 
    4011 
     3996%         PlotParam.Auto_xy=1;
     3997        plot_field(Histo,haxes);
     3998    end
     3999end
    40124000
    40134001%------------------------------------------------
    40144002%CALLBACKS FOR PLOTTING PARAMETERS
    40154003%-------------------------------------------------
     4004%-----------------------------------------------------------------
     4005function MinX_Callback(hObject, eventdata, handles)
     4006%------------------------------------------
     4007set(handles.FixLimits,'Value',1) %suppress auto mode
     4008set(handles.FixLimits,'BackgroundColor',[1 1 0])
     4009update_plot(handles);
     4010
     4011%-----------------------------------------------------------------
     4012function MaxX_Callback(hObject, eventdata, handles)
     4013%------------------------------------------
     4014set(handles.FixLimits,'Value',1) %suppress auto mode
     4015set(handles.FixLimits,'BackgroundColor',[1 1 0])
     4016update_plot(handles);
     4017
     4018%-----------------------------------------------------------------
     4019function MinY_Callback(hObject, eventdata, handles)
     4020%------------------------------------------
     4021set(handles.FixLimits,'Value',1) %suppress auto mode
     4022set(handles.FixLimits,'BackgroundColor',[1 1 0])
     4023update_plot(handles);
     4024
     4025%-----------------------------------------------------------------
     4026function MaxY_Callback(hObject, eventdata, handles)
     4027%------------------------------------------
     4028set(handles.FixLimits,'Value',1) %suppress auto mode
     4029set(handles.FixLimits,'BackgroundColor',[1 1 0])
     4030update_plot(handles);
    40164031
    40174032%-----------------------------------------------------------------
    40184033function MinA_Callback(hObject, eventdata, handles)
    40194034%------------------------------------------
    4020 set(handles.AutoScal,'Value',1) %suppress auto mode
    4021 set(handles.AutoScal,'BackgroundColor',[1 1 0])
     4035set(handles.FixScal,'Value',1) %suppress auto mode
     4036set(handles.FixScal,'BackgroundColor',[1 1 0])
    40224037update_plot(handles);
    40234038
     
    40254040function MaxA_Callback(hObject, eventdata, handles)
    40264041%--------------------------------------------
    4027 set(handles.AutoScal,'Value',1) %suppress auto mode
    4028 set(handles.AutoScal,'BackgroundColor',[1 1 0])
     4042set(handles.FixScal,'Value',1) %suppress auto mode
     4043set(handles.FixScal,'BackgroundColor',[1 1 0])
    40294044update_plot(handles);
    40304045
    40314046%-----------------------------------------------
    4032 function AutoScal_Callback(hObject, eventdata, handles)
     4047function FixScal_Callback(hObject, eventdata, handles)
    40334048%--------------------------------------------
    4034 test=get(handles.AutoScal,'Value');
     4049test=get(handles.FixScal,'Value');
    40354050if test
    4036     set(handles.AutoScal,'BackgroundColor',[1 1 0])
    4037 else
    4038     set(handles.AutoScal,'BackgroundColor',[0.7 0.7 0.7])
     4051    set(handles.FixScal,'BackgroundColor',[1 1 0])
     4052else
     4053    set(handles.FixScal,'BackgroundColor',[0.7 0.7 0.7])
    40394054    update_plot(handles);
    40404055end
     
    40764091function VecScale_Callback(hObject, eventdata, handles)
    40774092%-------------------------------------------------------------------
    4078 set(handles.AutoVec,'Value',1);
    4079 set(handles.AutoVec,'BackgroundColor',[1 1 0])
     4093set(handles.FixVec,'Value',1);
     4094set(handles.FixVec,'BackgroundColor',[1 1 0])
    40804095update_plot(handles);
    40814096
    40824097%-------------------------------------------------------------------
    4083 function AutoVec_Callback(hObject, eventdata, handles)
    4084 %-------------------------------------------------------------------
    4085 test=get(handles.AutoVec,'Value');
     4098function FixVec_Callback(hObject, eventdata, handles)
     4099%-------------------------------------------------------------------
     4100test=get(handles.FixVec,'Value');
    40864101if test
    4087     set(handles.AutoVec,'BackgroundColor',[1 1 0])
     4102    set(handles.FixVec,'BackgroundColor',[1 1 0])
    40884103else
    40894104    update_plot(handles);
    40904105    %set(handles.VecScale,'String',num2str(ScalOut.VecScale,3))
    4091     set(handles.AutoVec,'BackgroundColor',[0.7 0.7 0.7])
     4106    set(handles.FixVec,'BackgroundColor',[0.7 0.7 0.7])
    40924107end
    40934108
     
    41874202AxeData=UvData.axes3;
    41884203PlotParam=read_plot_param(handles);
     4204PlotParam.Scalar
    41894205[PP,PlotParamOut]= plot_field(AxeData,haxes,PlotParam);
    41904206write_plot_param(handles,PlotParamOut); %update the auto plot parameters
     
    43084324    PlotHandles=guidata(hview_field);
    43094325end
    4310 % if ~isempty(ProjData)
    4311 'TEST'
    4312 ProjData
    4313     plot_field(ProjData,PlotHandles.axes3,PlotHandles);
    4314 % end
     4326plot_field(ProjData,PlotHandles.axes3,PlotHandles);
    43154327set(handles.uvmat,'UserData',UvData)
    43164328hother=findobj('Tag','proj_object');%find all the proj objects
     
    49824994    delete_object(IndexObj)
    49834995end
    4984    
    4985 
    4986 
    4987 
    4988 
     4996
     4997
  • trunk/src/write_plot_param.m

    r128 r191  
    11%'write_plot_param': update the plotting parameters on the uvmat interface after a plotting operation
    22function write_plot_param(handles,PlotParam)
     3
     4%coordinates
     5if isfield(PlotParam,'FixEqual')
     6    if PlotParam.FixEqual
     7        set(handles.FixEqual,'Value',1)
     8        set(handles.FixEqual,'BackgroundColor',[1 1 0])
     9    else
     10        set(handles.FixEqual,'Value',0)
     11        set(handles.FixEqual,'BackgroundColor',[0.7 0.7 0.7])
     12    end
     13end
     14set(handles.MinX,'String',num2str(PlotParam.MinX,4));
     15set(handles.MaxX,'String',num2str(PlotParam.MaxX,4));
     16set(handles.MinY,'String',num2str(PlotParam.MinY,4));
     17set(handles.MaxY,'String',num2str(PlotParam.MaxY,4));
    318
    419%scalar or image parameters
     
    7085set(handles.MinA,'Visible',state)
    7186%set(handles.IncrA,'Visible',state)
    72 set(handles.AutoScal,'Visible',state)
     87set(handles.FixScal,'Visible',state)
    7388set(handles.BW,'Visible',state)
    7489set(handles.Contours,'Visible',state)
     
    89104% set(handles.VECT_title,'Visible',state)
    90105set(handles.VecScale,'Visible',state)
    91 set(handles.AutoVec,'Visible',state)
     106set(handles.FixVec,'Visible',state)
    92107set(handles.HideFalse,'Visible',state)
    93108set(handles.HideWarning,'Visible',state)
Note: See TracChangeset for help on using the changeset viewer.