Changeset 191 for trunk/src/uvmat.m


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.