Changeset 150 for trunk


Ignore:
Timestamp:
Dec 3, 2010, 12:16:51 PM (13 years ago)
Author:
sommeria
Message:

various corrections for plotting and using view_field and get_field. The current field of uvmat or view_field is now stored in the structure userdata.axes3. Introduction of live correlation to test PIV (civ1)

Location:
trunk/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r147 r150  
    2222function varargout = civ(varargin)
    2323
    24 % Last Modified by GUIDE v2.5 27-Mar-2010 13:41:11
     24% Last Modified by GUIDE v2.5 01-Dec-2010 23:19:15
    2525% Begin initialization code - DO NOT EDIT
    2626gui_Singleton = 1;
     
    225225end
    226226
    227 set(handles.waitbar_1,'Position',[0.946 0.877 0.03 0.001])
    228 set(handles.waitbar_patch1,'Position',[0.946 0.626 0.03 0.001])
    229 set(handles.waitbar_civ2,'Position',[0.946 0.406 0.03 0.001])
    230 set(handles.waitbar_patch2,'Position',[0.946 0.187 0.03 0.001])
     227% set(handles.waitbar_1,'Position',[0.946 0.877 0.03 0.001])
     228% set(handles.waitbar_patch1,'Position',[0.946 0.626 0.03 0.001])
     229% set(handles.waitbar_civ2,'Position',[0.946 0.406 0.03 0.001])
     230% set(handles.waitbar_patch2,'Position',[0.946 0.187 0.03 0.001])
    231231
    232232%------------------------------------------------------------------------
     
    772772
    773773%%%%%% initialize waitbars and RUN button
    774 set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001])
    775 set(handles.waitbar_patch1,'Position',[0.946 0.439 0.03 0.001])
    776 set(handles.waitbar_civ2,'Position',[0.946 0.219 0.03 0.001])
    777 set(handles.waitbar_patch2,'Position',[0.946 0.0 0.03 0.001])
     774% set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001])
     775% set(handles.waitbar_patch1,'Position',[0.946 0.439 0.03 0.001])
     776% set(handles.waitbar_civ2,'Position',[0.946 0.219 0.03 0.001])
     777% set(handles.waitbar_patch2,'Position',[0.946 0.0 0.03 0.001])
    778778set(handles.RUN, 'Enable','On')
    779779set(handles.RUN,'BackgroundColor',[1 0 0])
     
    16231623
    16241624%% initialize the waitbars: TO suppress, waitbar not used
    1625 set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001])
    1626 set(handles.waitbar_patch1,'Position',[0.946 0.439 0.03 0.001])
    1627 set(handles.waitbar_civ2,'Position',[0.946 0.219 0.03 0.001])
    1628 set(handles.waitbar_patch2,'Position',[0.946 0.0 0.03 0.001])
    1629 drawnow
     1625% set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001])
     1626% set(handles.waitbar_patch1,'Position',[0.946 0.439 0.03 0.001])
     1627% set(handles.waitbar_civ2,'Position',[0.946 0.219 0.03 0.001])
     1628% set(handles.waitbar_patch2,'Position',[0.946 0.0 0.03 0.001])
     1629% drawnow
    16301630
    16311631%% set the list of files and check them
    16321632display('checking the files...')
    1633 compare=get(handles.compare,'Value');%test for usual PIV (compare=1) or displacement (=2) or stereo PIV (=3)
     1633%compare=get(handles.compare,'Value');%test for usual PIV (compare=1) or displacement (=2) or stereo PIV (=3)
    16341634[filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc]=...
    1635     set_civ_filenames(handles,compare,box_test);
     1635    set_civ_filenames(handles,box_test);
    16361636if isempty(filecell)% (error message displayed in fct set_civ_filenames)
    16371637    return
     
    22762276
    22772277function [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=...
    2278     set_civ_filenames(handles,compare,box_test)
     2278    set_civ_filenames(handles,box_test)
    22792279%------------------------------------------------------------------------
    22802280filecell=[];%default
     
    39563956par.pxcmx='1'; %velocities are expressed in pixel dispalcement
    39573957par.pxcmy='1';
    3958 %      end
     3958if exist('file_ima','var')
    39593959A=imread(file_ima);%read the first image to get the size
    39603960sizim=size(A);
    39613961par.npx=num2str(sizim(2));
    39623962par.npy=num2str(sizim(1));
     3963end
    39633964%time=get(handles.RootName,'UserData'); %get the set of times
    39643965par.gridname=get(handles.grid_civ1,'String');
     
    45954596
    45964597
    4597 
    4598 
     4598% --- Executes on button press in TestCiv1.
     4599function TestCiv1_Callback(hObject, eventdata, handles)
     4600test_civ1=get(handles.TestCiv1,'Value');
     4601if test_civ1
     4602[filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=...
     4603    set_civ_filenames(handles,[1 0 0 0 0 0]);
     4604Data.ListVarName={'ny','nx','A'};
     4605Data.VarDimName={'ny','nx',{'ny','nx'}};
     4606Data.A=imread(filecell.ima1.civ1{1});
     4607Data.ny=[size(Data.A,1) 1];
     4608Data.nx=[1 size(Data.A,2)];
     4609hh=view_field(Data);
     4610ViewData=get(hh,'UserData');
     4611ViewData.axes3.B=imread(filecell.ima2.civ1{1});
     4612set(hh,'UserData',ViewData)
     4613end
     4614
     4615
     4616
     4617
     4618
     4619
  • trunk/src/get_field.m

    r147 r150  
    172172inputfile=get(handles.inputfile,'String');
    173173Field=nc2struct(inputfile);% reads the whole field
     174if isfield(Field,'Txt')
     175    msgbox_uvmat('ERROR',Field.Txt)
     176else
    174177set(handles.figure1,'UserData',Field);
    175178Field_input(eventdata,handles,Field);
     179end
    176180
    177181%------------------------------------------------------------------------
     
    811815
    812816%------------------------------------------------------------------------
     817% --- Function for plotting the current subfield
    813818function plot_get_field(SubField,handles)
    814819%------------------------------------------------------------------------
     
    816821val=get(handles.list_fig,'Value');
    817822if strcmp(list_fig{val},'uvmat')
    818 %     set(handles.figure1,'Name','uvmat_field')
    819823    set(handles.inputfile,'Enable','off')% desactivate the input file edit box   
    820 %     set(handles.list_fig,'Visible','off')%
    821824    set(handles.RUN,'Visible','off')% RUN button not visible (passive mode, get_field used to define the field for uvamt)
    822825    set(handles.MenuOpen,'Visible','off')
     
    826829    view_field(SubField)
    827830else
    828     hfig=str2num(list_fig{val});% chosen figure number from tyhe GUI
    829     if isempty(hfig)
     831    hfig=str2double(list_fig{val});% chosen figure number from tyhe GUI
     832    if isnan(hfig)
    830833        hfig=figure;
    831834        list_fig=[list_fig;num2str(hfig)];
     
    10751078% update dimensions;
    10761079if isfield(Field,'ListDimName')
    1077     Field.ListDimName
    10781080    Tabdim={};%default
    10791081    if isequal(index,1)%list all dimensions
  • trunk/src/mouse_down.m

    r102 r150  
    3333UvData=get(huvmat,'UserData');
    3434MouseAction='none'; %default
    35 testzoom=get(guihandles.zoom,'Value');% get the mouse action from the uvmat GUI: options:
     35currentfig=hObject;
     36hhcurrentfig=guidata(currentfig);
     37test_zoom=get(hhcurrentfig.zoom,'Value')
     38%test_zoom=get(guihandles.zoom,'Value');% get the mouse action from the uvmat GUI: options:
    3639if isfield(UvData,'MouseAction')
    3740    MouseAction=UvData.MouseAction;% get the mouse action from the uvmat GUI: options:
    3841end
    3942
    40 test_create=~testzoom && (isequal(MouseAction,'create_object') || isequal(MouseAction,'create_mask'));
     43test_create=~test_zoom && (isequal(MouseAction,'create_object') || isequal(MouseAction,'create_mask'));
    4144%test_cal=get(handles.cal,'Value');
    4245test_cal=strcmp(MouseAction,'calib');
     
    111114
    112115% zoom has first priority
    113 if testzoom %&& ~test_create && ~test_edit && ~test_edit_vect && exist('xy','var')
     116if test_zoom %&& ~test_create && ~test_edit && ~test_edit_vect && exist('xy','var')
    114117     AxeData.Drawing='zoom'; %initiate drawing mode
    115118     AxeData.CurrentObject=[];%unselect objects
     
    261264
    262265% create calibration points if the GUI geometry_calib is opened, if the main axes axes3 of uvmat has ben selected
    263 if ~testzoom && test_cal && ~isempty(haxes) && strcmp(get(haxes,'tag'),'axes3')
     266if ~test_zoom && test_cal && ~isempty(haxes) && strcmp(get(haxes,'tag'),'axes3')
    264267    h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI
    265268    hh_geometry_calib=guidata(h_geometry_calib);
  • trunk/src/mouse_motion.m

    r105 r150  
    2828    return
    2929end
    30 test_draw=0;
    31 test_create=0;%default
    32 test_object=0; %default
     30currentfig=hObject;
     31hhcurrentfig=guidata(currentfig);
     32test_zoom=get(hhcurrentfig.zoom,'Value');%test for zoom activated on the current figure
     33test_draw=0;%test for mouse drawing of object, =0 by default
     34test_object=0; %test for object editing or creation
    3335test_edit=isfield(handles,'edit') && get(handles.edit,'Value');% edit test for mouse shap: an arrow
    34 test_zoom_draw=0; %default
    35 test_ruler=0;
    36 huvmat=findobj(allchild(0),'Name','uvmat');%find the uvmat interface handle
    37 hhuvmat=guidata(huvmat);
    38 test_zoom=get(hhuvmat.zoom,'Value');
     36test_zoom_draw=0; % test for zoom drawing
     37test_ruler=0;%test for active ruler
     38test_piv=0;% test for PIV correlation display
     39huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle
     40if ~isempty(huvmat)
     41    hhuvmat=guidata(huvmat);
     42end
    3943if ~isempty(huvmat)
    4044    UvData=get(huvmat,'UserData');
    4145    test_ruler=isfield(UvData,'MouseAction') && isequal(UvData.MouseAction,'ruler');
    4246end
    43 
     47hciv=findobj(allchild(0),'tag','civ');%find the uvmat interface handle
     48if ~isempty(hciv) && strcmp(get(currentfig,'tag'),'view_field')
     49    hhciv=guidata(hciv);
     50    test_piv =get(hhciv.TestCiv1,'Value');
     51end
    4452
    4553%find the current axe 'haxes' and display the current mouse position or uicontrol tag
     
    5462
    5563pointershape='arrow';% default pointer is an arrow
    56 currentfig=hObject;
     64
    5765xy_fig=get(currentfig,'CurrentPoint');% current point of the current figure (gcbo)
    5866hchild=get(currentfig,'Children');%handles of all objects in the current figure
    5967
    60 % loop on all the objects in the current figure and detect whether the mouse is over a plot  axes
     68%% loop on all the objects in the current figure and detect whether the mouse is over a plot  axes
    6169haxes=[];
    6270for ichild=1:length(hchild)
     
    6573        continue
    6674    end%position of the object
    67     if xy_fig(1) >=obj_pos(1) & xy_fig(2) >= obj_pos(2)& xy_fig(1) <=obj_pos(1)+obj_pos(3) & xy_fig(2) <= obj_pos(2)+obj_pos(4);
     75    if xy_fig(1) >=obj_pos(1) && xy_fig(2) >= obj_pos(2)&& xy_fig(1) <=obj_pos(1)+obj_pos(3) && xy_fig(2) <= obj_pos(2)+obj_pos(4);
    6876        htype=get(hchild(ichild),'Type');%type of the crrent child
    6977        %if the mouse is over an axis, look at the data
     
    7381            AxeData=get(haxes,'UserData');% data attached to the axis
    7482            if isfield(AxeData,'Drawing')&& ~isempty(AxeData.Drawing)
    75                 test_draw=~isequal(AxeData.Drawing,'off');
     83                test_draw=~isequal(AxeData.Drawing,'off');%=1 if mouse drawing of object is active
    7684            end
    7785            test_zoom_draw=test_draw && isequal(AxeData.Drawing,'zoom')&& isfield(AxeData,'CurrentOrigin') && isequal(get(gcf,'SelectionType'),'normal');
     
    8088                pointershape='crosshair';%set pointer with cross shape (default when mouse is over an axis)
    8189            end
    82             if isfield(AxeData,'ListVarName')
    83                 [CellVarIndex,NbDim,VarType]=find_field_indices(AxeData);
    84                 if isfield(AxeData,'Mesh') && ~isempty(AxeData.Mesh)
    85                     text_displ_1='';
    86                     text_displ_2='';
    87                     text_displ_3='';
    88                     text_displ_4='';
    89                     for icell=1:numel(CellVarIndex)%look for all physical fields
    90                         if NbDim(icell)==2 % select 2D field
    91                             if ~isempty(VarType{icell}.coord_x) && ~isempty(VarType{icell}.coord_y)%case of unstructured data
    92                                 eval(['X=AxeData.' AxeData.ListVarName{VarType{icell}.coord_x} ';'])
    93                                 eval(['Y=AxeData.' AxeData.ListVarName{VarType{icell}.coord_y} ';'])
    94                                 flag_vec=(X<(xy(1,1)+AxeData.Mesh/3) & X>(xy(1,1)-AxeData.Mesh/3)) & ...%flagx=1 for the vectors with x position selected by the mouse
    95                                     (Y<(xy(1,2)+AxeData.Mesh/3) & Y>(xy(1,2)-AxeData.Mesh/3));%f
    96                                 ivec=find(flag_vec,1);% search the (first) selected vector index ivec
    97                                 hhh=findobj(haxes,'Tag','vector_marker');
    98                                 if ~isempty(ivec)
    99                                     if ~test_object && ~test_create && ~test_edit && ~test_ruler% mark the vectors with a circle in the absence of other operations
    100                                         pointershape='arrow'; %mouse indicates  the detection of a vector
    101                                         if isempty(hhh)
    102                                             hstack=findobj(allchild(0),'Type','figure');%current stack order of figures in matlab
    103                                             axes(haxes)
    104                                             rectangle('Curvature',[1 1],...
    105                                                 'Position',[X(ivec)-AxeData.Mesh/2 Y(ivec)-AxeData.Mesh/2 AxeData.Mesh AxeData.Mesh],'EdgeColor','m',...
    106                                                 'LineStyle','-','Tag','vector_marker');
    107                                             set(0,'Children',hstack);%put back the initial figure stack after plot creation
    108                                         else
    109                                             set(hhh,'Visible','on')
    110                                             set(hhh,'Position',[X(ivec)-AxeData.Mesh/2 Y(ivec)-AxeData.Mesh/2 AxeData.Mesh AxeData.Mesh])
     90            FigData=get(currentfig,'UserData');
     91            tagaxes=get(haxes,'tag');
     92            if isfield(FigData,tagaxes)
     93                eval(['Field=FigData.' tagaxes ';'])
     94                if isfield(Field,'ListVarName')
     95                    [CellVarIndex,NbDim,VarType]=find_field_indices(Field);%analyse the physical fields contained in Field
     96%                     if isfield(Field,'Mesh') && ~isempty(Field.Mesh)
     97                        text_displ_1='';
     98                        text_displ_2='';
     99                        text_displ_3='';
     100                        text_displ_4='';
     101                        for icell=1:numel(CellVarIndex)%look for all physical fields
     102                            if NbDim(icell)==2 % select 2D field
     103                                if  isfield(Field,'Mesh') && ~isempty(Field.Mesh)&& ~isempty(VarType{icell}.coord_x) && ~isempty(VarType{icell}.coord_y)%case of unstructured data
     104                                    eval(['X=Field.' Field.ListVarName{VarType{icell}.coord_x} ';'])
     105                                    eval(['Y=Field.' Field.ListVarName{VarType{icell}.coord_y} ';'])
     106                                    flag_vec=(X<(xy(1,1)+Field.Mesh/3) & X>(xy(1,1)-Field.Mesh/3)) & ...%flagx=1 for the vectors with x position selected by the mouse
     107                                        (Y<(xy(1,2)+Field.Mesh/3) & Y>(xy(1,2)-Field.Mesh/3));%f
     108                                    ivec=find(flag_vec,1);% search the (first) selected vector index ivec                         
     109                                    hhh=findobj(haxes,'Tag','vector_marker');
     110                                    if ~isempty(ivec)
     111                                        % mark the vectors with a circle in the absence of other operations
     112                                        if ~test_object && ~test_edit && ~test_ruler
     113                                            pointershape='arrow'; %mouse indicates  the detection of a vector
     114                                            if isempty(hhh)
     115                                                set(0,'CurrentFigure',currentfig)
     116                                                set(currentfig,'CurrentAxes',haxes)
     117                                                rectangle('Curvature',[1 1],...
     118                                                    'Position',[X(ivec)-Field.Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh],'EdgeColor','m',...
     119                                                    'LineStyle','-','Tag','vector_marker');
     120                                            else
     121                                                set(hhh,'Visible','on')
     122                                                set(hhh,'Position',[X(ivec)-Field.Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh])
     123                                            end
     124                                        end
     125                                        %display the field values
     126                                        for ivar=1:numel(CellVarIndex{icell})
     127                                            VarName=Field.ListVarName{CellVarIndex{icell}(ivar)};
     128                                            eval(['VarVal=Field.' VarName '(ivec);'])
     129                                            var_text=[VarName '=' num2str(VarVal,3) ','];
     130                                            if isequal(ivar,VarType{icell}.coord_x)||isequal(ivar,VarType{icell}.coord_y)||isequal(ivar,VarType{icell}.coord_z)
     131                                                text_displ_1=[text_displ_1 var_text];
     132                                            elseif isequal(ivar,VarType{icell}.vector_x)||isequal(ivar,VarType{icell}.vector_y)||isequal(ivar,VarType{icell}.vector_z)
     133                                                text_displ_3=[text_displ_3 var_text];
     134                                            else
     135                                                text_displ_4=[text_displ_4 var_text];
     136                                            end
     137                                        end
     138                                    else
     139                                        if ~isempty(hhh)
     140                                            set(hhh,'Visible','off')
    111141                                        end
    112142                                    end
    113                                     for ivar=1:numel(CellVarIndex{icell})
    114                                         VarName=AxeData.ListVarName{CellVarIndex{icell}(ivar)};
    115                                         eval(['VarVal=AxeData.' VarName '(ivec);'])
    116                                         var_text=[VarName '=' num2str(VarVal,3) ','];
    117                                         if isequal(ivar,VarType{icell}.coord_x)||isequal(ivar,VarType{icell}.coord_y)||isequal(ivar,VarType{icell}.coord_z)
    118                                             text_displ_1=[text_displ_1 var_text];
    119                                         elseif isequal(ivar,VarType{icell}.vector_x)||isequal(ivar,VarType{icell}.vector_y)||isequal(ivar,VarType{icell}.vector_z)
    120                                             text_displ_3=[text_displ_3 var_text];
    121                                         else
    122                                             text_displ_4=[text_displ_4 var_text];
    123                                         end
    124                                     end
    125                                 else
    126                                     if ~isempty(hhh)
    127                                         set(hhh,'Visible','off')
    128                                     end
    129                                 end
    130                             elseif numel(VarType{icell}.coord) >=2 %structured coordinates
    131                                 eval(['y=AxeData.' AxeData.ListVarName{VarType{icell}.coord(1)} ';'])
    132                                 eval(['x=AxeData.' AxeData.ListVarName{VarType{icell}.coord(2)} ';'])
    133                                 nxy(1)=numel(y);
    134                                 nxy(2)=numel(x);
    135                                 MaxAY=max(y(1),y(end));
    136                                 MinAY=min(y(1),y(end));
    137                                 if (xy(1,1)>x(1))&(xy(1,1)<x(end))&(xy(1,2)<MaxAY)&(xy(1,2)>MinAY)
    138                                     indx0=1+round((nxy(2)-1)*(xy(1,1)-x(1))/(x(end)-x(1)));% index x of pixel
    139                                     indy0=1+round((nxy(1)-1)*(xy(1,2)-y(1))/(y(end)-y(1)));% index y of pixel
    140                                     if indx0>=1 & indx0<=nxy(2) & indy0>=1 & indy0<=nxy(1)
    141                                         text_displ_2=['i='  num2str(indx0) ',j=' num2str(indy0) ','];
    142                                         for ivar=1:numel(CellVarIndex{icell})
    143                                             VarName=AxeData.ListVarName{CellVarIndex{icell}(ivar)};
    144                                             eval(['VarVal=AxeData.' VarName '(indy0,indx0);'])
    145                                             var_text=[VarName '=' num2str(VarVal,3) ','];
    146                                             text_displ_2=[text_displ_2 var_text];
     143                                elseif numel(VarType{icell}.coord) >=2 %structured coordinates
     144                                    eval(['y=Field.' Field.ListVarName{VarType{icell}.coord(1)} ';'])
     145                                    eval(['x=Field.' Field.ListVarName{VarType{icell}.coord(2)} ';'])
     146                                    VarName=Field.ListVarName{CellVarIndex{icell}(1)};
     147                                    eval(['nxy=size(Field.' VarName ');']);
     148%                                     nxy(1)=numel(y);
     149%                                     nxy(2)=numel(x);
     150                                    MaxAY=max(y(1),y(end));
     151                                    MinAY=min(y(1),y(end));
     152                                    if (xy(1,1)>x(1))&(xy(1,1)<x(end))&(xy(1,2)<MaxAY)&(xy(1,2)>MinAY)
     153                                        indx0=1+round((nxy(2)-1)*(xy(1,1)-x(1))/(x(end)-x(1)));% index x of pixel
     154                                        indy0=1+round((nxy(1)-1)*(xy(1,2)-y(1))/(y(end)-y(1)));% index y of pixel
     155                                        if indx0>=1 & indx0<=nxy(2) & indy0>=1 & indy0<=nxy(1)
     156                                            text_displ_2=['i='  num2str(indx0) ',j=' num2str(indy0) ','];
     157                                            for ivar=1:numel(CellVarIndex{icell})
     158                                                VarName=Field.ListVarName{CellVarIndex{icell}(ivar)};
     159                                                eval(['VarVal=Field.' VarName '(indy0,indx0,:);'])
     160                                                var_text=[VarName '=' num2str(VarVal) ','];
     161                                                text_displ_2=[text_displ_2 var_text];
     162                                            end
    147163                                        end
    148164                                    end
     
    150166                            end
    151167                        end
     168%                     end
     169                    if strcmp(text_displ_1,'')
     170                        text_displ_1=['x=' num2str(xy(1,1),3) ',y=' num2str(xy(1,2),3) ','];
     171                    end
     172                    if isfield(Field,'PlaneCoord') && isfield(Field,'ZIndex')
     173                        text_displ_1=[text_displ_1 ' z=' num2str(Field.PlaneCoord(Field.ZIndex,3))]; %TODO: generaliser au cas avec angle
     174                    end
     175                    %coordinate transform if proj_coord differs from menu_coord A REVOIR
     176                    if isfield(Field,'CoordType')
     177                        mouse.CoordType=Field.CoordType;
     178                    end
     179                    if isfield(Field,'CoordUnit')
     180                        mouse.CoordUnit=Field.CoordUnit;
     181                    end
     182                    if isfield(mouse,'CoordType')
     183                        if isequal(mouse.CoordType,'px')
     184                            mouse.CoordUnit='px';
     185                        end
     186                    else
     187                        mouse.CoordUnit='';%default
     188                    end
     189                    if test_piv
     190                       par=civ('read_param_civ1',hhciv);
     191                        if isfield(Field,'A')
     192                            dx=str2double(par.dx);
     193                            dy=str2double(par.dy);
     194                            xround=x(1)+dx*round((xy(1,1)-x(1))/dx);% index x of pixel
     195                            yround=y(1)+dy*round((xy(1,2)-y(1))/dy);% index y of pixel
     196                        end
     197                        % mark the correlation box with a rectangle
     198                        ibx2=floor((str2double(par.ibx)-1)/2);
     199                        iby2=floor((str2double(par.iby)-1)/2);
     200                        isx2=floor((str2double(par.isx)-1)/2);
     201                        isy2=floor((str2double(par.isy)-1)/2);
     202                        hhh=findobj(haxes,'Tag','PIV_box_marker');
     203                        hhhh=findobj(haxes,'Tag','PIV_search_marker');
     204                        if isempty(hhh)
     205                            %hstack=findobj(allchild(0),'Type','figure');%current stack order of figures in matlab
     206                            set(0,'CurrentFigure',currentfig)
     207                            set(currentfig,'CurrentAxes',haxes)
     208                            rectangle('Curvature',[0 0],...
     209                                'Position',[xround-ibx2 yround-iby2 2*ibx2 2*iby2],'EdgeColor','m',...
     210                                'LineStyle','-','Tag','PIV_box_marker');
     211                            rectangle('Curvature',[0 0],...
     212                                'Position',[xround-isx2 yround-isy2 2*isx 2*isy],'EdgeColor','m',...
     213                                'LineStyle','- -','Tag','PIV_search_marker');
     214                            % set(0,'Children',hstack);%put back the initial figure stack after plot creation
     215                        else
     216%                             set(hhh,'Visible','on')
     217                            set(hhh,'Position',[xround-ibx2 yround-iby2 2*ibx2 2*iby2])
     218                            set(hhhh,'Position',[xround-isx2 yround-isy2 2*isx2 2*isy2])
     219                        end
     220                        Asub=Field.A(xround-ibx2:xround+ibx2,yround-iby2:yround+iby2);
     221                        Asub=reshape(Asub,[],1);
     222                        rangx(1)=-(isx2-ibx2);
     223                        rangx(2)=isx2-ibx2;
     224                        rangy(1)=isy2-iby2;
     225                        rangy(2)=-(isy2-iby2);
     226                        for id=rangx(1):rangx(2)
     227                            for jd=rangy(2):rangy(1)
     228                                Bsub=Field.B(xround-ibx2+id:xround+ibx2+id,yround-iby2+jd:yround+iby2+jd);
     229                                Bsub=reshape(Bsub,[],1);
     230                                correl(jd-rangy(2)+1,id-rangx(1)+1)=corr(double(Asub),double(Bsub));
     231                            end
     232                        end
     233                        %correl=uint8(63.5*correl+63.5);
     234                        hcorr=[];
     235                        if isfield(AxeData,'CurrentCorrImage')                       
     236                            hcorr=AxeData.CurrentCorrImage;
     237                            if ~ishandle(hcorr)
     238                                hcorr=[];
     239                            end
     240                        end
     241                        if isempty(hcorr)
     242                            coorfig=findobj(allchild(0),'tag','corrfig');
     243                            if isempty(coorfig)
     244                                corrfig=figure;
     245                                set(corrfig,'tag','corrfig')
     246                            end
     247                            set(0,'CurrentFigure',corrfig)
     248                            AxeData.CurrentCorrImage=imagesc(rangx,rangy,correl,[0 1]);
     249                            colorbar
     250%                             map_r=ones(42,1)*[1 0 0];
     251%                             map_g=ones(11,1)*[0 1 0];
     252%                             map_b=ones(11,1)*[0 0 1];
     253%                             map=[map_r;map_g;map_b];
     254%                             set(corrfig,'colormap',map)
     255                            set(haxes,'UserData',AxeData)
     256                        else
     257                            set(AxeData.CurrentCorrImage,'CData',correl)
     258                        end       
    152259                    end
    153260                end
    154                 if strcmp(text_displ_1,'')
    155                     text_displ_1=['x=' num2str(xy(1,1)) ',y=' num2str(xy(1,2))];
    156                 end
    157                 if isfield(AxeData,'Z')
    158                     text_displ_1=[text_displ_1 num2str(AxeData.Z)]; %generaliser au cas avec angle
    159                 end
    160                 if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3
    161                     text_displ_1=[text_displ_1 num2str(AxeData.ObjectCoord(1,3))]; %generaliser au cas avec angle
    162                 end
    163                 %images
    164                 if strcmp(text_displ_2,'')&&isfield(AxeData,'A')&&isfield(AxeData,'AX')&&isfield(AxeData,'AY')
    165                     y=AxeData.AY;
    166                     x=AxeData.AX;
    167                     nxy=size(AxeData.A);
    168                     MaxAY=max(y(1),y(end));
    169                     MinAY=min(y(1),y(end));
    170                     if (xy(1,1)>x(1))&(xy(1,1)<x(end))&(xy(1,2)<MaxAY)&(xy(1,2)>MinAY)
    171                         indx0=1+round((nxy(2)-1)*(xy(1,1)-x(1))/(x(end)-x(1)));% index x of pixel
    172                         indy0=1+round((nxy(1)-1)*(xy(1,2)-y(1))/(y(end)-y(1)));% index y of pixel
    173                         if indx0>=1 & indx0<=nxy(2) & indy0>=1 & indy0<=nxy(1)
    174                             text_displ_2=['i='  num2str(indx0) ',j=' num2str(indy0) ',A=' num2str(AxeData.A(indy0,indx0,:))];
    175                         end
    176                     end
    177                 end
    178                 %coordinate transform if proj_coord differs from menu_coord A REVOIR
    179                 if isfield(AxeData,'CoordType')
    180                     mouse.CoordType=AxeData.CoordType;
    181                 end
    182                 if isfield(AxeData,'CoordUnit')
    183                     mouse.CoordUnit=AxeData.CoordUnit;
    184                 end
    185                 if isfield(mouse,'CoordType')
    186                     if isequal(mouse.CoordType,'px')
    187                         mouse.CoordUnit='px';
    188                     end
    189                 else
    190                     mouse.CoordUnit='';%default
    191                 end
    192             end
     261            end     
    193262        end
    194263    end
     
    200269
    201270%%%%%%%%%%%%%
    202 %draw a zoom rectangle if no object creation is selected
     271%% draw a zoom rectangle if no object creation is selected
    203272if test_zoom_draw
    204273   xy_rect=AxeData.CurrentOrigin;
     
    221290
    222291%%%%%%%%%%%%%%%%%
    223 %create or modify an object
     292%% create or modify an object
    224293
    225294if ~isempty(huvmat) && test_object
     
    234303        XYData=AxeData.CurrentOrigin;
    235304        if isequal(AxeData.Drawing,'create') && isfield(AxeData,'CurrentOrigin') && ~isempty(AxeData.CurrentOrigin)
    236            if isequal(ObjectData.Style,'line')|isequal(ObjectData.Style,'polyline')|isequal(ObjectData.Style,'polygon')|isequal(ObjectData.Style,'points')
     305           if strcmp(ObjectData.Style,'line')||strcmp(ObjectData.Style,'polyline')||strcmp(ObjectData.Style,'polygon')||strcmp(ObjectData.Style,'points')
    237306              xy(1,3)=0;
    238307              ObjectData.Coord=[ObjectData.Coord ;xy(1,:)];
    239308             % ObjectData.Coord(end,:)=xy(1,:);
    240            elseif isequal(ObjectData.Style,'rectangle')|isequal(ObjectData.Style,'ellipse')|isequal(ObjectData.Style,'volume')
     309           elseif strcmp(ObjectData.Style,'rectangle')||strcmp(ObjectData.Style,'ellipse')||strcmp(ObjectData.Style,'volume')
    241310              ObjectData.Coord(1,1)=(xy(1,1)+XYData(1))/2;%origin rectangle, x coordinate
    242311              ObjectData.Coord(1,2)=(xy(1,2)+XYData(2))/2;
     
    273342end   
    274343
    275 % detect calibration points if the GUI geometry_calib is opened
     344%% detect calibration points if the GUI geometry_calib is opened
    276345h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI
    277346if ~test_zoom && ~isempty(h_geometry_calib)
     
    317386end
    318387
    319 %draw ruler
     388%% draw ruler
    320389if test_ruler && isequal(AxeData.Drawing,'ruler')
    321390           if isfield(UvData,'RulerHandle')
     
    326395           end
    327396end
     397
     398%% update the mouse pointer
    328399set(currentfig,'Pointer',pointershape);
  • trunk/src/mouse_up.m

    r102 r150  
    2424function mouse_up(hObject,eventdata,handles)
    2525MouseAction='none'; %default
    26 zoomstate=0;%default
     26test_zoom=0;%default
     27currentfig=hObject;
     28hhcurrentfig=guidata(currentfig);
     29test_zoom=get(hhcurrentfig.zoom,'Value');
    2730if ~exist('handles','var')
    2831   handles=get(gcbo,'UserData');
     
    3538        MouseAction=UvData.MouseAction;% set the mouse action (edit, create objects...)
    3639    end
    37     zoomstate=get(hhuvmat.zoom,'Value');
     40%     test_zoom=get(hhuvmat.zoom,'Value');
    3841end
    3942currentfig=hObject;
     
    206209end
    207210%zoom in by a factor 2 if no new figure is created
    208 if zoomstate
     211if test_zoom
    209212    xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
    210213     if  isequal(get(currentfig,'SelectionType'),'normal');%if left button has been pressed
     
    268271
    269272% editing calibration point
    270 if ~zoomstate && strcmp(MouseAction,'calib')
     273if ~test_zoom && strcmp(MouseAction,'calib')
    271274    h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI
    272275    hh_geometry_calib=guidata(h_geometry_calib);
     
    314317
    315318%display the data of the current object selected with the mouse right click
    316 if isequal(get(currentfig,'SelectionType'),'alt') && ~zoomstate && (~isfield(AxeData,'Drawing')||~isequal(AxeData.Drawing,'create'))
     319if isequal(get(currentfig,'SelectionType'),'alt') && ~test_zoom && (~isfield(AxeData,'Drawing')||~isequal(AxeData.Drawing,'create'))
    317320    hother=findobj('Tag','proj_object');%find all the proj objects
    318321    nbselect=0;
  • trunk/src/nc2struct.m

    r140 r150  
    6262    if ischar(nc)
    6363        if exist(nc,'file')
     64            try
    6465            nc=netcdf.open(nc,'NC_NOWRITE');
    6566            testfile=1;
     67            catch errormsg
     68              Data.Txt=['ERROR opening ' nc ': ' errormsg.identifier];
     69              return
     70            end
    6671        else
    6772           Data.Txt=['ERROR:file ' nc ' does not exist'];
  • trunk/src/plot_field.m

    r147 r150  
    231231end
    232232
    233 % set graph aspect ratio
    234 if isfield(AxeData,'Mesh')
    235     Data.Mesh=AxeData.Mesh;
    236 end
     233% % set graph aspect ratio
     234% if isfield(AxeData,'Mesh')
     235%     Data.Mesh=AxeData.Mesh;
     236% end
    237237
    238238%set(haxes,'UserData',AxeData)
     
    448448            hlegend=legend(legend_str);
    449449            txt=ver('MATLAB');
    450             Release=txt.Release
    451             relnumb=str2num(Release(3:4));% should be changed to Version for better compatibility
     450            Release=txt.Release;
     451            relnumb=str2double(Release(3:4));% should be changed to Version for better compatibility
    452452            if relnumb >= 14
    453453                set(hlegend,'Interpreter','none')% desable tex interpreter
     
    474474    txt=ver('MATLAB');
    475475    Release=txt.Release;
    476     relnumb=str2num(Release(3:4));
     476    relnumb=str2double(Release(3:4));
    477477    if relnumb >= 14
    478478        set(htitle,'Interpreter','none')% desable tex interpreter
     
    928928    vec_U=reshape(vec_U,1,numel(vec_U));
    929929    vec_V=reshape(vec_V,1,numel(vec_V));
    930     MinMaxX=max(vec_X)-min(vec_X);
    931     MinMaxY=max(vec_Y)-min(vec_Y);
    932     AxeData.Mesh=sqrt((MinMaxX*MinMaxY)/length(vec_X));
     930     MinMaxX=max(vec_X)-min(vec_X);
     931%     MinMaxY=max(vec_Y)-min(vec_Y);
     932%     AxeData.Mesh=sqrt((MinMaxX*MinMaxY)/length(vec_X));
    933933    if  ~isfield(PlotParam.Vectors,'AutoVec') || isequal(PlotParam.Vectors.AutoVec,0)|| ~isfield(PlotParam.Vectors,'VecScale')...
    934934               ||isempty(PlotParam.Vectors.VecScale)||~isa(PlotParam.Vectors.VecScale,'double') %automatic vector scale
     
    937937            indsel=find(AxeData.FF==0);%indsel =indices of good vectors
    938938        else     
    939             indsel=[1:numel(vec_X)];%
     939            indsel=1:numel(vec_X);%
    940940        end
    941941        if isempty(vec_U)
     
    977977   
    978978    %decimate by a factor 2 in vector mesh(4 in nbre of vectors)
    979     if isfield(PlotParam.Vectors,'decimate4')&isequal(PlotParam.Vectors.decimate4,1)
     979    if isfield(PlotParam.Vectors,'decimate4') && isequal(PlotParam.Vectors.decimate4,1)
    980980        diffy=diff(vec_Y); %difference dy=vec_Y(i+1)-vec_Y(i)
    981981        dy_thresh=max(abs(diffy))/2;
     
    983983        ind_sel=1:ind_jump(1);%select the first line
    984984        for i=2:2:length(ind_jump)-1
    985             ind_sel=[ind_sel [ind_jump(i)+1:ind_jump(i+1)]];% select the odd lines
     985            ind_sel=[ind_sel (ind_jump(i)+1:ind_jump(i+1))];% select the odd lines
    986986        end
    987987        nb_sel=length(ind_sel);
     
    10421042    AxeData.F=[];
    10431043     AxeData.FF=[];
    1044     AxeData.Mesh=[];
     1044%     AxeData.Mesh=[];
    10451045    PlotParamOut=rmfield(PlotParamOut,'Vectors');
    10461046end
     
    11691169      hx = [x1;x2;x3];
    11701170      hy = [y1;y2;y3];
    1171     tri=reshape([1:3*length(uc)],3,[])';
     1171    tri=reshape(1:3*length(uc),3,[])';
    11721172    d = tri(:,[1 2 3 1])';
    11731173   
  • trunk/src/proj_field.m

    r109 r150  
    8181
    8282function [ProjData,errormsg]=proj_field(FieldData,ObjectData,IndexObj)
    83 
     83errormsg=[];%default
    8484if isfield(ObjectData,'ProjMode') && (isequal(ObjectData.ProjMode,'none')||isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside'))
    8585    ProjData=[];
     
    170170        return
    171171end
    172 ProjData=proj_heading(FieldData,ObjectData);
     172[ProjData,errormsg]=proj_heading(FieldData,ObjectData);
    173173ProjData.NbDim=0;
    174174%ProjData.ListDimName= {'nb_points'};
     
    373373function  [ProjData,errormsg]=proj_patch(FieldData,ObjectData)%%
    374374%-------------------------------------------------------------------
    375 ProjData=proj_heading(FieldData,ObjectData);
     375[ProjData,errormsg]=proj_heading(FieldData,ObjectData);
    376376
    377377objectfield=fieldnames(ObjectData);
     
    560560function  [ProjData,errormsg] = proj_line(FieldData, ObjectData)
    561561%-----------------------------------------------------------------
    562 ProjData=proj_heading(FieldData,ObjectData);%transfer global attributes
     562[ProjData,errormsg]=proj_heading(FieldData,ObjectData);%transfer global attributes
     563if ~isempty(errormsg)
     564    return
     565end
    563566ProjData.NbDim=1;
    564 
    565567%initialisation of the input parameters and defaultoutput
    566568ProjMode='projection';%direct projection on the line by default
     
    991993
    992994% initiate Matlab  structure for physical field
    993 ProjData=proj_heading(FieldData,ObjectData);
     995[ProjData,errormsg]=proj_heading(FieldData,ObjectData);
    994996ProjData.NbDim=2;
    995997ProjData.ListVarName={};
     
    15611563
    15621564% initiate Matlab  structure for physical field
    1563 ProjData=proj_heading(FieldData,ObjectData);
     1565[ProjData,errormsg]=proj_heading(FieldData,ObjectData);
    15641566ProjData.NbDim=3;
    15651567%ProjData.ListDimName={};%name of dimension
     
    20642066% ProjData=FieldData;
    20652067ProjData=[];%default
     2068errormsg=[];%default
    20662069if ~isfield(FieldData,'ListGlobalAttribute')
    20672070    ProjData.ListGlobalAttribute={};
  • trunk/src/set_object.m

    r102 r150  
    772772function PLOT_Callback(hObject, eventdata, handles)
    773773
    774 %SetData=get(handles.set_object,'UserData');%get the hidden interface data
    775774huvmat=findobj('tag','uvmat');%find the current uvmat interface handle
    776775UvData=get(huvmat,'UserData');%Data associated to the GUI uvmat
     
    786785testnew=0;
    787786PlotHandles=get_plot_handles(hhuvmat);
     787projview='';
    788788if strcmp(ListObject{IndexObj_1},ObjectName)% we are editing the object whose projection is viewed in the uvmat frame
    789789   ObjectData.HandlesDisplay=hhuvmat.axes3;
    790790    IndexObj=IndexObj_1;
     791    projview='uvmat';
    791792elseif IndexObj_2<=numel(ListObject)&& strcmp(ListObject{IndexObj_2},ObjectName)% we are editing the object whose projection is viewed in view_field
    792793    hview_field=findobj('tag','view_field');
     
    796797    end
    797798    IndexObj=IndexObj_2;
     799    projview='view_field';
    798800else %new object
    799801    testnew=1;
     
    825827% update the object plot and projection field
    826828UvData.Object{IndexObj}=update_obj(UvData,IndexObj,ObjectData,PlotHandles);
    827 set(huvmat,'UserData',UvData)%update the data in the uvmat interface
     829if strcmp(projview,'view_field')
     830    ViewFieldData=get(hview_field,'UserData');
     831    ViewFieldData.axes3=ObjectData;
     832    set(hview_field,'UserData',ViewFieldData)
     833else
     834    UvData.axes3=ObjectData;
     835end
    828836
    829837%set uvmat to object edit mode to allow further object update
  • trunk/src/uvmat.m

    r147 r150  
    10141014    txt=ver('MATLAB');
    10151015    Release=txt.Release;
    1016     relnumb=str2num(Release(3:4));
     1016    relnumb=str2double(Release(3:4));
    10171017    if relnumb >= 14
    10181018        save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-V6'); %store the file names for future opening of uvmat
     
    21672167        FileType_1='vol';
    21682168        FieldName_1='image';
    2169     else 
     2169    elseif length(Ext_1)>1
    21702170       form=imformats(Ext_1(2:end));
    21712171       if ~isempty(form)% if the extension corresponds to an image format recognized by Matlab
     
    26882688IndexObj_2=get(handles.list_object_2,'Value');%selected projection object for the second view
    26892689if isequal(get(handles.list_object_2,'Visible'),'on') && IndexObj_2 <= numel(UvData.Object)&& ~isempty(UvData.Object{IndexObj_2})
     2690    UvData.Object{IndexObj_2}
    26902691    IndexObj(2)=IndexObj_2;
    26912692    view_field_handle=findobj(allchild(0),'tag','view_field');%handles of the view_field GUI
     
    27022703for imap=1:numel(IndexObj)
    27032704    iobj=IndexObj(imap);   
    2704     ObjectData=proj_field(UvData.Field,UvData.Object{iobj},iobj);% project field on the object
    2705    
     2705    [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj},iobj);% project field on the object
     2706    if ~isempty(errormsg)
     2707        return
     2708    end
    27062709    %use of mask (TODO: check)
    27072710    if isfield(ObjectData,'NbDim') && isequal(ObjectData.NbDim,2) && isfield(ObjectData,'Mask') && isfield(ObjectData,'A')
     
    27562759            [PlotType,PlotParamOut]=plot_field(ObjectData,haxes(imap),PlotParam{imap},keeplim(imap),PosColorbar{imap});
    27572760            write_plot_param(plot_handles{imap},PlotParamOut) %update the auto plot parameters
    2758             if imap==1
    2759                 UvData.ProjField=ObjectData;
     2761            if isfield(UvData,'Mesh')&~isempty(UvData.Mesh)
     2762                ObjectData.Mesh=UvData.Mesh; % gives an estimated mesh size (useful for mouse action on the plot)
     2763            end
     2764            if imap==1           
     2765                UvData.axes3=ObjectData;
    27602766            else
    27612767                ViewFieldData=get(view_field_handle,'UserData');
    2762                 ViewFieldData.ProjField=ObjectData;
     2768                ViewFieldData.axes3=ObjectData;
    27632769                set(view_field_handle,'UserData',ViewFieldData)
    27642770            end
     
    43594365%-------------------------------------------------------------------
    43604366haxes= handles.axes3;
    4361 AxeData=get(haxes,'UserData');
     4367UvData=get(handles.uvmat,'UserData');
     4368AxeData=UvData.axes3;
    43624369PlotParam=read_plot_param(handles);
    43634370[PlotType,PlotParamOut]= plot_field(AxeData,haxes,PlotParam,1);
     
    49364943    ind_opening=2;% propose 'fix' as the default option
    49374944% +read the current netcdf rootfile
    4938     Data=nc2struct(FileName,[]);
    4939     if isfield(Data,'fix') & isequal(Data.fix,1)
     4945    Data=nc2struct(FileName,'ListGlobalAttribute','fix','patch','civ2','fix2');
     4946    if isfield(Data,'fix') && isequal(Data.fix,1)
    49404947        ind_opening=3;
    49414948    end
    4942     if isfield(Data,'patch') & isequal(Data.patch,1)
     4949    if isfield(Data,'patch') && isequal(Data.patch,1)
    49434950        ind_opening=4;
    49444951    end
    4945     if isfield(Data,'civ2') & isequal(Data.civ2,1)
     4952    if isfield(Data,'civ2') && isequal(Data.civ2,1)
    49464953        ind_opening=5;
    49474954    end
    4948     if isfield(Data,'fix2') & isequal(Data.fix2,1)
     4955    if isfield(Data,'fix2') && isequal(Data.fix2,1)
    49494956        ind_opening=6;
    49504957    end
     
    49604967param.ImaExt=ext;
    49614968civ(param);% interface de civ(not in the uvmat file)
    4962 
     4969   
    49634970% ------------------------------------------------------------------
    49644971function MenuTools_Callback(hObject, eventdata, handles)
  • trunk/src/view_field.m

    r144 r150  
    1 
    21%'view_field': function associated with the GUI 'view_field.fig' for images and data field visualization
    32%------------------------------------------------------------------------
     
    6059
    6160% Choose default command menuline output for view_field
    62 handles.output = handles.axes3;
     61handles.output = handles.view_field;
    6362
    6463% Update handles structure
     
    9291
    9392[PlotType,PlotParamOut]= plot_field(Field,handles.axes3);%,PlotParam,KeepLim,PosColorbar)
    94 set(handles.axes3,'UserData',Field);%store the current field
     93ViewFieldData.axes3=Field;
     94set(handles.view_field,'UserData',ViewFieldData);%store the current field
     95get(handles.view_field)
    9596if isfield(PlotParamOut,'Vectors')
    9697    set(handles.VECT_title,'Visible','on')
     
    692693
    693694%-------------------------------------------------------------------
    694 function [PlotType,ScalOut]=update_plot(handles)
     695function PlotType=update_plot(handles)
    695696%-------------------------------------------------------------------
    696697haxes= handles.axes3;
     
    708709global Data_view_field
    709710% huvmat=findobj(allchild(0),'Name','uvmat');
    710 Data_view_field=get(handles.axes3,'UserData');
     711Data_view_field=get(handles.view_field,'UserData');
     712Data_view_field=Data_view_field.axes3;
    711713% Data_view_field=UvData.ProjField_2;
    712714evalin('base','global Data_view_field')%make CurData global in the workspace
     
    775777function closefcn(hObject, eventdata, handles)
    776778huvmat=findobj(allchild(0),'Name','uvmat');
     779if ~isempty(huvmat)
    777780hhuvmat=guidata(huvmat);
    778781list_object_2=get(hhuvmat.list_object_2,'String');
    779782set(hhuvmat.list_object_2,'Value',numel(list_object_2))%select the last value ('...')
     783end
    780784delete(hObject)
    781 
    782785
    783786
    784787% --- Executes on selection change in popupmenu18.
    785788function popupmenu18_Callback(hObject, eventdata, handles)
    786 
    787 
    788 function edit91_Callback(hObject, eventdata, handles)
    789 % hObject    handle to edit91 (see GCBO)
    790 % eventdata  reserved - to be defined in a future version of MATLAB
    791 % handles    structure with handles and user data (see GUIDATA)
    792 
    793 % Hints: get(hObject,'String') returns contents of edit91 as text
    794 %        str2double(get(hObject,'String')) returns contents of edit91 as a double
    795 
    796 
    797 % --- Executes on button press in checkbox45.
    798 function checkbox45_Callback(hObject, eventdata, handles)
    799 % hObject    handle to checkbox45 (see GCBO)
    800 % eventdata  reserved - to be defined in a future version of MATLAB
    801 % handles    structure with handles and user data (see GUIDATA)
    802 
    803 % Hint: get(hObject,'Value') returns toggle state of checkbox45
    804 
    805 
    806 % --- Executes on selection change in popupmenu19.
    807 function popupmenu19_Callback(hObject, eventdata, handles)
    808 % hObject    handle to popupmenu19 (see GCBO)
    809 % eventdata  reserved - to be defined in a future version of MATLAB
    810 % handles    structure with handles and user data (see GUIDATA)
    811 
    812 % Hints: contents = get(hObject,'String') returns popupmenu19 contents as cell array
    813 %        contents{get(hObject,'Value')} returns selected item from popupmenu19
    814 
    815 
    816 
    817 
    818789
    819790
Note: See TracChangeset for help on using the changeset viewer.