Changeset 61


Ignore:
Timestamp:
Mar 24, 2010, 12:51:51 AM (14 years ago)
Author:
sommeria
Message:

gestion of projection objects improved. Implementation of view_field.fig
introduction of a circle to mark vectors with the mouse
various cleaning and debugging

Location:
trunk/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r60 r61  
    4343% Edit the above text to modify the response to help geometry_calib
    4444
    45 % Last Modified by GUIDE v2.5 23-Mar-2010 06:22:33
     45% Last Modified by GUIDE v2.5 23-Mar-2010 16:19:01
    4646
    4747% Begin initialization code - DO NOT edit
     
    148148%case of calibration (ImaDoc) input file
    149149% hcalib=get(handles.calib_type,'parent');
    150 CalibData=get(handles.figure1,'UserData');
     150CalibData=get(handles.geometry_calib,'UserData');
    151151CalibData.XmlInput=fileinput;
    152152if isfield(s,'Heading')
     
    154154end
    155155
    156 set(handles.figure1,'UserData',CalibData);%store the heading in the interface 'UserData'
     156set(handles.geometry_calib,'UserData',CalibData);%store the heading in the interface 'UserData'
    157157if isfield(s,'GeometryCalib')
    158158    Calib=s.GeometryCalib;
     
    312312    delete(h_dataview)
    313313end
    314 CalibData=get(handles.figure1,'UserData');%read the calibration image source on the interface userdata
     314CalibData=get(handles.geometry_calib,'UserData');%read the calibration image source on the interface userdata
    315315
    316316if isfield(CalibData,'XmlInput')
     
    791791    set(hh,'YData',ObjectData.Coord(:,2))
    792792end
     793pause(.1)
     794figure(handles.geometry_calib)
    793795
    794796% --------------------------------------------------------------------
     
    807809%------------------------------------------------------------------------
    808810%hcalib=get(handles.calib_type,'parent');%handles of the GUI geometry_calib
    809 CalibData=get(handles.figure1,'UserData');
     811CalibData=get(handles.geometry_calib,'UserData');
    810812Tinput=[];%default
    811813if isfield(CalibData,'grid')
     
    813815end
    814816[T,CalibData.grid]=create_grid(grid_input);%display the GUI create_grid
    815 set(handles.figure1,'UserData',CalibData)
     817set(handles.geometry_calib,'UserData',CalibData)
    816818
    817819%grid in phys space
     
    844846%-----------------------------------------------------------------------
    845847%hcalib=get(handles.calib_type,'parent');%handles of the GUI geometry_calib
    846 CalibData=get(handles.figure1,'UserData');
     848CalibData=get(handles.geometry_calib,'UserData');
    847849Tinput=[];%default
    848850if isfield(CalibData,'translate')
     
    851853T=translate_points(Tinput);%display translate_points GUI and get shift parameters
    852854CalibData.translate=T;
    853 set(handles.figure1,'UserData',CalibData)
     855set(handles.geometry_calib,'UserData',CalibData)
    854856%translation
    855857Coord_cell=get(handles.ListCoord,'String');
     
    872874function MenuRotatePoints_Callback(hObject, eventdata, handles)
    873875%hcalib=get(handles.calib_type,'parent');%handles of the GUI geometry_calib
    874 CalibData=get(handles.figure1,'UserData');
     876CalibData=get(handles.geometry_calib,'UserData');
    875877Tinput=[];%default
    876878if isfield(CalibData,'rotate')
     
    879881T=rotate_points(Tinput);%display translate_points GUI and get shift parameters
    880882CalibData.rotate=T;
    881 set(handles.figure1,'UserData',CalibData)
     883set(handles.geometry_calib,'UserData',CalibData)
    882884%-----------------------------------------------------
    883885%rotation
     
    915917function MenuDetectGrid_Callback(hObject, eventdata, handles)
    916918
    917 CalibData=get(handles.figure1,'UserData');
     919CalibData=get(handles.geometry_calib,'UserData');
    918920grid_input=[];%default
    919921if isfield(CalibData,'grid')
     
    921923end
    922924[T,CalibData.grid]=create_grid(grid_input);%display the GUI create_grid
    923 set(handles.figure1,'UserData',CalibData)%store the phys grid for later use
     925set(handles.geometry_calib,'UserData',CalibData)%store the phys grid for later use
    924926
    925927%read the four last point coordiantes in pixels
     
    978980    [Amax,ind_x_max]=max(x_profile);
    979981    [Amax,ind_y_max]=max(y_profile);
    980     Delta(ipoint,1)=(ind_x_max-ind_range-1)*Dx;%shift from the initial guess
    981     Delta(ipoint,2)=(ind_y_max-ind_range-1)*Dy;
     982    %sub-pixel improvement using moments
     983    x_shift=0;
     984    y_shift=0;
     985    if ind_x_max+2<=2*ind_range+1 && ind_x_max-2>=1
     986        Atop=x_profile(ind_x_max-2:ind_x_max+2);
     987        x_shift=sum(Atop.*[-2 -1 0 1 2])/sum(Atop);
     988    end
     989    if ind_y_max+2<=2*ind_range+1 && ind_y_max-2>=1
     990        Atop=y_profile(ind_y_max-2:ind_y_max+2);
     991        y_shift=sum(Atop.*[-2 -1 0 1 2]')/sum(Atop);
     992    end
     993    Delta(ipoint,1)=(x_shift+ind_x_max-ind_range-1)*Dx;%shift from the initial guess
     994    Delta(ipoint,2)=(y_shift+ind_y_max-ind_range-1)*Dy;
    982995end
    983996Tmod=T(:,(1:2))+Delta;
  • trunk/src/get_plot_handles.m

    r40 r61  
    1111function PlotHandles=get_plot_handles(handles)
    1212PlotHandles.auto_xy=handles.auto_xy;
     13PlotHandles.FixedLimits=handles.FixedLimits;
    1314%For scalar field representation
    1415PlotHandles.MaxA=handles.MaxA;
     
    6263% PlotHandles.PLANE=handles.PLANE;
    6364% PlotHandles.PATCH=handles.PATCH;
    64 PlotHandles.cal=handles.cal;
     65%PlotHandles.cal=handles.cal;
    6566%PlotHandles.makemask=handles.makemask;
    6667PlotHandles.edit=handles.edit;
  • trunk/src/imadoc2struct.m

    r60 r61  
    6464    end
    6565    s.Heading.ImageName=get(t,children(t,uid_FirstImage),'value');
    66 %     FirstImage=s.Heading.ImageName;
    67 %     if ~isempty(FirstImage)
    68 %         [Pathsub,RootFile,field_count,str2,str_a,str_b,ext,nom_type_ima]=name2display(FirstImage);
    69 %     end
    7066end
    7167
     
    7874        xindex=findstr(ImageSize,'x');
    7975        if length(xindex)>=2
    80 %             npx=str2num(ImageSize(1:xindex(1)-1));
    81 %             npy=str2num(ImageSize(xindex(1)+1:xindex(2)-1));
    82         end
    83     end
    84 %     uid_NbSlice=find(t,'/ImaDoc/Camera/NbSlice');
    85 %     if ~isempty(uid_NbSlice)
    86 %         NbSlice=str2num(get(t,children(t,uid_NbSlice),'value'));
    87 % %         if isempty(NbSlice),NbSlice=1;end; %default
    88 %     end
     76             npx=str2double(ImageSize(1:xindex(1)-1));
     77             npy=str2double(ImageSize(xindex(1)+1:xindex(2)-1));
     78        end
     79    end
    8980    uid_TimeUnit=find(t,'/ImaDoc/Camera/TimeUnit');
    9081    if ~isempty(uid_TimeUnit)
     
    9485    if ~isempty(uid_BurstTiming)
    9586        for k=1:length(uid_BurstTiming)
    96 %             Dtj=[];%default
    97 %             NbDtj=1;%default
    9887            subt=branch(t,uid_BurstTiming(k));%subtree under BurstTiming
    9988             % reading Dtk
  • trunk/src/mouse_down.m

    r60 r61  
    162162                end
    163163                IndexObj=ObjectData.IndexObj;
    164                 hlist_object=findobj(huvmat,'Tag','list_object');
    165                 set(hlist_object,'Value',IndexObj);
     164                set(hhuvmat.list_object_1,'Value',IndexObj);
     165                set(hhuvmat.list_object_2,'Value',IndexObj);
    166166                testdeform=0;
    167167                set(gcbo,'Pointer','circle');
     
    205205            UvData.Object{IndexObj}.HandlesDisplay(1)=AxeData.CurrentObject;
    206206            set(huvmat,'UserData',UvData)
    207             list_str=get(hhuvmat.list_object,'String');
     207            list_str=get(hhuvmat.list_object_1,'String');
    208208            list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Style];
    209209            if ~isequal(list_str{end},'...')
    210210                 list_str{end+1}='...';
    211211            end
    212             set(hhuvmat.list_object,'String',list_str)
    213             set(hhuvmat.list_object,'Value',IndexObj)
     212            set(hhuvmat.list_object_1,'String',list_str)
     213            set(hhuvmat.list_object_1,'Value',IndexObj)
     214            set(hhuvmat.list_object_2,'String',list_str)
     215            set(hhuvmat.list_object_2,'Value',IndexObj)
    214216            PlotData=get(AxeData.CurrentObject,'UserData');
    215217            PlotData.IndexObj=IndexObj;
     
    295297        UvData.RulerCoord(1,1)=xy(1,1);
    296298        UvData.RulerCoord(1,2)=xy(1,2);
    297         UvData.RulerHandle=line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','proj_object');
     299        UvData.RulerHandle=line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','ruler');
    298300        set(huvmat,'UserData',UvData)
    299301    end
  • trunk/src/mouse_motion.m

    r60 r61  
    3939test_create=0;%default
    4040test_edit=0;%default
    41 if isfield(handles,'VOLUME') % mouse_motion not applied to the uvmat figure, no object creation
    42     test_create=get(handles.create,'Value');   
    43 end
     41% if isfield(handles,'VOLUME') % mouse_motion not applied to the uvmat figure, no object creation
     42%     test_create=get(handles.create,'Value');   
     43% end
    4444test_edit=isfield(handles,'edit') & get(handles.edit,'Value');% edit test for mouse shap: an arrow
    4545test_zoom=isfield(handles,'zoom')& get(handles.zoom,'Value');% edit test for mouse shap: an arrow
     
    9292                        if ~test_create
    9393                            pointershape='arrow'; %mouse indicates  the detection of a vector
     94                            hhh=findobj(haxes,'Tag','vector_marker');
     95                            if isempty(hhh)
     96                                line(AxeData.X(ivec),AxeData.Y(ivec),'Color','m','Tag','vector_marker','LineStyle','.','Marker','o','MarkerSize',AxeData.Mesh);
     97                            else
     98                                set(hhh,'XData',AxeData.X(ivec))
     99                                set(hhh,'YData',AxeData.Y(ivec))
     100                            end
    94101                        end
    95102                        ivec=ivec(1);%choice the first selected vector if several are selected
     
    194201%%%%%%%%%%%%%%%%%
    195202%create or modify an object
    196 if isfield(AxeData,'CurrentObject') & ishandle(AxeData.CurrentObject) & isfield(AxeData,'Drawing') & ~isequal(AxeData.Drawing,'off')
     203huvmat=findobj(allchild(0),'Name','uvmat');%find the uvmat interface handle
     204if ~isempty(huvmat)
     205    UvData=get(huvmat,'UserData');
     206end
     207if ~isempty(huvmat) & isfield(AxeData,'CurrentObject') & ishandle(AxeData.CurrentObject) & isfield(AxeData,'Drawing') & ~isequal(AxeData.Drawing,'off')
    197208    PlotData=get(AxeData.CurrentObject,'UserData');
    198209    huvmat=findobj(allchild(0),'Name','uvmat');%find the uvmat interface handle
     
    268279
    269280%draw ruler
    270 UvData=get(handles.uvmat,'UserData');
    271 if isfield(UvData,'MouseAction') && isequal(UvData.MouseAction,'ruler')
    272        if isfield(UvData,'RulerHandle')
    273             RulerCoord=[UvData.RulerCoord ;xy(1,1:2)];
    274             set(UvData.RulerHandle,'XData',RulerCoord(:,1));
    275             set(UvData.RulerHandle,'YData',RulerCoord(:,2));
    276        end
     281if ~isempty(huvmat)
     282    UvData=get(huvmat,'UserData');
     283    if isfield(UvData,'MouseAction') && isequal(UvData.MouseAction,'ruler')
     284           if isfield(UvData,'RulerHandle')
     285                RulerCoord=[UvData.RulerCoord ;xy(1,1:2)];
     286                set(UvData.RulerHandle,'XData',RulerCoord(:,1));
     287                set(UvData.RulerHandle,'YData',RulerCoord(:,2));
     288           end
     289    end
    277290end
    278291set(currentfig,'Pointer',pointershape);
  • trunk/src/mouse_up.m

    r60 r61  
    133133                write_plot_param(PlotHandles,UvData.Object{IndexObj}.PlotParam); %update the display of plotting parameters for the current object
    134134            end             
    135             set(hhuvmat.create,'Value',0);% set to 'off' the button for object creation
    136             set(hhuvmat.create,'BackgroundColor',[0 1 0]);% paint the creation button in green
     135%             set(hhuvmat.create,'Value',0);% set to 'off' the button for object creation
     136%             set(hhuvmat.create,'BackgroundColor',[0 1 0]);% paint the creation button in green
    137137            set(hhuvmat.edit,'BackgroundColor',[1 1 0]);% paint the edit text in yellow
    138138            set(hhuvmat.edit,'Value',1);%
     
    166166                    delete(AxeData.CurrentVec)
    167167                end
    168                 %update the axes UvData.Plane2 if it exists, else create it
    169 %                 if isfield (UvData,'Plane2') & ishandle(UvData.Plane2.Fig)%if the second plan plotting axis already exists
    170 %                     hfig2=UvData.Plane2.Fig;
    171 %                     if isequal(gcf,hfig2)%if we are already on the secondary figure
    172 %                         test_replot=1;
    173 %                     else
    174 %                         figure(hfig2)%set hfig2 as the current figure
    175 %                         clf; %erase axes
    176 %                     end
    177 %                 else
    178                     hfig2=figure;%create new figure
    179                     set(hfig2,'name','zoom')
    180                     set(hfig2,'Units','normalized')
    181                     set(hfig2,'Position',[0.2 0.33 0.6 0.6]);
    182 %                     UvData.Plane2.Fig=hfig2;
    183                     map=colormap(currentaxes);
    184                     colormap(map);%transmit the current colormap to the zoom fig
    185                     get(handles.RootFile,'String')
    186 %                 end
     168                hfig2=figure;%create new figure
     169                set(hfig2,'name','zoom')
     170                set(hfig2,'Units','normalized')
     171                set(hfig2,'Position',[0.2 0.33 0.6 0.6]);
     172                map=colormap(currentaxes);
     173                colormap(map);%transmit the current colormap to the zoom fig
     174                get(handles.RootFile,'String')
    187175                set(hfig2,'Position',[0.2 0.33 0.6 0.6]);
    188176                if test_replot==0
     
    219207                        ChildAxeData.ParentRect=AxeData.CurrentRectZoom;%set the rectangle as a 'parent' associated to the new axes
    220208                        set(AxeData.ZoomAxes,'UserData',ChildAxeData);%update the AxeData of the new axes
    221                        % UvData.TopFig=hfig2;%put the new fig to the top of the stack for uvmat
    222         %                 set(huvmat,'UserData',UvData)
    223209                        set(AxeData.ZoomAxes,'Xlim',[PosRect(1) PosRect(1)+PosRect(3)])
    224210                        set(AxeData.ZoomAxes,'Ylim',[PosRect(2) PosRect(2)+PosRect(4)])
     
    277263if isequal(MouseAction,'ruler')
    278264    UvData.MouseAction='none';
    279     UvData=rmfield(UvData,'RulerHandle')
     265    UvData=rmfield(UvData,'RulerHandle');
    280266     xy=get(currentaxes,'CurrentPoint');
    281     RulerCoord=[UvData.RulerCoord ;xy(1,1:2)]
     267    RulerCoord=[UvData.RulerCoord ;xy(1,1:2)];
    282268    set(huvmat,'UserData',UvData)
    283     RulerCoord=diff(RulerCoord,1)
     269    RulerCoord=diff(RulerCoord,1);
    284270    RulerCoord=RulerCoord(1)+i*RulerCoord(2);
    285     distance=abs(RulerCoord)
    286     azimuth=(180/pi)*angle(RulerCoord)
     271    distance=abs(RulerCoord);
     272    azimuth=(180/pi)*angle(RulerCoord);
    287273    msgbox_uvmat('RULER','',['length: ' num2str(distance,3) ',  angle(degrees): ' num2str(azimuth,3)])
     274    hruler=findobj(currentaxes,'Tag','ruler');
     275    delete(hruler)
    288276end
    289277
  • trunk/src/plot_field.m

    r55 r61  
    121121    if ishandle(haxes)
    122122        if isequal(get(haxes,'Type'),'axes')
    123 %             hfig=get(haxes,'Parent');
    124123            axes(haxes)
    125124            testnewfig=0;
     
    204203    msgbox_uvmat('ERROR','volume plot not implemented yet')
    205204    return
    206     %plot_volume(haxes,Data,PlotParam)% A FAIRE
    207     %PlotType='volume';
    208205else
    209206    testnbdim=0;
     
    309306function [AxeData,haxes]=plot_profile(data,CellVarIndex,VarType,haxes,PlotParam)
    310307%-----------------------------------------------------------
    311 axes(haxes)
     308%axes(haxes)
    312309hfig=get(haxes,'parent');
    313310AxeData=data;
     
    316313if isfield(PlotParam,'NextPlot')
    317314    set(haxes,'NextPlot',PlotParam.NextPlot)
     315end
     316% adjust the size of the plot to include the whole field, except if KeepLim=1
     317if isfield(PlotParam,'FixedLimits') && isequal(PlotParam.FixedLimits,1)  %adjust the graph limits*
     318    set(haxes,'XLimMode', 'manual')
     319    set(haxes,'YLimMode', 'manual')
     320else
     321    set(haxes,'XLimMode', 'auto')
     322    set(haxes,'YLimMode', 'auto')
    318323end
    319324legend_str={};
     
    372377          charplot_0='''-''';
    373378    end
    374 %     if testcoordvar==0
    375 %         coord_x{icell}=[1:data.DimValue(DimIndices(1))];%abscissa by default if no coordinate variable
    376 %        % charplot_0='''-''';
    377 %     end
    378379    if isfield(data,'VarAttribute')
    379380        VarAttribute=data.VarAttribute;
     
    415416if ~isequal(plotstr,'plot(')
    416417    plotstr(end)=')';
    417                 %execute plot (instruction  plotstr)
     418                %execute plot (instruction  plotstr)   
    418419    eval(plotstr)
    419420                %%%%%
  • trunk/src/read_plot_param.m

    r19 r61  
    1414
    1515PlotParam.Auto_xy=get(handles.auto_xy,'Value');
     16PlotParam.FixedLimits=get(handles.FixedLimits,'Value');
    1617
    1718% scalars
  • trunk/src/set_object.m

    r55 r61  
    709709if ~isempty(huvmat)
    710710    hhuvmat=guidata(huvmat);
    711     set(hhuvmat.create,'Value',0)
    712     set(hhuvmat.create,'BackgroundColor',[0 1 0])%put unactivated buttons to green
     711%     set(hhuvmat.create,'Value',0)
     712%     set(hhuvmat.create,'BackgroundColor',[0 1 0])%put unactivated buttons to green
    713713%     set(hhuvmat.LINE,'Value',0)
    714714%     set(hhuvmat.LINE,'BackgroundColor',[0 1 0])%put unactivated buttons to green
     
    733733function PLOT_Callback(hObject, eventdata, handles)
    734734
    735 hsetobject=get(handles.PLOT,'parent');
    736 SetData=get(hsetobject,'UserData');%get the hidden interface data
     735SetData=get(handles.set_object,'UserData');%get the hidden interface data
    737736huvmat=findobj('Name','uvmat');%find the current uvmat interface handle
    738 hlist_object=findobj(huvmat,'Tag','list_object');%handles of the object list in the GUI uvmat
     737hlist_object=findobj(huvmat,'Tag','list_object_1');%handles of the object list in the GUI uvmat
    739738IndexObj=get(hlist_object,'Value');%position in the objet list
    740739UvData=get(huvmat,'UserData');%Data associated to the GUI uvmat
     
    767766UvData.Object{IndexObj}=update_obj(UvData,IndexObj,ObjectData,SetData.PlotHandles);
    768767
     768
    769769set(huvmat,'UserData',UvData)%update the data in the uvmat interface
    770770list_str=get(hlist_object,'String');
     
    772772% list_str{IndexObj}=[num2str(IndexObj) '-' TITLE];
    773773list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Style];
    774 if isequal(length(list_str),IndexObj)
    775     list_str{IndexObj+1}='more...';
    776 end
    777 set(hlist_object,'String',list_str)
    778 set(hlist_object,'Value',IndexObj)
     774% if isequal(length(list_str),IndexObj)
     775%     list_str{IndexObj+1}='more...';
     776% end
     777set(hlist_object_1,'String',list_str)
     778set(hlist_object_1,'Value',IndexObj)
    779779
    780780%update create buttons on the GUI uvmat: set to object edit mode after object plotting
     
    782782%desactivate all create buttons in mode edit
    783783% if isequal(get(hhuvmat.edit,'Value'),0)
    784     set(hhuvmat.create,'Value',0)
    785     set(hhuvmat.create,'BackgroundColor',[0 1 0])%put unactivated buttons to green
     784%     set(hhuvmat.create,'Value',0)
     785%     set(hhuvmat.create,'BackgroundColor',[0 1 0])%put unactivated buttons to green
    786786%     set(hhuvmat.LINE,'Value',0)
    787787%     set(hhuvmat.LINE,'BackgroundColor',[0 1 0])%put unactivated buttons to green
  • trunk/src/update_obj.m

    r60 r61  
    5454      end
    5555end
    56 
    5756% plot the field projected on the object
    5857if ~isempty(PlotHandles) %&& ~testmask
     
    6665             [plotaxes]=view_field(ProjData);
    6766        end
    68        
    6967%         [PlotType,Object_out.PlotParam,plotaxes]=plot_field(ProjData,plotaxes,PlotHandles);
    7068        Object_out.plotaxes=plotaxes;
  • trunk/src/uvmat.m

    r60 r61  
    246246if ~isfield(UvData.Object{1},'plotaxes')
    247247    UvData.Object{1}.plotaxes=handles.axes3;%default plotting axis
    248     set(handles.list_object,'String',{'1-PLANE'});
    249     set(handles.list_object,'Value',1);
     248    set(handles.list_object_1,'String',{'1-PLANE'});
     249    set(handles.list_object_1,'Value',1);
    250250end
    251251
     
    379379        set(handles.OBJECT_txt,'Visible','on')
    380380        set(handles.edit,'Visible','on')
    381         set(handles.list_object,'Visible','on')
     381        set(handles.list_object_1,'Visible','on')
    382382        set(handles.frame_object,'Visible','on')
    383383    else
     
    598598        set(handles.OBJECT_txt,'Visible','on')
    599599        set(handles.edit,'Visible','on')
    600         set(handles.list_object,'Visible','on')
     600        set(handles.list_object_1,'Visible','on')
    601601        set(handles.frame_object,'Visible','on')
    602602         % initiate input file:
     
    647647drawnow
    648648set(handles.Fields,'UserData',[])% reinialize data from uvmat opening
    649 %huvmat=get(handles.RootPath,'parent');
    650649UvData=get(handles.uvmat,'UserData');%huvmat=handles of the uvmat interface
    651650UvData.NewSeries=1; %flag for run0: begin a new series
     
    920919function MenuBrowse_1_Callback(hObject, eventdata, handles)
    921920%-------------------------------------------------------------------
    922 huvmat=get(handles.run0,'parent');
    923 UvData=get(huvmat,'UserData');
     921% huvmat=get(handles.run0,'parent');
     922UvData=get(handles.uvmat,'UserData');
    924923
    925924RootPath=get(handles.RootPath,'String');
     
    11421141set(handles.RootPath_1,'BackgroundColor',[1 1 0])% indicate active program by yellow color
    11431142drawnow
    1144 huvmat=get(handles.RootPath,'parent');
    1145 UvData=get(huvmat,'UserData');%huvmat=handles of the uvmat interface
     1143%huvmat=get(handles.RootPath,'parent');
     1144UvData=get(handles.uvmat,'UserData');%huvmat=handles of the uvmat interface
    11461145UvData.NewSeries=1; %flag for run0: begin a new series
    11471146
     
    12791278end
    12801279UvData.XmlData_1=XmlData;
    1281 set(huvmat,'UserData',UvData)%update the data attached to the uvmat interface
     1280set(handles.uvmat,'UserData',UvData)%update the data attached to the uvmat interface
    12821281
    12831282if ~isequal(warntext,'')
     
    14761475    end
    14771476    set(handles.mask_test,'UserData',[])   
    1478     huvmat=get(handles.mask_test,'parent');
    1479     UvData=get(huvmat,'UserData');
     1477    %huvmat=get(handles.mask_test,'parent');
     1478    UvData=get(handles.uvmat,'UserData');
    14801479    if isfield(UvData,'MaskName')
    14811480        UvData=rmfield(UvData,'MaskName');
    1482         set(huvmat,'UserData',UvData)
     1481        set(handles.uvmat,'UserData',UvData)
    14831482    end
    14841483    set(handles.mask_test,'BackgroundColor',[0.7 0.7 0.7])
     
    24552454if ~isfield(UvData.Object{1},'plotaxes')
    24562455    UvData.Object{1}.plotaxes=handles.axes3;%default plotting axis
    2457     set(handles.list_object,'String',{'1-PLANE'});
    2458     set(handles.list_object,'Value',1);
     2456    set(handles.list_object_1,'String',{'1-PLANE'});
     2457    set(handles.list_object_1,'Value',1);
    24592458end
    24602459
     
    24722471    ZBounds(2)=UvData.ZMax;%maximum for the Z slider
    24732472    set_object(UvData.Object{1},PlotHandles,ZBounds);
    2474     set(handles.list_object,'Value',1);
     2473    set(handles.list_object_1,'Value',1);
    24752474%multilevel case (single menuplane in a 3D space)
    24762475elseif isfield(UvData,'Z')
     
    24992498    set(handles.MaxA,'String','255')
    25002499end
    2501 IndexObj=get(handles.list_object,'Value');
     2500IndexObj=get(handles.list_object_1,'Value');
    25022501Object=UvData.Object;
    25032502IndexObj=min(IndexObj,numel(Object));
     
    34123411%     set(handles.edit,'Value',0)
    34133412%     set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    3414 %     list_object=get(handles.list_object,'String');
    3415 %     if ~isempty(list_object)
    3416 %         set(handles.list_object,'Value',length(list_object))
     3413%     list_object_1=get(handles.list_object_1,'String');
     3414%     if ~isempty(list_object_1)
     3415%         set(handles.list_object_1,'Value',length(list_object_1))
    34173416%     end
    34183417%     MouseAction='create_object';
     
    34713470%     end
    34723471%     %set(hset_object,'Position',[pos_uvmat(1) pos_uvmat(2)-0.05*pos_uvmat(4) 0.2*pos_uvmat(3)  0.5*pos_uvmat(4)]);
    3473 %     list_object=get(handles.list_object,'String');
    3474 %     if ~isempty(list_object)
    3475 %         set(handles.list_object,'Value',length(list_object))
     3472%     list_object_1=get(handles.list_object_1,'String');
     3473%     if ~isempty(list_object_1)
     3474%         set(handles.list_object_1,'Value',length(list_object_1))
    34763475%     end
    34773476%     MouseAction='create_object';
     
    35033502% set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    35043503% set(handles.edit,'Value',0)
    3505 % set(handles.list_object,'Value',1);
     3504% set(handles.list_object_1,'Value',1);
    35063505% edit_vect_Callback(hObject, eventdata, handles)
    35073506% set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
     
    35413540%     set(hset_object,'Position',pos_set_object)
    35423541% end
    3543 % list_object=get(handles.list_object,'String');
    3544 % if ~isempty(list_object)
    3545 %     set(handles.list_object,'Value',length(list_object))
     3542% list_object_1=get(handles.list_object_1,'String');
     3543% if ~isempty(list_object_1)
     3544%     set(handles.list_object_1,'Value',length(list_object_1))
    35463545% end
    35473546% MouseAction='create_object';
     
    36063605%         set(hset_object,'Position',pos_set_object)
    36073606%     end
    3608 %     list_object=get(handles.list_object,'String');
    3609 %     if ~isempty(list_object)
    3610 %         set(handles.list_object,'Value',length(list_object))
     3607%     list_object_1=get(handles.list_object_1,'String');
     3608%     if ~isempty(list_object_1)
     3609%         set(handles.list_object_1,'Value',length(list_object_1))
    36113610%     end
    36123611%     UvData.MouseAction='create_object';
     
    36773676% set(hset_object,'Position',pos_set_object)
    36783677% end
    3679 % list_object=get(handles.list_object,'String');
    3680 % nbobject=length(list_object);
    3681 % set(handles.list_object,'Value',nbobject)
     3678% list_object_1=get(handles.list_object_1,'String');
     3679% nbobject=length(list_object_1);
     3680% set(handles.list_object_1,'Value',nbobject)
    36823681% UvData.MouseAction='create_object';
    36833682% set(huvmat,'UserData',UvData)
     
    36913690    delete(handles.UVMAT_title)
    36923691end
    3693 huvmat=get(handles.create,'parent');
    3694 UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface
     3692UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    36953693if isequal(get(handles.VOLUME,'Value'),1)
    36963694    set(handles.zoom,'Value',0)
     
    37003698    set(handles.edit,'Value',0)
    37013699    set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    3702     set(handles.cal,'Value',0)
    3703     set(handles.cal,'BackgroundColor',[0 1 0])
     3700%     set(handles.cal,'Value',0)
     3701%     set(handles.cal,'BackgroundColor',[0 1 0])
    37043702    set(handles.edit_vect,'Value',0)
    37053703    edit_vect_Callback(hObject, eventdata, handles)
     
    37533751    set(handles.edit_vect,'BackgroundColor',[1 1 0])
    37543752    set(handles.edit,'Value',0)
    3755     set(handles.create,'Value',0)
    3756     set(handles.create,'BackgroundColor',[0 1 0])
     3753    set(handles.zoom,'Value',0)
     3754    set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
     3755%     set(handles.create,'Value',0)
     3756%     set(handles.create,'BackgroundColor',[0 1 0])
    37573757    set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    37583758    set(gcf,'Pointer','arrow')
     
    40204020function cal_Callback(hObject, eventdata, handles)
    40214021
    4022 huvmat=get(handles.cal,'parent');%handles of the uvmat interface
    4023 UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface
    4024 %reinitialize the edit interface associated with uvmat
    4025 value=get(handles.cal,'Value');
    4026 if value
    4027         set(handles.cal,'BackgroundColor',[1 1 0])
    4028         %suppress the other options if MENULINE is chosen
    4029         set(handles.zoom,'Value',0)
    4030         set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
    4031         set(handles.create,'Value',0)
    4032         set(handles.create,'BackgroundColor',[0 1 0])
    4033         set(handles.create,'enable','off')     
    4034         set(handles.edit_vect,'Value',0)
    4035         set(handles.edit_vect,'enable','off')
    4036         edit_vect_Callback(hObject, eventdata, handles)
    4037         set(handles.edit,'Value',0)
    4038         set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    4039         set(handles.edit,'enable','off')
    4040         set(handles.list_object,'Value',1)     
    4041         % initiate display of GUI geometry_calib
    4042         data=[]; %default
    4043                 if isfield(UvData,'CoordType')
    4044             data.CoordType=UvData.CoordType;
    4045         end
    4046         %data.ParentButton=handles.cal; % transmit the handles of the calling button to the GUI geometry_calib
    4047                 pos=get(huvmat,'Position');
    4048                 pos(1)=pos(1)+pos(3)-0.311+0.04; %0.311= width of the geometry_calib interface (units relative to the srcreen)
    4049                 pos(2)=pos(2)-0.02;
    4050         [FileName,RootPath,FileBase,FileIndices,FileExt,SubDir]=read_file_boxes(handles);
    4051 %         [filebase,num_i1,num_j1,num_i2,num_j2,Ext,NomType,SubDir]=read_input_file(handles);
    4052 %         [inputfile,idetect]=name_generator(filebase,num_i1,num_j1,Ext,NomType,1,num_i2,num_j2,SubDir);
    4053                 [UvData.hset_object,UvData.sethandles]=geometry_calib(handles,pos,FileName);% call the set_object interface     
    4054         pos_uvmat=get(huvmat,'Position');
    4055         %pos_cal(1:2)=UvData.CalOrigin + pos_uvmat(1:2);
    4056         if isfield(UvData,'CalOrigin')
    4057             pos_cal(1)=pos_uvmat(1)+UvData.CalOrigin(1)*pos_uvmat(3);
    4058             pos_cal(2)=pos_uvmat(2)+UvData.CalOrigin(2)*pos_uvmat(4);
    4059             pos_cal(3:4)=UvData.CalSize .* pos_uvmat(3:4);
    4060             set(UvData.hset_object,'Position',pos_cal)
    4061         end
    4062         UvData.MouseAction='calib';
    4063 else
    4064      UvData.MouseAction='none';     
    4065      hgeometry_calib=findobj(allchild(0),'Name','geometry_calib');
    4066 %      if ~isempty(hgeometry_calib)
    4067 %          answer=questdlg('close the GUI geometry-calib?');
    4068 %          if isequal(answer,'Yes')
    4069 %              delete(hgeometry_calib)
    4070 %              set(handles.cal,'BackgroundColor',[0 1 0])
    4071 %          else
    4072 %              set(handles.cal,'Value',1)% keep the calibration function active
    4073 %          end
    4074 %      end
    4075      set(handles.edit_vect,'enable','on')
    4076      set(handles.edit,'enable','on')
    4077      set(handles.create,'enable','on')
    4078 %      set(handles.LINE,'enable','on')
    4079 %      set(handles.PATCH,'enable','on')
    4080 %      set(handles.PLANE,'enable','on')
    4081 %      set(handles.VOLUME,'enable','on')
    4082      %set(handles.makemask,'enable','on')
    4083      hh=findobj(handles.axes3,'Tag','calib_points');
    4084      if ~isempty(hh)
    4085          delete(hh)
    4086      end
    4087      hhh=findobj(handles.axes3,'Tag','calib_marker');
    4088      if ~isempty(hhh)
    4089          delete(hhh)
    4090      end   
    4091 end
    4092 set(huvmat,'UserData',UvData);
     4022
    40934023
    40944024%-------------------------------------------------------------
     
    44664396function grid_Callback(hObject, eventdata, handles)
    44674397%-------------------------------------------------------------------
    4468 huvmat=get(handles.create,'parent');
    4469 UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface
     4398
     4399UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    44704400
    44714401%suppress the other options if grid is chosen
    4472 set(handles.create,'Value',0)
    4473 set(handles.create,'BackgroundColor',[0 1 0])
     4402% set(handles.create,'Value',0)
     4403% set(handles.create,'BackgroundColor',[0 1 0])
    44744404set(handles.edit_vect,'Value',0)
    44754405edit_vect_Callback(hObject, eventdata, handles)
     
    44784408edit_vect_Callback(hObject, eventdata, handles)
    44794409set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    4480 set(handles.list_object,'Value',1)     
     4410set(handles.list_object_1,'Value',1)     
    44814411set(handles.cal,'Value',0)
    44824412set(handles.cal,'BackgroundColor',[0 1 0])   
     
    44934423function edit_Callback(hObject, eventdata, handles)
    44944424%-------------------------------------------------------------------
    4495 huvmat=get(handles.list_object,'parent');
    4496 UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface
     4425UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    44974426test=get(handles.edit,'Value');
    44984427if test
     
    45024431    set(handles.zoom,'Value',0)
    45034432    zoom_Callback(hObject, eventdata, handles)
    4504     set(handles.create,'Value',0)
    4505     set(handles.create,'BackgroundColor',[0 1 0])
    4506 %     set(handles.LINE,'Value',0)
    4507 %     set(handles.LINE,'BackgroundColor',[0 1 0])
    4508 %     set(handles.PATCH,'Value',0)
    4509 %     set(handles.PATCH,'BackgroundColor',[0 1 0])
    4510 %     set(handles.PLANE,'Value',0)
    4511 %     set(handles.PLANE,'BackgroundColor',[0 1 0])%put activated buttons to yellow
    4512 %     set(handles.VOLUME,'Value',0)
    4513 %     set(handles.VOLUME,'BackgroundColor',[0 1 0])
    45144433    set(handles.edit_vect,'Value',0)
    45154434    edit_vect_Callback(hObject, eventdata, handles) 
    4516     set(handles.cal,'Value',0)
    4517     set(handles.cal,'BackgroundColor',[0 1 0])   
    4518     %set(handles.grid,'Value',0)
    4519     %set(handles.grid,'BackgroundColor',[0 1 0])
    4520     list_object_Callback(hObject, eventdata, handles)
     4435    %list_object_Callback(hObject, eventdata, handles)
    45214436else
    45224437    UvData.MouseAction='none';
    45234438    set(handles.edit,'BackgroundColor',[0.7,0.7,0.7])   
    45244439end
    4525 set(huvmat,'UserData',UvData);
    4526 
    4527 %--------------------------------------------------------
    4528 % --- Executes on selection change in list_object.
    4529 %--------------------------------------------------------
    4530 function list_object_Callback(hObject, eventdata, handles)
     4440set(handles.uvmat,'UserData',UvData);
     4441hset_object=findobj(allchild(0),'Tag','set_object');
     4442if ~isempty(hset_object)
     4443    hhset_object=guidata(hset_object);
     4444    if test
     4445        set(hhset_object.PLOT,'Visible','on');
     4446    else
     4447       set(hhset_object.PLOT,'Visible','off');
     4448    end
     4449end
     4450
     4451%------------------------------------------------------------------------
     4452% --- Executes on selection change in list_object_1.
     4453function list_object_1_Callback(hObject, eventdata, handles)
     4454%------------------------------------------------------------------------
     4455list_str=get(handles.list_object_1,'String');
     4456IndexObj=get(handles.list_object_1,'Value');
     4457str_1=list_str{IndexObj};
     4458set(handles.list_object_1,'BackgroundColor',[1 1 0])
     4459set(handles.list_object_2,'BackgroundColor',[1 1 1])
     4460val_2=get(handles.list_object_2,'Value');
     4461str_2=get(handles.list_object_2,'String');
     4462if isequal(val_2,IndexObj)
     4463    set(handles.list_object_2,'Value',numel(str_2))
     4464    list_object_2_Callback(hObject, eventdata, handles)
     4465end
     4466hset_object=findobj(allchild(0),'Tag','set_object');
     4467if ~isempty(hset_object)
     4468     set(hset_object,'name',str_1);
     4469end
     4470update_object(handles,IndexObj,1)
     4471
     4472%------------------------------------------------------------------------
     4473% --- Executes on selection change in list_object_1.
     4474function list_object_2_Callback(hObject, eventdata, handles)
     4475%------------------------------------------------------------------------
     4476list_str=get(handles.list_object_2,'String');
     4477IndexObj=get(handles.list_object_2,'Value');
     4478if isequal(list_str{IndexObj},'...')
     4479    hview_field=findobj(allchild(0),'Tag','view_field')
     4480    if ~isempty(hview_field)
     4481        delete(hview_field)
     4482    end
     4483    set(handles.list_object_2,'BackgroundColor',[1 1 1])
     4484else
     4485    hset_object=findobj(allchild(0),'Tag','set_object');
     4486    if ~isempty(hset_object)
     4487        set(hset_object,'name',list_str{IndexObj});
     4488    end
     4489    set(handles.list_object_2,'BackgroundColor',[1 1 0])
     4490    set(handles.list_object_1,'BackgroundColor',[1 1 1])
     4491    update_object(handles,IndexObj,2)
     4492end
     4493
     4494%------------------------------------------------------------------------
     4495function update_object(handles,IndexObj,option)
     4496%------------------------------------------------------------------------
    45314497UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    4532 list_str=get(handles.list_object,'String');
    4533 IndexObj=get(handles.list_object,'Value');
    4534 
    45354498if ~(length(UvData.Object)>=IndexObj);
    45364499    return
    45374500end
    45384501ObjectData=UvData.Object{IndexObj};
    4539 ObjectData.desable_open=1; % desable the OPEN option in the set_object GUI (editing mode)
    45404502if isequal(get(handles.edit,'Value'),0)
    45414503    ObjectData.desable_plot=1; % desable the PLOT option in the set_object GUI (editing mode
     
    45474509        ZBounds(2)=UvData.ZMax;%maximum for the Z slider
    45484510    end
    4549 AxeData.hset_object=set_object(ObjectData,PlotHandles,ZBounds);% call the set_object interface,
     4511hset_object=findobj(allchild(0),'Name','set_object');
     4512if ~isempty(hset_object)
     4513    delete(hset_object)% delete existing version of set_object
     4514end
     4515hset_object=set_object(ObjectData,PlotHandles,ZBounds);% call the set_object interface,
    45504516pos_uvmat=get(handles.uvmat,'Position');
     4517%position the set_object GUI with respect to uvmat
    45514518if isfield(UvData,'SetObjectOrigin')
    4552 pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);
    4553 pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);
    4554 set(AxeData.hset_object,'Position',pos_set_object)
     4519    pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);
     4520    pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);
     4521    set(hset_object,'Position',pos_set_object)
    45554522end
    45564523
    45574524%project the current field on the object and plot it
    45584525ProjData= proj_field(UvData.Field,ObjectData,IndexObj);%project the current interface field on ObjectData
    4559 if length(UvData.Object)>= IndexObj && isfield(UvData.Object{IndexObj},'plotaxes')&& ishandle(UvData.Object{IndexObj}.plotaxes)
    4560     plot_field(ProjData,UvData.Object{IndexObj}.plotaxes,PlotHandles);
    4561 else
    4562      UvData.Object{IndexObj}.plotaxes=view_field(ProjData);
    4563      set(handles.uvmat,'UserData',UvData)
     4526if option==1%length(UvData.Object)>= IndexObj && isfield(UvData.Object{IndexObj},'plotaxes')&& ishandle(UvData.Object{IndexObj}.plotaxes)
     4527    plot_field(ProjData,handles.axes3,PlotHandles);
     4528    UvData.Object{IndexObj}.plotaxes=handles.axes3;
     4529else
     4530    UvData.Object{IndexObj}.plotaxes=view_field(ProjData);
    45644531end
    45654532
     
    46174584    end
    46184585end
     4586pause(0.1)
     4587figure(hset_object)%put set_object in front
    46194588
    46204589%------------------------------------------------------
     
    47584727% ------------------------------------------------------------------
    47594728function MenuCalib_Callback(hObject, eventdata, handles)
    4760 set(handles.TOOLS_txt,'Visible','on')
    4761 set(handles.frame_tools,'Visible','on')
    4762 set(handles.cal,'Visible','on')
    4763 set(handles.cal,'Value',1)
    4764 cal_Callback(hObject,eventdata,handles)
     4729% set(handles.TOOLS_txt,'Visible','on')
     4730% set(handles.frame_tools,'Visible','on')
     4731UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
     4732%reinitialize the edit interface associated with uvmat
     4733%suppress the other options if MENULINE is chosen
     4734set(handles.zoom,'Value',0)
     4735set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
     4736%         set(handles.create,'Value',0)
     4737%         set(handles.create,'BackgroundColor',[0 1 0])
     4738%         set(handles.create,'enable','off')     
     4739set(handles.edit_vect,'Value',0)
     4740set(handles.edit_vect,'enable','off')
     4741edit_vect_Callback(hObject, eventdata, handles)
     4742set(handles.edit,'Value',0)
     4743set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
     4744set(handles.edit,'enable','off')
     4745set(handles.list_object_1,'Value',1)     
     4746% initiate display of GUI geometry_calib
     4747data=[]; %default
     4748if isfield(UvData,'CoordType')
     4749    data.CoordType=UvData.CoordType;
     4750end
     4751pos=get(handles.uvmat,'Position');
     4752pos(1)=pos(1)+pos(3)-0.311+0.04; %0.311= width of the geometry_calib interface (units relative to the srcreen)
     4753pos(2)=pos(2)-0.02;
     4754[FileName,RootPath,FileBase,FileIndices,FileExt,SubDir]=read_file_boxes(handles);
     4755[UvData.hset_object,UvData.sethandles]=geometry_calib(handles,pos,FileName);% call the set_object interface     
     4756pos_uvmat=get(handles.uvmat,'Position');
     4757%pos_cal(1:2)=UvData.CalOrigin + pos_uvmat(1:2);
     4758if isfield(UvData,'CalOrigin')
     4759    pos_cal(1)=pos_uvmat(1)+UvData.CalOrigin(1)*pos_uvmat(3);
     4760    pos_cal(2)=pos_uvmat(2)+UvData.CalOrigin(2)*pos_uvmat(4);
     4761    pos_cal(3:4)=UvData.CalSize .* pos_uvmat(3:4);
     4762    set(UvData.hset_object,'Position',pos_cal)
     4763end
     4764UvData.MouseAction='calib';
     4765set(handles.uvmat,'UserData',UvData);
     4766
    47654767
    47664768% ------------------------------------------------------------------
     
    47684770set(handles.TOOLS_txt,'Visible','on')
    47694771set(handles.frame_tools,'Visible','on')
    4770 set(handles.create,'Visible','on')
    4771 set(handles.create,'Value',1)
    4772 set(handles.create,'BackgroundColor',[1 1 0]) %visualise in yellow
     4772% set(handles.create,'Visible','on')
     4773% set(handles.create,'Value',1)
     4774% set(handles.create,'BackgroundColor',[1 1 0]) %visualise in yellow
    47734775set(handles.save_mask,'Visible','on')
    47744776set(handles.masklevel,'Visible','on')
     
    47904792    delete(handles.UVMAT_title)
    47914793end
    4792 huvmat=get(handles.create,'parent');
    4793 UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface
     4794% huvmat=get(handles.create,'parent');
     4795UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    47944796set(handles.zoom,'Value',0)
    47954797set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
     
    48004802set(handles.edit_vect,'Value',0) 
    48014803edit_vect_Callback(hObject, eventdata, handles)
    4802 set(handles.cal,'Value',0)
    4803 set(handles.cal,'BackgroundColor',[0 1 0])
     4804% set(handles.cal,'Value',0)
     4805% set(handles.cal,'BackgroundColor',[0 1 0])
    48044806
    48054807%initiate the GUI set_object
     
    48204822PlotHandles=get_plot_handles(handles);%get the handles of the graphic objects setting the plotting parameters
    48214823[hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface
    4822 pos_uvmat=get(huvmat,'Position');
     4824pos_uvmat=get(handles.huvmat,'Position');
    48234825if isfield(UvData,'SetObjectOrigin')
    48244826    pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);
     
    48264828    set(hset_object,'Position',pos_set_object)
    48274829end
    4828 list_object=get(handles.list_object,'String');
     4830list_object=get(handles.list_object_1,'String');
    48294831if ~isempty(list_object)
    4830     set(handles.list_object,'Value',length(list_object))
     4832    set(handles.list_object_1,'Value',length(list_object))
    48314833end
    48324834UvData.MouseAction='create_object';
    4833 set(huvmat,'UserData',UvData);
     4835set(handles.uvmat,'UserData',UvData);
    48344836
    48354837% ------------------------------------------------------------------
     
    50085010% ------------------------------------------------------------------
    50095011function Menuvolume_Callback(hObject, eventdata, handles)
    5010 set(handles.create,'Visible','on')
    5011 set(handles.create,'Value',1)
     5012% set(handles.create,'Visible','on')
     5013% set(handles.create,'Value',1)
    50125014VOLUME_Callback(hObject,eventdata,handles)
    50135015
     
    50395041end
    50405042[hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface
     5043%position the set_object GUI with respect to uvmat
     5044pos_uvmat=get(handles.uvmat,'Position');
     5045if isfield(UvData,'SetObjectOrigin')
     5046    pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);
     5047    pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);
     5048    set(hset_object,'Position',pos_set_object)
     5049end
     5050set(handles.edit,'Value',0); %suppress the object edit mode
     5051set(handles.edit,'BackgroundColor',[0.7,0.7,0.7]) 
    50415052UvData.MouseAction='create_object';
    50425053set(handles.uvmat,'UserData',UvData)
     
    50505061end
    50515062UvData=get(handles.uvmat,'UserData');
     5063set(handles.edit,'Value',0); %suppress the object edit mode
     5064set(handles.edit,'BackgroundColor',[0.7,0.7,0.7]) 
    50525065if isfield(UvData,'CoordType')
    50535066    data.CoordType=UvData.CoordType;
     
    50805093PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters
    50815094[hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface
     5095
     5096pos_uvmat=get(handles.uvmat,'Position');
     5097%position the set_object GUI with respect to uvmat
     5098if isfield(UvData,'SetObjectOrigin')
     5099    pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);
     5100    pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);
     5101    set(hset_object,'Position',pos_set_object)
     5102end
     5103
    50825104UvData.MouseAction='create_object';
    50835105set(handles.uvmat,'UserData',UvData)
     
    50955117set(handles.uvmat,'UserData',UvData);
    50965118
    5097 
  • trunk/src/view_field.m

    r60 r61  
    7070% set the position of colorbar and ancillary GUIs:
    7171set(hObject,'Units','Normalized')
    72 movegui(hObject,'center')
    73 UvData.PosColorbar=[0.805 0.022 0.019 0.445];
    74 UvData.SetObjectOrigin=[-0.05 -0.03]; %position for set_object
    75 UvData.SetObjectSize=[0.3 0.7];
    76 UvData.CalOrigin=[0.95 -0.03];%position for geometry_calib (TO IMPROVE)
    77 UvData.CalSize=[0.28 1];
    7872handles_mouse=handles;
    7973huvmat=findobj(allchild(0),'Name','uvmat');
    8074hhuvmat=guidata(huvmat);
    81 handles_mouse.create=hhuvmat.create;
     75set(hhuvmat.list_object_2,'Visible','on')
     76% handles_mouse.create=hhuvmat.create;
    8277handles_mouse.edit=hhuvmat.edit;
     78pos_uvmat=get(huvmat,'Position');
     79pos_view_field(1)=pos_uvmat(1)+pos_uvmat(3)/2;
     80pos_view_field(2)=pos_uvmat(2)-pos_uvmat(3)/4;
     81pos_view_field(3:4)=pos_uvmat(3:4);
     82set(hObject,'Position',pos_view_field)
     83
     84
    8385
    8486%functions for the mouse and keyboard
     
    8789set(hObject,'WindowButtonDownFcn',{'mouse_down'})%set mouse click action function
    8890set(hObject,'WindowButtonUpFcn',{'mouse_up',handles_mouse})
    89 
     91% set(hObject,'CloseRequestFcn ',{'close_fcn'})
    9092
    9193[PlotType,PlotParamOut,haxes]= plot_field(Field,handles.axes3)%,PlotParam,KeepLim,PosColorbar)
     
    9496function varargout = view_field_OutputFcn(hObject, eventdata, handles)
    9597varargout{1} = handles.output;% the only output argument is the handle to the GUI figure
     98
    9699
    97100%-------------------------------------------------------------------
     
    19881991end
    19891992
    1990 %------------------------------------------------
    1991 function create_Callback(hObject,eventdata,handles)
    1992 %------------------------------------------------
    1993 if ishandle(handles.VIEW_FIELD_title)
    1994     delete(handles.VIEW_FIELD_title)
    1995 end
    1996 huvmat=get(handles.create,'parent');
    1997 UvData=get(huvmat,'UserData');%read UvData properties stored on the view_field interface (handles huvmat)
    1998 if isequal(get(handles.create,'Value'),1)
    1999     set(handles.zoom,'Value',0)
    2000     zoom_Callback(hObject, eventdata, handles)
    2001      set(handles.create,'BackgroundColor',[1 1 0]) %visualise in yellow
    2002     set(handles.edit_vect,'Value',0) 
    2003     edit_vect_Callback(hObject, eventdata, handles)
    2004     set(handles.edit,'Value',0)
    2005     set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    2006     list_object=get(handles.list_object,'String');
    2007     if ~isempty(list_object)
    2008         set(handles.list_object,'Value',length(list_object))
    2009     end
    2010     MouseAction='create_object';
    2011     hset_object=findobj(allchild(0),'Name','set_object');
    2012     uistack(hset_object,'top')
    2013 else
    2014     set(handles.create,'BackgroundColor',[0 1 0])
    2015     set(handles.edit,'Value',1)
    2016     set(handles.edit,'BackgroundColor',[1 1 0])
    2017     MouseAction='none';
    2018 end
    2019 
    2020 UvData.MouseAction=MouseAction;
    2021 set(huvmat,'UserData',UvData);
    2022 
    2023 %------------------------------------------------
    2024 function POINTS_Callback(hObject,eventdata,handles)
    2025 %------------------------------------------------
    2026 if ishandle(handles.VIEW_FIELD_title)
    2027     delete(handles.VIEW_FIELD_title)
    2028 end
    2029 huvmat=get(handles.create,'parent');
    2030 UvData=get(huvmat,'UserData');%read UvData properties stored on the view_field interface (handles huvmat)
    2031 if isequal(get(handles.create,'Value'),1)
    2032     set(handles.zoom,'Value',0)
    2033     zoom_Callback(hObject, eventdata, handles)
    2034     set(handles.edit_vect,'Value',0) 
    2035     edit_vect_Callback(hObject, eventdata, handles)
    2036     set(handles.edit,'Value',0)
    2037     set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    2038     %set(handles.grid,'Value',0)
    2039     %set(handles.grid,'BackgroundColor',[0 1 0])
    2040     % initiate set_object GUI
    2041      data.TITLE='POINTS';
    2042     if isfield(UvData,'CoordType')
    2043         data.CoordType=UvData.CoordType;
    2044     end
    2045     if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)
    2046         data.RangeY=UvData.Mesh;
    2047     elseif isfield(UvData,'AX')&isfield(UvData,'AY')& isfield(UvData,'A')%only image
    2048         np=size(UvData.Field.A);
    2049         meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/np(2);
    2050         meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/np(1);
    2051         data.RangeY=max(meshx,meshy);
    2052         data.DX=max(meshx,meshy);
    2053     end
    2054     data.Coord=[0 0 0]; %default
    2055     data.ParentButton=handles.create;
    2056     PlotHandles=get_plot_handles(handles);%get the handles of the graphic objects setting the plotting parameters
    2057     [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface
    2058     if isfield(UvData,'SetObjectOrigin')
    2059     pos_view_field=get(huvmat,'Position');
    2060     pos_set_object(1:2)=UvData.SetObjectOrigin + pos_view_field(1:2);
    2061     pos_set_object(3:4)=UvData.SetObjectSize .* pos_view_field(3:4);
    2062     set(hset_object,'Position',pos_set_object)
    2063     end
    2064     %set(hset_object,'Position',[pos_view_field(1) pos_view_field(2)-0.05*pos_view_field(4) 0.2*pos_view_field(3)  0.5*pos_view_field(4)]);
    2065     list_object=get(handles.list_object,'String');
    2066     if ~isempty(list_object)
    2067         set(handles.list_object,'Value',length(list_object))
    2068     end
    2069     MouseAction='create_object';
    2070     %UvData.ZoomOn=0;
    2071 else
    2072     set(handles.create,'BackgroundColor',[0 1 0])
    2073     set(handles.edit,'Value',1)
    2074     set(handles.edit,'BackgroundColor',[1 1 0])
    2075     MouseAction='none';
    2076 end
    2077 
    2078 UvData.MouseAction=MouseAction;
    2079 set(huvmat,'UserData',UvData);
    2080 
    2081 %-----------------------------------------------------------
    2082 function LINE_Callback(hObject, eventdata, handles)
    2083 %-------------------------------------------------
    2084 if ishandle(handles.VIEW_FIELD_title)
    2085     delete(handles.VIEW_FIELD_title)
    2086 end
    2087 % handles.view_field
    2088 huvmat=get(handles.create,'parent');
    2089 UvData=get(huvmat,'UserData');%read UvData properties stored on the view_field interface
    2090 set(handles.zoom,'Value',0)
    2091 zoom_Callback(hObject, eventdata, handles)
    2092 set(handles.edit_vect,'BackgroundColor',[0.7 0.7 0.7])
    2093 set(handles.edit_vect,'Value',0)
    2094 edit_vect_Callback(hObject, eventdata, handles)
    2095 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    2096 set(handles.edit,'Value',0)
    2097 set(handles.list_object,'Value',1);
    2098 edit_vect_Callback(hObject, eventdata, handles)
    2099 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    2100 set(handles.cal,'Value',0)
    2101 set(handles.cal,'BackgroundColor',[0 1 0])
    2102 %  initiate the set_object GUI
    2103 data.TITLE='LINE';
    2104 if isfield(UvData,'CoordType')
    2105     data.CoordType=UvData.CoordType;
    2106 end
    2107 if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)
    2108     data.RangeX=UvData.Mesh;
    2109     data.RangeY=UvData.Mesh;
    2110     data.DX=UvData.Mesh;
    2111     data.DY=UvData.Mesh;
    2112 elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image
    2113     np=size(UvData.Field.A);
    2114     meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/np(2);
    2115     meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/np(1);
    2116     data.RangeY=max(meshx,meshy);
    2117     data.RangeX=max(meshx,meshy);
    2118     data.DX=max(meshx,meshy);
    2119 end
    2120 if isfield(data,'DX')
    2121     data.Coord=[[0 0 0];[data.DX 0 0]]; %default
    2122 else
    2123     data.Coord=[[0 0 0];[1 0 0]]; %default
    2124 end
    2125 data.ParentButton=handles.create;
    2126 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters
    2127 [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface with action on haxes,
    2128                                                   % associate the set_edit interface handle to the plotting axes
    2129 pos_view_field=get(huvmat,'Position');
    2130 if isfield(UvData,'SetObjectOrigin')
    2131     pos_set_object(1:2)=UvData.SetObjectOrigin + pos_view_field(1:2);
    2132     pos_set_object(3:4)=UvData.SetObjectSize .* pos_view_field(3:4); 
    2133     set(hset_object,'Position',pos_set_object)
    2134 end
    2135 list_object=get(handles.list_object,'String');
    2136 if ~isempty(list_object)
    2137     set(handles.list_object,'Value',length(list_object))
    2138 end
    2139 MouseAction='create_object';
    2140 UvData.MouseAction=MouseAction;
    2141 set(huvmat,'UserData',UvData)
    2142 
    2143 %-----------------------------------------------------------
    2144 function PATCH_Callback(hObject, eventdata, handles)
    2145 %-----------------------------------------------------------
    2146 if ishandle(handles.VIEW_FIELD_title)
    2147     delete(handles.VIEW_FIELD_title)
    2148 end
    2149 huvmat=get(handles.create,'parent');
    2150 UvData=get(huvmat,'UserData');%read UvData properties stored on the view_field interface
    2151 % if isequal(get(handles.PATCH,'Value'),1)
    2152     set(handles.zoom,'Value',0)
    2153     set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
    2154 %     set(handles.create,'Value',0)%suppress the other options if LINE is chosen
    2155 %     set(handles.create,'BackgroundColor',[0 1 0])
    2156 %     set(handles.LINE,'Value',0)
    2157 %     set(handles.LINE,'BackgroundColor',[0 1 0])
    2158 %     set(handles.PATCH,'Value',1)
    2159 %     set(handles.PATCH,'BackgroundColor',[1 1 0])
    2160 %     set(handles.PLANE,'Value',0)
    2161 %     set(handles.PLANE,'BackgroundColor',[0 1 0])%put activated buttons to yellow
    2162 %     set(handles.VOLUME,'Value',0)
    2163 %     set(handles.VOLUME,'BackgroundColor',[0 1 0])
    2164     %set(handles.makemask,'Value',0)
    2165     %makemask_Callback(hObject, eventdata, handles)
    2166     set(handles.edit_vect,'Value',0)
    2167     edit_vect_Callback(hObject, eventdata, handles)
    2168     set(handles.edit,'Value',0)
    2169     set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    2170     set(handles.edit_vect,'Value',0) 
    2171     edit_vect_Callback(hObject, eventdata, handles)
    2172     set(handles.cal,'Value',0)
    2173     set(handles.cal,'BackgroundColor',[0 1 0])
    2174     %set(handles.grid,'Value',0)
    2175     %set(handles.grid,'BackgroundColor',[0 1 0])
    2176     %initiate set_object GUI
    2177     data.TITLE='PATCH';
    2178     if isfield(UvData,'CoordType')
    2179         data.CoordType=UvData.CoordType;
    2180     end
    2181     if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)
    2182         data.YMax=UvData.Mesh;
    2183     elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image
    2184         np=size(UvData.Field.A);
    2185         meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/(np(2)-1);
    2186         meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/(np(1)-1);
    2187         data.YMax=max(meshx,meshy);
    2188         data.DX=max(meshx,meshy);
    2189     end
    2190     data.Coord=[0 0 0]; %default
    2191     data.ParentButton=handles.create;
    2192     PlotHandles=get_plot_handles(handles);%get the handles of the graphic objects setting the plotting parameters
    2193     [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface
    2194     pos_view_field=get(huvmat,'Position');
    2195     if isfield(UvData,'SetObjectOrigin')
    2196         pos_set_object(1:2)=UvData.SetObjectOrigin + pos_view_field(1:2);
    2197         pos_set_object(3:4)=UvData.SetObjectSize .* pos_view_field(3:4);
    2198         set(hset_object,'Position',pos_set_object)
    2199     end
    2200     list_object=get(handles.list_object,'String');
    2201     if ~isempty(list_object)
    2202         set(handles.list_object,'Value',length(list_object))
    2203     end
    2204     UvData.MouseAction='create_object';
    2205     set(huvmat,'UserData',UvData);
    2206 %-------------------------------------------------------
    2207 function PLANE_Callback(hObject, eventdata, handles)
    2208 %-------------------------------------------------------
    2209 if ishandle(handles.VIEW_FIELD_title)
    2210     delete(handles.VIEW_FIELD_title)
    2211 end
    2212 huvmat=get(handles.create,'parent');
    2213 UvData=get(huvmat,'UserData');%read UvData properties stored on the view_field interface
    2214 set(handles.zoom,'Value',0)
    2215 set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
    2216 set(handles.edit_vect,'Value',0)
    2217 edit_vect_Callback(hObject, eventdata, handles)
    2218 set(handles.edit,'Value',0)
    2219 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    2220 set(handles.cal,'Value',0)
    2221 set(handles.cal,'BackgroundColor',[0 1 0])
    2222 %set(handles.grid,'Value',0)
    2223 %set(handles.grid,'BackgroundColor',[0 1 0])
    2224 %initiate set_object GUI
    2225 data.TITLE='PLANE';
    2226 if isfield(UvData,'CoordType')
    2227     data.CoordType=UvData.CoordType;
    2228 end
    2229 %Si 3D data.nbdim=3;
    2230 %Si 2D
    2231 if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)
    2232     data.ZMax=UvData.Mesh;
    2233     data.DX=UvData.Mesh;
    2234     data.DY=UvData.Mesh;
    2235 elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image
    2236     np=size(UvData.Field.A);
    2237     meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/(np(2)-1);
    2238     meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/(np(1)-1);
    2239     data.DX=max(meshx,meshy);
    2240 end
    2241 if isfield(UvData,'DX')
    2242     data.DX=UvData.DX;
    2243 end
    2244 if isfield(UvData,'DY')
    2245     data.DY=UvData.DY;
    2246 elseif isfield(UvData,'Mesh')
    2247     data.DY=UvData.Mesh;
    2248 end
    2249 if isfield(UvData.Field,'X')& isfield(UvData.Field,'Y')
    2250     data.Coord=[0 0 0];
    2251     data.Style='plane';
    2252     data.Phi=0;
    2253     data.IndexObj=1; %act on the first reference plane by default
    2254     haxes= handles.axes3;%GENERALISER
    2255     plot_object(data,[],haxes,'m'); %plot the axes of the default plane 
    2256 end
    2257 data.ParentButton=handles.create;
    2258 PlotHandles=get_plot_handles(handles);%get the handles of the graphic objects setting the plotting parameters
    2259 ZBounds=0; % default
    2260 if isfield(UvData,'ZMin') && isfield(UvData,'ZMax')
    2261     ZBounds(1)=UvData.ZMin; %minimum for the Z slider
    2262     ZBounds(2)=UvData.ZMax;%maximum for the Z slider
    2263 end
    2264 [hset_object,UvData.sethandles]=set_object(data,PlotHandles,ZBounds);% call the set_object interface with action on haxes,
    2265 if isfield(UvData,'SetObjectOrigin')
    2266 pos_view_field=get(huvmat,'Position');
    2267 pos_set_object(1:2)=UvData.SetObjectOrigin + pos_view_field(1:2);
    2268 pos_set_object(3:4)=UvData.SetObjectSize .* pos_view_field(3:4); 
    2269 set(hset_object,'Position',pos_set_object)
    2270 end
    2271 list_object=get(handles.list_object,'String');
    2272 nbobject=length(list_object);
    2273 set(handles.list_object,'Value',nbobject)
    2274 UvData.MouseAction='create_object';
    2275 set(huvmat,'UserData',UvData)
    2276 
    2277 %-------------------------------------------------------
    2278 % --- Executes on button press in MENUVOLUME.
    2279 %-------------------------------------------------------
    2280 function VOLUME_Callback(hObject, eventdata, handles)
    2281 %errordlg('command VOL not implemented yet')
    2282 if ishandle(handles.VIEW_FIELD_title)
    2283     delete(handles.VIEW_FIELD_title)
    2284 end
    2285 huvmat=get(handles.create,'parent');
    2286 UvData=get(huvmat,'UserData');%read UvData properties stored on the view_field interface
    2287 if isequal(get(handles.VOLUME,'Value'),1)
    2288     set(handles.zoom,'Value',0)
    2289     set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
    2290     set(handles.edit_vect,'Value',0)
    2291     edit_vect_Callback(hObject, eventdata, handles)
    2292     set(handles.edit,'Value',0)
    2293     set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    2294     set(handles.cal,'Value',0)
    2295     set(handles.cal,'BackgroundColor',[0 1 0])
    2296     set(handles.edit_vect,'Value',0)
    2297     edit_vect_Callback(hObject, eventdata, handles)
    2298     %initiate set_object GUI
    2299     data.TITLE='VOLUME';
    2300     if isfield(UvData,'CoordType')
    2301         data.CoordType=UvData.CoordType;
    2302     end
    2303     if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)
    2304         data.RangeY=UvData.Mesh;
    2305         data.RangeX=UvData.Mesh;
    2306         data.DX=UvData.Mesh;
    2307         data.DY=UvData.Mesh;
    2308     elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image
    2309         np=size(UvData.Field.A);
    2310         meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/np(2);
    2311         meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/np(1);
    2312         data.RangeY=max(meshx,meshy);
    2313         data.RangeX=max(meshx,meshy);
    2314         data.DX=max(meshx,meshy);
    2315     end
    2316     data.ParentButton=handles.VOLUME;
    2317     PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters
    2318     [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface with action on haxes,
    2319                                                       % associate the set_edit interface handle to the plotting axes
    2320     if isfield(UvData,'SetObjectOrigin')                                               
    2321     pos_view_field=get(huvmat,'Position');
    2322     pos_set_object(1:2)=UvData.SetObjectOrigin + pos_view_field(1:2);
    2323     pos_set_object(3:4)=UvData.SetObjectSize .* pos_view_field(3:4); 
    2324     set(hset_object,'Position',pos_set_object)
    2325     end
    2326     UvData.MouseAction='create_object';
    2327 else
    2328     set(handles.VOLUME,'BackgroundColor',[0 1 0])
    2329     UvData.MouseAction='none';
    2330 end
    2331 set(huvmat,'UserData',UvData)
    2332 
    2333 %-------------------------------------------------------
    2334 function edit_vect_Callback(hObject, eventdata, handles)
    2335 %-------------------------------------------------------
    2336 
    2337 UvData=get(handles.view_field,'UserData');%read UvData properties stored on the view_field interface
    2338 if isequal(get(handles.edit_vect,'Value'),1)
    2339     test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]);
    2340     test_civ1=isequal(get(handles.civ1,'BackgroundColor'),[1 1 0]);
    2341     if ~test_civ2 && ~test_civ1
    2342         msgbox_view_field('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields')
    2343     end
    2344     set(handles.record,'Visible','on')
    2345     set(handles.edit_vect,'BackgroundColor',[1 1 0])
    2346     set(handles.edit,'Value',0)
    2347     set(handles.create,'Value',0)
    2348     set(handles.create,'BackgroundColor',[0 1 0])
    2349     set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    2350     set(gcf,'Pointer','arrow')
    2351     UvData.MouseAction='edit_vect';
    2352 else
    2353     set(handles.record,'Visible','off')
    2354     set(handles.edit_vect,'BackgroundColor',[0.7 0.7 0.7])
    2355     UvData.MouseAction='none';
    2356 end
    2357 set(handles.view_field,'UserData',UvData)
    2358 
    2359 %----------------------------------------------
    2360 function save_mask_Callback(hObject, eventdata, handles)
    2361 %-----------------------------------------------------------------------
    2362 huvmat=get(handles.save_mask,'parent');
    2363 UvData=get(huvmat,'UserData');
    2364 
    2365 hpatch=findobj(huvmat,'Type','patch');
    2366 flag=1;
    2367 npx=size(UvData.Field.A,2);
    2368 npy=size(UvData.Field.A,1);
    2369 xi=[0.5:npx-0.5];
    2370 yi=[0.5:npy-0.5];
    2371 [Xi,Yi]=meshgrid(xi,yi);
    2372 if isfield(UvData,'Object')
    2373     for iobj=1:length(UvData.Object)
    2374         ObjectData=UvData.Object{iobj};
    2375         if isfield(ObjectData,'ProjMode') &&(isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside'));
    2376             flagobj=1;
    2377             testphys=0; %coordinates in pixels by default
    2378             if isfield(ObjectData,'CoordType') && isequal(ObjectData.CoordType,'phys')
    2379                 if isfield(UvData,'XmlData')&& isfield(UvData.XmlData,'GeometryCalib')
    2380                     Calib=UvData.XmlData.GeometryCalib;
    2381                     testphys=1;
    2382                 end
    2383             end
    2384             if isfield(ObjectData,'Coord')& isfield(ObjectData,'Style')
    2385                 if isequal(ObjectData.Style,'polygon')
    2386                     X=ObjectData.Coord(:,1);
    2387                     Y=ObjectData.Coord(:,2);
    2388                     if testphys
    2389                         [X,Y]=px_XYZ(Calib,X,Y,0);% to generalise with 3D cases
    2390                     end
    2391                     flagobj=~inpolygon(Xi,Yi,X,Y);%=0 inside the polygon, 1 outside                 
    2392                 elseif isequal(ObjectData.Style,'ellipse')
    2393                     if testphys
    2394                         %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
    2395                     end
    2396                     RangeX=max(ObjectData.RangeX);
    2397                     RangeY=max(ObjectData.RangeY);
    2398                     X2Max=RangeX*RangeX;
    2399                     Y2Max=RangeY*RangeY;
    2400                     distX=(Xi-ObjectData.Coord(1,1));
    2401                     distY=(Yi-ObjectData.Coord(1,2));
    2402                     flagobj=(distX.*distX/X2Max+distY.*distY/Y2Max)>1;
    2403                 elseif isequal(ObjectData.Style,'rectangle')
    2404                     if testphys
    2405                         %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
    2406                     end
    2407                     distX=abs(Xi-ObjectData.Coord(1,1));
    2408                     distY=abs(Yi-ObjectData.Coord(1,2));
    2409                     flagobj=distX>max(ObjectData.RangeX) | distY>max(ObjectData.RangeY);
    2410                 end
    2411                 if isequal(ObjectData.ProjMode,'mask_outside')
    2412                     flagobj=~flagobj;
    2413                 end
    2414                 flag=flag & flagobj;
    2415             end
    2416         end
    2417     end
    2418 end
    2419 % flag=~flag;
    2420 %mask name
    2421 RootPath=get(handles.RootPath,'String');
    2422 RootFile=get(handles.RootFile,'String');
    2423 if ~isempty(RootFile)&(isequal(RootFile(1),'/')| isequal(RootFile(1),'\'))
    2424         RootFile(1)=[];
    2425 end
    2426 filebase=fullfile(RootPath,RootFile);
    2427 list=get(handles.masklevel,'String');
    2428 masknumber=num2str(length(list));
    2429 maskindex=get(handles.masklevel,'Value');
    2430 mask_name=name_generator([filebase '_' masknumber 'mask'],maskindex,1,'.png','_i');
    2431 imflag=uint8(255*(0.392+0.608*flag));% =100 for flag=0 (vectors not computed when 20<imflag<200)
    2432 imflag=flipdim(imflag,1);
    2433 % imflag=uint8(255*flag);% =0 for flag=0 (vectors=0 when 20<imflag<200)
    2434 msgbox_view_field('CONFIRMATION',[mask_name ' saved'])
    2435 imwrite(imflag,mask_name,'BitDepth',8);
    2436 
    2437 %display the mask
    2438 %update_mask(handles,num_i1,num_j1)
    2439 figure;
    2440 vec=linspace(0,1,256);%define a linear greyscale colormap
    2441 map=[vec' vec' vec'];
    2442 colormap(map)
    2443 
    2444 image(imflag);
    24451993
    24461994%-------------------------------------------------------------------
     
    26082156% set(handles.vec_col_bar,'Cdata',A)
    26092157
    2610 %--------------------------------------------------------
    2611 % --- Executes on button press in cal.
    2612 function cal_Callback(hObject, eventdata, handles)
    2613 
    2614 huvmat=get(handles.cal,'parent');%handles of the view_field interface
    2615 UvData=get(huvmat,'UserData');%read UvData properties stored on the view_field interface
    2616 %reinitialize the edit interface associated with view_field
    2617 value=get(handles.cal,'Value');
    2618 if value
    2619         set(handles.cal,'BackgroundColor',[1 1 0])
    2620         %suppress the other options if MENULINE is chosen
    2621         set(handles.zoom,'Value',0)
    2622         set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
    2623         set(handles.create,'Value',0)
    2624         set(handles.create,'BackgroundColor',[0 1 0])
    2625         set(handles.create,'enable','off')     
    2626         set(handles.edit_vect,'Value',0)
    2627         set(handles.edit_vect,'enable','off')
    2628         edit_vect_Callback(hObject, eventdata, handles)
    2629         set(handles.edit,'Value',0)
    2630         set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    2631         set(handles.edit,'enable','off')
    2632         set(handles.list_object,'Value',1)     
    2633         % initiate display of GUI geometry_calib
    2634         data=[]; %default
    2635                 if isfield(UvData,'CoordType')
    2636             data.CoordType=UvData.CoordType;
    2637         end
    2638         %data.ParentButton=handles.cal; % transmit the handles of the calling button to the GUI geometry_calib
    2639                 pos=get(huvmat,'Position');
    2640                 pos(1)=pos(1)+pos(3)-0.311+0.04; %0.311= width of the geometry_calib interface (units relative to the srcreen)
    2641                 pos(2)=pos(2)-0.02;
    2642         [FileName,RootPath,FileBase,FileIndices,FileExt,SubDir]=read_file_boxes(handles);
    2643 %         [filebase,num_i1,num_j1,num_i2,num_j2,Ext,NomType,SubDir]=read_input_file(handles);
    2644 %         [inputfile,idetect]=name_generator(filebase,num_i1,num_j1,Ext,NomType,1,num_i2,num_j2,SubDir);
    2645                 [UvData.hset_object,UvData.sethandles]=geometry_calib(handles,pos,FileName);% call the set_object interface     
    2646         pos_view_field=get(huvmat,'Position');
    2647         %pos_cal(1:2)=UvData.CalOrigin + pos_view_field(1:2);
    2648         if isfield(UvData,'CalOrigin')
    2649             pos_cal(1)=pos_view_field(1)+UvData.CalOrigin(1)*pos_view_field(3);
    2650             pos_cal(2)=pos_view_field(2)+UvData.CalOrigin(2)*pos_view_field(4);
    2651             pos_cal(3:4)=UvData.CalSize .* pos_view_field(3:4);
    2652             set(UvData.hset_object,'Position',pos_cal)
    2653         end
    2654         UvData.MouseAction='calib';
    2655 else
    2656      UvData.MouseAction='none';     
    2657      hgeometry_calib=findobj(allchild(0),'Name','geometry_calib');
    2658 %      if ~isempty(hgeometry_calib)
    2659 %          answer=questdlg('close the GUI geometry-calib?');
    2660 %          if isequal(answer,'Yes')
    2661 %              delete(hgeometry_calib)
    2662 %              set(handles.cal,'BackgroundColor',[0 1 0])
    2663 %          else
    2664 %              set(handles.cal,'Value',1)% keep the calibration function active
    2665 %          end
    2666 %      end
    2667      set(handles.edit_vect,'enable','on')
    2668      set(handles.edit,'enable','on')
    2669      set(handles.create,'enable','on')
    2670 %      set(handles.LINE,'enable','on')
    2671 %      set(handles.PATCH,'enable','on')
    2672 %      set(handles.PLANE,'enable','on')
    2673 %      set(handles.VOLUME,'enable','on')
    2674      %set(handles.makemask,'enable','on')
    2675      hh=findobj(handles.axes3,'Tag','calib_points');
    2676      if ~isempty(hh)
    2677          delete(hh)
    2678      end
    2679      hhh=findobj(handles.axes3,'Tag','calib_marker');
    2680      if ~isempty(hhh)
    2681          delete(hhh)
    2682      end   
    2683 end
    2684 set(huvmat,'UserData',UvData);
    2685 
    2686 %-------------------------------------------------------------
    2687 % --- Executes on selection change in transform_fct.
    2688 function transform_fct_Callback(hObject, eventdata, handles)
    2689 %-------------------------------------------------------------
    2690 global nb_builtin
    2691 
    2692 huvmat=get(handles.transform_fct,'parent');
    2693 menu=get(handles.transform_fct,'String');
    2694 ind_coord=get(handles.transform_fct,'Value');
    2695 coord_option=menu{ind_coord};
    2696 list_transform=get(handles.transform_fct,'UserData');
    2697 ff=functions(list_transform{end}); 
    2698 if isequal(coord_option,'more...');
    2699     coord_fct='';
    2700 
    2701 %     if exist(profil_perso,'file')
    2702 %           h=load (profil_perso);
    2703 %          if isfield(h,'transform_fct')
    2704 %                 transform_fct=h.transform_fct;
    2705 %          end
    2706 %     end
    2707     prompt = {'Enter the name of the transform function'};
    2708     dlg_title = 'user defined transform';
    2709     num_lines= 1;
    2710     [FileName, PathName, filterindex] = uigetfile( ...
    2711        {'*.m', ' (*.m)';
    2712         '*.m',  '.m files '; ...
    2713         '*.*', 'All Files (*.*)'}, ...
    2714         'Pick a file', ff.file);
    2715     if isequal(PathName(end),'/')||isequal(PathName(end),'\')
    2716         PathName(end)=[];
    2717     end
    2718     transform_selected =fullfile(PathName,FileName);
    2719     if ~exist(transform_selected,'file')
    2720 %            msgbox_view_field('ERROR',['procesing fct ' transform_selected ' not found'])
    2721            return
    2722     end
    2723    [ppp,transform,ext_fct]=fileparts(FileName);% removes extension .m
    2724    if ~isequal(ext_fct,'.m')
    2725         msgbox_view_field('ERROR','a Matlab function .m must be introduced');
    2726         return
    2727    end
    2728    menu=update_menu(handles.transform_fct,transform);%add the selected fct to the menu
    2729    ind_coord=get(handles.transform_fct,'Value');
    2730    addpath(PathName)
    2731    list_transform{ind_coord}=str2func(transform);% create the function handle corresponding to the newly seleced function
    2732    set(handles.transform_fct,'UserData',list_transform)
    2733    rmpath(PathName)
    2734    % save the new menu in the personal file 'view_field_perso.mat'
    2735    dir_perso=prefdir;%personal Matalb directory
    2736    profil_perso=fullfile(dir_perso,'view_field_perso.mat');
    2737    if exist(profil_perso,'file')
    2738        for ilist=nb_builtin+1:numel(list_transform)
    2739            ff=functions(list_transform{ilist});
    2740            transform_fct{ilist-nb_builtin}=ff.file;
    2741        end
    2742         save (profil_perso,'transform_fct','-append'); %store the root name for future opening of view_field
    2743    end   
    2744 end
    2745 
    2746 %check the current path to the selected function
    2747 if isa(list_transform{ind_coord},'function_handle')
    2748     func=functions(list_transform{ind_coord});
    2749     set(handles.path_transform,'String',fileparts(func.file)); %show the path to the senlected function
    2750 else
    2751     set(handles.path_transform,'String','')
    2752 end
    2753 %CurrentPath=fileparts(which(coord_option));
    2754 % if ~isequal(PathName,CurrentPath)
    2755 %     addpath(PathName)
    2756 %     errormsg=check_functions;
    2757 %     msgbox_view_field('WARNING',[['path ' PathName ' added to the current Matlab pathes'];errormsg])
    2758 % end
    2759 %set(handles.path_transform,'String',fullfile(PathName,' ')); %show the path to the senlected function
    2760 set(handles.FixedLimits,'Value',0)
    2761 set(handles.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
    2762 
    2763 UvData=get(huvmat,'UserData');
    2764 
    2765 %delete drawn objects
    2766 hother=findobj('Tag','proj_object');%find all the proj objects
    2767 for iobj=1:length(hother)
    2768     delete_object(hother(iobj))
    2769 end
    2770 hother=findobj('Tag','DeformPoint');%find all the proj objects
    2771 for iobj=1:length(hother)
    2772     delete_object(hother(iobj))
    2773 end
    2774 hh=findobj('Tag','calib_points');
    2775 if ~isempty(hh)
    2776     delete(hh)
    2777 end
    2778 hhh=findobj('Tag','calib_marker');
    2779 if ~isempty(hhh)
    2780     delete(hhh)
    2781 end
    2782 if isfield(UvData,'Object')
    2783     nbobject=length(UvData.Object);
    2784     UvData.Object([2:nbobject])=[];
    2785 end
    2786 
    2787 %delete mask if it is displayed
    2788 if isequal(get(handles.mask_test,'Value'),1)%if the mask option is on
    2789    UvData=rmfield(UvData,'MaskName'); %will impose mask refresh 
    2790 end
    2791 set(huvmat,'UserData',UvData)
    2792 run0_Callback(hObject, eventdata, handles)
    2793 
    2794 %--------------------------------------------
    2795 function histo1_menu_Callback(hObject, eventdata, handles)
    2796 %--------------------------------------------
    2797 %plot first histo
    2798 huvmat=get(handles.histo1_menu,'parent');
    2799 histo_menu=get(handles.histo1_menu,'String');
    2800 histo_value=get(handles.histo1_menu,'Value');
    2801 FieldName=histo_menu{histo_value};
    2802 UvData=get(huvmat,'UserData');
    2803 update_histo(handles.histo_u,huvmat,FieldName)
    2804 
    2805 %----------------------------------------------
    2806 function histo2_menu_Callback(hObject, eventdata, handles)
    2807 %----------------------------------------------
    2808 %plot second histo
    2809 huvmat=get(handles.histo2_menu,'parent');
    2810 histo_menu=get(handles.histo2_menu,'String');
    2811 histo_value=get(handles.histo2_menu,'Value');
    2812 FieldName=histo_menu{histo_value};
    2813 UvData=get(huvmat,'UserData');
    2814 update_histo(handles.histo_v,huvmat,FieldName)
    2815 
    2816 
    2817 %--------------------------------------------
    2818 %read the field .Fieldname stored in UvData and plot its histogram
    2819 function update_histo(haxes,huvmat,FieldName)
    2820 UvData=get(huvmat,'UserData');
    2821 
    2822 if ~isfield(UvData.Field,FieldName)
    2823     msgbox_view_field('ERROR',['no field  ' FieldName ' for histogram'])
    2824     return
    2825 end
    2826 Field=UvData.Field;
    2827 FieldHisto=eval(['Field.' FieldName]);
    2828 if isfield(Field,'FF') & ~isempty(Field.FF) & isequal(size(Field.FF),size(FieldHisto))
    2829     indsel=find(Field.FF==0);%find values marked as false
    2830     if ~isempty(indsel)
    2831         FieldHisto=FieldHisto(indsel);
    2832     end
    2833 end
    2834 if isempty(Field)
    2835     msgbox_view_field('ERROR',['empty field ' FieldName])
    2836 else
    2837     nxy=size(FieldHisto);
    2838     Amin=double(min(min(min(FieldHisto))));%min of image
    2839     Amax=double(max(max(max(FieldHisto))));%max of image
    2840     if isequal(Amin,Amax)
    2841        Histo.Txt=['uniform field =' num2str(Amin)];
    2842     else
    2843     Histo.ListVarName={FieldName,'histo'};
    2844     if numel(nxy)==2
    2845         Histo.VarDimName={FieldName,FieldName}; %dimensions for the histogram
    2846     else %color images
    2847         Histo.VarDimName={FieldName,{FieldName,'rgb'}}; %dimensions for the histogram
    2848     end
    2849     %unit
    2850     units=[]; %default
    2851     for ivar=1:numel(Field.ListVarName)   
    2852         if strcmp(Field.ListVarName{ivar},FieldName)
    2853             if isfield(Field,'VarAttribute') && numel(Field.VarAttribute)>=ivar && isfield(Field.VarAttribute{ivar},'units')
    2854                 units=Field.VarAttribute{ivar}.units;
    2855                 break
    2856             end
    2857         end
    2858     end
    2859     if ~isempty(units)
    2860         Histo.VarAttribute{1}.units=units;
    2861     end
    2862     eval(['Histo.' FieldName '=linspace(Amin,Amax,50);'])%absissa values for histo
    2863     for col=1:size(FieldHisto,3)
    2864         B=FieldHisto(:,:,col);
    2865         C=reshape(double(B),1,nxy(1)*nxy(2));% reshape in a vector
    2866        eval(['Histo.histo(:,col)=hist(C, Histo.' FieldName ');']);  %calculate histogram
    2867     end
    2868     set(haxes,'XLimMode','auto')%reset auto mode (after zoom effect)
    2869     set(haxes,'YLimMode','auto')
    2870     plot_field(Histo,haxes);
    2871     end
    2872 end
    2873 
    2874 
    28752158
    28762159%------------------------------------------------
     
    30832366
    30842367
    3085 function edit84_Callback(hObject, eventdata, handles)
    3086 % hObject    handle to edit84 (see GCBO)
     2368function npx_Callback(hObject, eventdata, handles)
     2369% hObject    handle to npx (see GCBO)
    30872370% eventdata  reserved - to be defined in a future version of MATLAB
    30882371% handles    structure with handles and user data (see GUIDATA)
    30892372
    3090 % Hints: get(hObject,'String') returns contents of edit84 as text
    3091 %        str2double(get(hObject,'String')) returns contents of edit84 as a double
     2373% Hints: get(hObject,'String') returns contents of npx as text
     2374%        str2double(get(hObject,'String')) returns contents of npx as a double
    30922375
    30932376
    30942377% --- Executes during object creation, after setting all properties.
    3095 function edit84_CreateFcn(hObject, eventdata, handles)
    3096 % hObject    handle to edit84 (see GCBO)
     2378function npx_CreateFcn(hObject, eventdata, handles)
     2379% hObject    handle to npx (see GCBO)
    30972380% eventdata  reserved - to be defined in a future version of MATLAB
    30982381% handles    empty - handles not created until after all CreateFcns called
     
    31062389
    31072390
    3108 function edit85_Callback(hObject, eventdata, handles)
    3109 % hObject    handle to edit85 (see GCBO)
     2391function npy_Callback(hObject, eventdata, handles)
     2392% hObject    handle to npy (see GCBO)
    31102393% eventdata  reserved - to be defined in a future version of MATLAB
    31112394% handles    structure with handles and user data (see GUIDATA)
    31122395
    3113 % Hints: get(hObject,'String') returns contents of edit85 as text
    3114 %        str2double(get(hObject,'String')) returns contents of edit85 as a double
     2396% Hints: get(hObject,'String') returns contents of npy as text
     2397%        str2double(get(hObject,'String')) returns contents of npy as a double
    31152398
    31162399
    31172400% --- Executes during object creation, after setting all properties.
    3118 function edit85_CreateFcn(hObject, eventdata, handles)
    3119 % hObject    handle to edit85 (see GCBO)
     2401function npy_CreateFcn(hObject, eventdata, handles)
     2402% hObject    handle to npy (see GCBO)
    31202403% eventdata  reserved - to be defined in a future version of MATLAB
    31212404% handles    empty - handles not created until after all CreateFcns called
     
    31302413
    31312414function edit86_Callback(hObject, eventdata, handles)
    3132 % hObject    handle to edit86 (see GCBO)
     2415% hObject    handle to MaxA (see GCBO)
    31332416% eventdata  reserved - to be defined in a future version of MATLAB
    31342417% handles    structure with handles and user data (see GUIDATA)
    31352418
    3136 % Hints: get(hObject,'String') returns contents of edit86 as text
    3137 %        str2double(get(hObject,'String')) returns contents of edit86 as a double
     2419% Hints: get(hObject,'String') returns contents of MaxA as text
     2420%        str2double(get(hObject,'String')) returns contents of MaxA as a double
    31382421
    31392422
    31402423% --- Executes during object creation, after setting all properties.
    3141 function edit86_CreateFcn(hObject, eventdata, handles)
    3142 % hObject    handle to edit86 (see GCBO)
     2424function MaxA_CreateFcn(hObject, eventdata, handles)
     2425% hObject    handle to MaxA (see GCBO)
    31432426% eventdata  reserved - to be defined in a future version of MATLAB
    31442427% handles    empty - handles not created until after all CreateFcns called
     
    31532436
    31542437function edit87_Callback(hObject, eventdata, handles)
    3155 % hObject    handle to edit87 (see GCBO)
     2438% hObject    handle to MinA (see GCBO)
    31562439% eventdata  reserved - to be defined in a future version of MATLAB
    31572440% handles    structure with handles and user data (see GUIDATA)
    31582441
    3159 % Hints: get(hObject,'String') returns contents of edit87 as text
    3160 %        str2double(get(hObject,'String')) returns contents of edit87 as a double
     2442% Hints: get(hObject,'String') returns contents of MinA as text
     2443%        str2double(get(hObject,'String')) returns contents of MinA as a double
    31612444
    31622445
    31632446% --- Executes during object creation, after setting all properties.
    3164 function edit87_CreateFcn(hObject, eventdata, handles)
    3165 % hObject    handle to edit87 (see GCBO)
     2447function MinA_CreateFcn(hObject, eventdata, handles)
     2448% hObject    handle to MinA (see GCBO)
    31662449% eventdata  reserved - to be defined in a future version of MATLAB
    31672450% handles    empty - handles not created until after all CreateFcns called
     
    31742457
    31752458
    3176 % --- Executes on button press in checkbox39.
    3177 function checkbox39_Callback(hObject, eventdata, handles)
    3178 % hObject    handle to checkbox39 (see GCBO)
     2459% --- Executes on button press in auto_sclar.
     2460function auto_sclar_Callback(hObject, eventdata, handles)
     2461% hObject    handle to auto_sclar (see GCBO)
    31792462% eventdata  reserved - to be defined in a future version of MATLAB
    31802463% handles    structure with handles and user data (see GUIDATA)
    31812464
    3182 % Hint: get(hObject,'Value') returns toggle state of checkbox39
     2465% Hint: get(hObject,'Value') returns toggle state of auto_sclar
    31832466
    31842467
    31852468
    31862469function edit88_Callback(hObject, eventdata, handles)
    3187 % hObject    handle to edit88 (see GCBO)
     2470% hObject    handle to IncrA (see GCBO)
    31882471% eventdata  reserved - to be defined in a future version of MATLAB
    31892472% handles    structure with handles and user data (see GUIDATA)
    31902473
    3191 % Hints: get(hObject,'String') returns contents of edit88 as text
    3192 %        str2double(get(hObject,'String')) returns contents of edit88 as a double
     2474% Hints: get(hObject,'String') returns contents of IncrA as text
     2475%        str2double(get(hObject,'String')) returns contents of IncrA as a double
    31932476
    31942477
    31952478% --- Executes during object creation, after setting all properties.
    3196 function edit88_CreateFcn(hObject, eventdata, handles)
    3197 % hObject    handle to edit88 (see GCBO)
     2479function IncrA_CreateFcn(hObject, eventdata, handles)
     2480% hObject    handle to IncrA (see GCBO)
    31982481% eventdata  reserved - to be defined in a future version of MATLAB
    31992482% handles    empty - handles not created until after all CreateFcns called
     
    32062489
    32072490
    3208 % --- Executes on button press in checkbox40.
     2491% --- Executes on button press in AutoScal.
    32092492function checkbox40_Callback(hObject, eventdata, handles)
    3210 % hObject    handle to checkbox40 (see GCBO)
     2493% hObject    handle to AutoScal (see GCBO)
    32112494% eventdata  reserved - to be defined in a future version of MATLAB
    32122495% handles    structure with handles and user data (see GUIDATA)
    32132496
    3214 % Hint: get(hObject,'Value') returns toggle state of checkbox40
     2497% Hint: get(hObject,'Value') returns toggle state of AutoScal
    32152498
    32162499
     
    32402523
    32412524function edit83_Callback(hObject, eventdata, handles)
    3242 % hObject    handle to edit83 (see GCBO)
     2525% hObject    handle to min_vec (see GCBO)
    32432526% eventdata  reserved - to be defined in a future version of MATLAB
    32442527% handles    structure with handles and user data (see GUIDATA)
    32452528
    3246 % Hints: get(hObject,'String') returns contents of edit83 as text
    3247 %        str2double(get(hObject,'String')) returns contents of edit83 as a double
     2529% Hints: get(hObject,'String') returns contents of min_vec as text
     2530%        str2double(get(hObject,'String')) returns contents of min_vec as a double
    32482531
    32492532
    32502533% --- Executes during object creation, after setting all properties.
    3251 function edit83_CreateFcn(hObject, eventdata, handles)
    3252 % hObject    handle to edit83 (see GCBO)
     2534function min_vec_CreateFcn(hObject, eventdata, handles)
     2535% hObject    handle to min_vec (see GCBO)
    32532536% eventdata  reserved - to be defined in a future version of MATLAB
    32542537% handles    empty - handles not created until after all CreateFcns called
     
    33052588
    33062589
    3307 % --- Executes on button press in checkbox41.
     2590% --- Executes on button press in AutoVecColor.
    33082591function checkbox41_Callback(hObject, eventdata, handles)
    3309 % hObject    handle to checkbox41 (see GCBO)
     2592% hObject    handle to AutoVecColor (see GCBO)
    33102593% eventdata  reserved - to be defined in a future version of MATLAB
    33112594% handles    structure with handles and user data (see GUIDATA)
    33122595
    3313 % Hint: get(hObject,'Value') returns toggle state of checkbox41
     2596% Hint: get(hObject,'Value') returns toggle state of AutoVecColor
    33142597
    33152598
    33162599
    33172600function edit89_Callback(hObject, eventdata, handles)
    3318 % hObject    handle to edit89 (see GCBO)
     2601% hObject    handle to max_vec (see GCBO)
    33192602% eventdata  reserved - to be defined in a future version of MATLAB
    33202603% handles    structure with handles and user data (see GUIDATA)
    33212604
    3322 % Hints: get(hObject,'String') returns contents of edit89 as text
    3323 %        str2double(get(hObject,'String')) returns contents of edit89 as a double
     2605% Hints: get(hObject,'String') returns contents of max_vec as text
     2606%        str2double(get(hObject,'String')) returns contents of max_vec as a double
    33242607
    33252608
    33262609% --- Executes during object creation, after setting all properties.
    3327 function edit89_CreateFcn(hObject, eventdata, handles)
    3328 % hObject    handle to edit89 (see GCBO)
     2610function max_vec_CreateFcn(hObject, eventdata, handles)
     2611% hObject    handle to max_vec (see GCBO)
    33292612% eventdata  reserved - to be defined in a future version of MATLAB
    33302613% handles    empty - handles not created until after all CreateFcns called
     
    33602643
    33612644
    3362 % --- Executes on button press in pushbutton35.
     2645% --- Executes on button press in vec_col_bar.
    33632646function pushbutton35_Callback(hObject, eventdata, handles)
    3364 % hObject    handle to pushbutton35 (see GCBO)
     2647% hObject    handle to vec_col_bar (see GCBO)
    33652648% eventdata  reserved - to be defined in a future version of MATLAB
    33662649% handles    structure with handles and user data (see GUIDATA)
    33672650
    33682651
     2652function close_fcn(hObject, eventdata, handles)
     2653huvmat=findobj(allchild(0),'Name','uvmat');
     2654hhuvmat=guidata(huvmat);
     2655set(hhuvmat.list_object_2,'Visible','off')
Note: See TracChangeset for help on using the changeset viewer.