Changeset 511


Ignore:
Timestamp:
Aug 2, 2012, 3:12:48 PM (9 years ago)
Author:
sommeria
Message:

cleaning of uvmat and related fcts

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_up.m

    r483 r511  
    143143                    else
    144144                        hhview_field=guidata(hview_field);
    145                         [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing  plot in view_field
     145                        [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%update an existing  plot in view_field
    146146                        write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
    147147                    end
    148148                    ViewFieldData=get(hview_field,'UserData');
    149                     %                     ViewFieldData.axes3=ProjData;
     149                    %                     ViewFieldData.PlotAxes=ProjData;
    150150                    haxes=findobj(hview_field,'tag','axes3');
    151151                    if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table)
     
    160160                    end
    161161                else
    162                     UvData.axes3=ProjData;
    163                     [PlotType,PlotParam]=plot_field(ProjData,hhuvmat.axes3,read_GUI(hhuvmat));%update an existing field plot
     162                    UvData.PlotAxes=ProjData;
     163                    [PlotType,PlotParam]=plot_field(ProjData,hhuvmat.PlotAxes,read_GUI(hhuvmat));%update an existing field plot
    164164                    write_plot_param(hhuvmat,PlotParam); %update the display of plotting parameters for the current object
    165165                end
  • trunk/src/plot_field.m

    r501 r511  
    255255if ~isempty(index_2D)|| ~isempty(index_1D)
    256256    FigData=get(hfig,'UserData');
    257 %     if strcmp(get(hfig,'tag'),'view_field')
    258 %         set(hfig,'UserData',[]); % refresh user data in view_field (set by civ/TestCiv )
    259 %     end
    260     tagaxes=get(haxes,'tag');% tag of the current plot axis
    261     if isfield(FigData,tagaxes)
    262         FigData.(tagaxes)=Data;
     257    if strcmp(get(hfig,'tag'),'view_field')||strcmp(get(hfig,'tag'),'uvmat')
     258        FigData.(get(haxes,'tag'))=Data;
    263259        set(hfig,'UserData',FigData)
    264260    end
  • trunk/src/series/merge_proj.m

    r494 r511  
    225225                end
    226226            end
    227             if strcmp(Param.ProjObject.ProjMode,'filter')
    228                 check_tps=1;
    229             end
    230             if check_tps
    231                 SubDomain=1500; %default, estimated nbre of vectors in a subdomain used for tps
    232                 if isfield(Data{iview},'SubDomain')
    233                     SubDomain=Data{iview}.SubDomain;%
    234                 end
    235                 [Data{iview}.SubRange,Data{iview}.NbSites,Data{iview}.Coord_tps,Data{iview}.U_tps,Data{iview}.V_tps,tild,U_smooth,V_smooth,W_smooth,FF] =...
    236                     filter_tps([Data{iview}.X(Data{iview}.FF==0) Data{iview}.Y(Data{iview}.FF==0)],Data{iview}.U(Data{iview}.FF==0),Data{iview}.V(Data{iview}.FF==0),[],SubDomain,0);
    237                 nbvar=numel(Data{iview}.ListVarName);
    238                 Data{iview}.ListVarName=[Data{iview}.ListVarName {'SubRange','NbSites','Coord_tps','U_tps','V_tps'}];
    239                 Data{iview}.VarDimName=[Data{iview}.VarDimName {{'nb_coord','nb_bounds','nb_subdomain'},{'nb_subdomain'},...
    240                     {'nb_tps','nb_coord','nb_subdomain'},{'nb_tps','nb_subdomain'},{'nb_tps','nb_subdomain'}}];
    241                 Data{iview}.VarAttribute{nbvar+3}.Role='coord_tps';
    242                 Data{iview}.VarAttribute{nbvar+4}.Role='vector_x';
    243                 Data{iview}.VarAttribute{nbvar+5}.Role='vector_y';
    244                 if isfield(Data{iview},'ListDimName')%cleaning
    245                     Data{iview}=rmfield(Data{iview},'ListDimName');
    246                 end
    247                 if isfield(Data{iview},'DimValue')%cleaning
    248                     Data{iview}=rmfield(Data{iview},'DimValue');
    249                 end
     227            if ~isempty(Param.ProjObject)&& strcmp(Param.ProjObject.ProjMode,'filter')&&~isfield(Data{iview},'Coord_tps')
     228                Data{iview}=calc_tps(Data{iview});
    250229            end
    251230                 
  • trunk/src/set_object.m

    r508 r511  
    192192        set(hhuvmat.ListObject,'Value',ObjIndex)
    193193        % draw all object colors in blue (unselected) in uvmat
    194         hother=[findobj(hhuvmat.axes3,'Tag','proj_object');findobj(hhuvmat.axes3,'Tag','DeformPoint')];%find all the proj object and deform point representations
     194        hother=[findobj(hhuvmat.PlotAxes,'Tag','proj_object');findobj(hhuvmat.PlotAxes,'Tag','DeformPoint')];%find all the proj object and deform point representations
    195195        for iobj=1:length(hother)
    196196            if isequal(get(hother(iobj),'Type'),'rectangle')||isequal(get(hother(iobj),'Type'),'patch')
     
    475475    UvData.Object{IndexObj}.DisplayHandle.uvmat=obj_handle; %preserve the object plot handle if valid
    476476else
    477     UvData.Object{IndexObj}.DisplayHandle.uvmat=hhuvmat.axes3; %axes taken as object display handle by defualt
     477    UvData.Object{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; %axes taken as object display handle by defualt
    478478end
    479479%set(hhuvmat.edit_object,'Value',1)% set the current object to edit mode
     
    496496    end   
    497497    if isequal(IndexObj_1,IndexObj) % if  the projection is in uvmat
    498          PlotType=plot_field(ProjData,hhuvmat.axes3,read_GUI(get(hhuvmat.axes3,'parent')));%update the current uvmat plot
     498         PlotType=plot_field(ProjData,hhuvmat.PlotAxes,read_GUI(get(hhuvmat.PlotAxes,'parent')));%update the current uvmat plot
    499499    else  % if the projection is in view_field
    500500        hview_field=findobj(allchild(0),'tag','view_field');
     
    503503        else
    504504            hhview_field=guidata(hview_field);
    505             [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing  plot in view_field
     505            [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%update an existing  plot in view_field
    506506            write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
    507507        end
  • trunk/src/uvmat.m

    r508 r511  
    2828%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    2929%
    30 % Information stored on the interface:
    31 %    'Strings' of all edit boxes and menus: get(handles.Tag,'String')
    32 %    'Values' of all menus and toggle buttons: get(handles.Tag,'Value')
    33 %     Matlab structure called UvData stored as 'UserData' of the figure uvmat.fig,(can be obtained by right mouse click on the interface).
    34 %          It contains the following fields:
    35 %     - Fixed specifiacation of plotting figures and axes (defined bu uvmat_OpeningFcn)
    36 %          .PosColorbar: [0.8210 0.4710 0.0190 0.4450]; specified position of the colorbar on figures
    37 %     - Information read in the documentation open of a series (activated by RootPath_Callback) :
    38 %          .XmlData, with fields:
    39 %               .Time: matrix of times of the images with index i and j
    40 %               .GeometryCalib: [1x1 struct]
    41 %     - Information defined from the interface:
    42 %           .NewSeries: =1 when the first view of a new field series is displayed, else 0
    43 %           .FileName:(char string)
    44 %           .FieldName: (char string) main field selected('image', 'velocity'...)
    45 %           .CName: (char string)name of the scalar used for vector colors
    46 %          .MovieObject{1}: movie object representing an input movie
    47 %          .MovieObject{2}: idem for a second input series (_1)
    48 %          .FileName_1 : last second input file name (to deal with a constant second input without reading again the file)
    49 %          .ZMin, .ZMax: range of the z coordinate
    50 %..... to complement
    51 %     - Information on  projection objects
    52 %           .Object: {[1x1 struct]}
    53 %           .CurrentObjectIndex: index of the projection object .Object currently selected for editing
    54 %     -Information on the current field (Field{i})
    55 %            .Txt : text information to display (e.g. error message)
    56 %            .NbDim: number of dimensions (=0 by default)
    57 %            .NbCoord: number of vector components
    58 %            .CoordType: expresses the type of coordinate ('px' for image, 'sig' for instruments, or 'phys')
    59 %            .dt: time interval for the corresponding image pair
    60 %            .Mesh: estimated typical distance between vectors
    61 %            .ZMax:
    62 %            .ZMin:
    63 %            .X, .Y, .Z: set of vector coordinates
    64 %            .U,.V,.W: corresponding set of vector components
    65 %            .F: corresponding set of warning flags
    66 %            .FF: corresponding set of false flags, =0 for good vectors
    67 %            .C: corresponding values of the scalar used for vector color
    68 %             (.X, .Y, .Z,.U,.V,.W,.F,.FF,.C are matlab vectors of the same length,
    69 %                     equal to the number of vectors stored in the input open)
    70 %            .CName: name of the scalar .C
    71 %            .CType: type of the scalar .C, setting how the scalar is obtained (see 'Scalars' below)
    72 %            .A image or scalar
    73 %            .AX: vector of dimension 2 representing the first and last values
    74 %              of the X coordinates for the image or scalar known on a regular grid,
    75 %              or vector of dimension .A for a scaler defined on irregular grid.
    76 %            .AY: same as .AX along the Y direction
    77 %            .AName: name of the scalar, ='image' for an image
     30% Information stored on the interface:(use 'Export/field in workspace' in
     31% the menu bar of uvmat to retrieve it)
     32%          .OpenParam: structure containing parameters defined when uvmat is opened
     33%                       .PosColorbar: position (1x4 vector)of the colorbar (relative to the fig uvmat)
     34%                       .PosSetObject: position of set_object
     35%                       .PosGeometryCalib: size of set_object
     36%                       .NbBuiltin: nbre of functions always displayed in transform_fct menu
     37%          .Object: cell array of structures representing the current projection objects, as produced by 'set_object.m'={[]} by default
     38%          .NewSeries: =0/1 flag telling whether a new field series has been opened
     39%          .FileName_1: name of the current second field (used to detect a  constant field during file scanning)
     40%          .FileType: current file type, as defined by the fct  get_file_type.m)
     41%          .i1_series,.i2_series,.j1_series,.j1_series: series of i1,i2,j1,j2 indices detected in the input dir,set by  the fct find_file_series
     42%          .MovieObject: current movie object
     43%          .TimeUnit: unit for time
     44%          .XmlData: cell array of 1 or 2 structures representing the xml files associated with the input fields (containing timing  and geometry calibration)
     45%          .Field: cell array of 1 or 2 structures representing the current  input field(s)
     46%          .PlotAxes: field structure representing the current field plotted  on the main axes  (used for mouse operations)
     47%          .HistoAxes: idem for histogram axes
    7848
    7949% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   DATA FLOW  (for run0_Callback) %%%%%%%%%%%%%%%%%%%%:
     
    11181%                                                                    |
    11282% plot_field.m: plot the projected fields and store them as          |
    113 % UvData.axes3                                        |
     83% UvData.PlotAxes                                        |
    11484%                                                                    |
    11585%                                                                AxeData
     
    214184movegui(hObject,'center')
    215185UvData.OpenParam.PosColorbar=[0.805 0.022 0.019 0.445];
    216 UvData.OpenParam.SetObjectOrigin=[-0.05 -0.03]; %position for set_object
    217 UvData.OpenParam.SetObjectSize=[0.3 0.7];
    218 UvData.OpenParam.CalOrigin=[0.95 -0.03];%position for geometry_calib (TO IMPROVE)
    219 UvData.OpenParam.CalSize=[0.28 1];
    220 UvData.axes3=[];%initiate the record of plotted field
    221 UvData.axes2=[];
    222 UvData.axes1=[];
     186UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object
     187UvData.OpenParam.PosGeometryCalic=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE)
     188% UvData.OpenParam.CalSize=[0.28 1];
     189% UvData.PlotAxes=[];%initiate the record of plotted field
     190% UvData.axes2=[];
     191% UvData.axes1=[];
    223192AxeData.LimEditBox=1; %initialise AxeData
    224 set(handles.axes3,'UserData',AxeData)
     193set(handles.PlotAxes,'UserData',AxeData)
    225194
    226195%% set functions for the mouse and keyboard
     
    231200set(hObject,'DeleteFcn',{@closefcn})%
    232201
    233 %% refresh projection plane
     202%% initialisation
    234203% set(handles.ListObject,'Value',1)% default: empty projection objectproj_field
    235204% set(handles.ListObject,'String',{''})
     
    238207set(handles.Fields,'Value',1)
    239208set(handles.Fields,'string',{''})
     209UvData.Object={[]};
    240210
    241211%% TRANSFORM menu: builtin fcts
     
    332302if testinputfield
    333303    %delete drawn objects
    334     hother=findobj(handles.axes3,'Tag','proj_object');%find all the proj objects
     304    hother=findobj(handles.PlotAxes,'Tag','proj_object');%find all the proj objects
    335305    for iobj=1:length(hother)
    336306        delete_object(hother(iobj))
     
    806776UvData=get(handles.uvmat,'UserData');%huvmat=handles of the uvmat interface
    807777UvData.NewSeries=1; %flag for run0: begin a new series
    808 UvData.TestInputFile=1;
     778UvData.FileName_1='';% name of the current second field (used to detect a  constant field during file scanning)
    809779UvData.FileType{index}=FileType;
    810780UvData.i1_series{index}=i1_series;
     
    10591029    end
    10601030    if isequal (diff_ref_i,diff_ref_i(1)*ones(size(diff_ref_i)))
    1061         set(handles.increment_scan,'String',num2str(diff_ref_i(1)))
     1031        set(handles.num_IndexIncrement,'String',num2str(diff_ref_i(1)))
    10621032    end
    10631033     set(handles.scan_i,'Value',1)
     
    10691039    end
    10701040    if isequal (diff_ref_j,diff_ref_j(1)*ones(size(diff_ref_j)))
    1071         set(handles.increment_scan,'String',num2str(diff_ref_j(1)))
     1041        set(handles.num_IndexIncrement,'String',num2str(diff_ref_j(1)))
    10721042    end
    10731043     set(handles.scan_j,'Value',1)
     
    13951365%             uistack(hmask,'top')
    13961366        else
    1397             axes(handles.axes3)
     1367            axes(handles.PlotAxes)
    13981368            hold on   
    13991369            size(flagmask)
     
    14201390drawnow
    14211391%TODO: introduce the option: increment ='*' to move to the next available view
    1422 increment=str2num(get(handles.increment_scan,'String')); %get the field increment d
     1392increment=str2num(get(handles.num_IndexIncrement,'String')); %get the field increment d
    14231393% if isnan(increment)
    1424 %     set(handles.increment_scan,'String','1')%default value
     1394%     set(handles.num_IndexIncrement,'String','1')%default value
    14251395%     increment=1;
    14261396% end
     
    14391409set(handles.runmin,'BackgroundColor',[1 1 0])%paint the command button in yellow
    14401410drawnow
    1441 increment=-str2num(get(handles.increment_scan,'String')); %get the field increment d
     1411increment=-str2num(get(handles.num_IndexIncrement,'String')); %get the field increment d
    14421412% if isnan(increment)
    1443 %     set(handles.increment_scan,'String','1')%default value
     1413%     set(handles.num_IndexIncrement,'String','1')%default value
    14441414%     increment=1;
    14451415% end
     
    14561426set(handles.Movie,'BackgroundColor',[1 1 0])%paint the command button in yellow
    14571427drawnow
    1458 increment=str2num(get(handles.increment_scan,'String')); %get the field increment d
     1428increment=str2num(get(handles.num_IndexIncrement,'String')); %get the field increment d
    14591429% if isnan(increment)
    1460 %     set(handles.increment_scan,'String','1')%default value
     1430%     set(handles.num_IndexIncrement,'String','1')%default value
    14611431%     increment=1;
    14621432% end
     
    14871457set(handles.MovieBackward,'BackgroundColor',[1 1 0])%paint the command button in yellow
    14881458drawnow
    1489 increment=-str2num(get(handles.increment_scan,'String')); %get the field increment d
     1459increment=-str2num(get(handles.num_IndexIncrement,'String')); %get the field increment d
    14901460set(handles.STOP,'Visible','on')
    14911461set(handles.speed,'Visible','on')
     
    15541524     [InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileIndex_1,InputFile.FileExt_1,InputFile.NomType_1]=read_file_boxes_1(handles);   
    15551525    [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(InputFile.FileIndex_1);
    1556 %     InputFile.NomType_1=get(handles.NomType_1,'String');
    15571526else
    15581527    filename_1=[];
     
    15851554    end
    15861555   
    1587 % the pair i1-i2 or j1-j2 is free (check box CheckFixPair not selected):
    1588 % the list of existing indices recorded in UvData is used
     1556% the pair i1-i2 or j1-j2 is free (check box CheckFixPair not selected): the list of existing indices recorded in UvData is used
    15891557else
    15901558    UvData=get(handles.uvmat,'UserData');
     
    16071575        end
    16081576    else % free increment
    1609         if isequal(get(handles.runplus,'BackgroundColor'),[1 1 0])% if runplus is activated
     1577        runaction=get(gcbo,'tag');
     1578        if strcmp(runaction,'runplus')||strcmp(runaction,'Movie')% if runplus or movie is activated
    16101579            step=1;
    16111580        else
     
    16291598        errormsg='minimum j index reached';
    16301599    elseif ref_i+1>size(UvData.i1_series{1},1)
    1631         errormsg='maximum i index reached';
     1600        errormsg='maximum i index reached (reload the input file to update the index bound)';
    16321601    elseif ref_j+1>size(UvData.i1_series{1},2)
    1633         errormsg='maximum j index reached';
    1634     end
    1635     if ~isempty(errormsg)
    1636         return
    1637     end
     1602        errormsg='maximum j index reached (reload the input file to update the index bound)';
     1603    end
     1604    if ~isempty(errormsg),return,end
    16381605    i1_subseries=UvData.i1_series{1}(ref_i+1,ref_j+1,:);
    16391606    i1_subseries=i1_subseries(i1_subseries>0);
    1640     if isempty(i1_subseries)
    1641         errormsg='no next file';
    1642         return
     1607    if isempty(i1_subseries)% case of pairs
     1608        i1_subseries=UvData.i1_series{1}(ref_i+1,:,:);
     1609    end
     1610    if isempty(i1_subseries),errormsg='no next frame: set num_IndexIncrement =''*'' to reach the next existing file';return
    16431611    else
    16441612        i1=i1_subseries(end);
     
    18501818
    18511819 % make movie until movie speed is set to 0 or STOP is activated
    1852 hima=findobj(handles.axes3,'Tag','ima');% %handles.axes3 =main plotting window (A GENERALISER)
     1820hima=findobj(handles.PlotAxes,'Tag','ima');% %handles.PlotAxes =main plotting window (A GENERALISER)
    18531821set(handles.STOP,'Visible','on')
    18541822set(handles.speed,'Visible','on')
     
    23132281%% check whether tps is needed, then calculate tps coefficients if needed
    23142282check_proj_tps=0;
    2315 if isfield(UvData,'Object')&& (strcmp(UvData.FileType{1},'civdata')||strcmp(UvData.FileType{1},'civx'))
     2283if (strcmp(UvData.FileType{1},'civdata')||strcmp(UvData.FileType{1},'civx'))
    23162284    for iobj=1:numel(UvData.Object)
    23172285        if isfield(UvData.Object{iobj},'ProjMode')&& strcmp(UvData.Object{iobj}.ProjMode,'filter')
     
    24752443    end
    24762444    % default projection plane
    2477     if ~isfield(UvData,'Object')||isempty(UvData.Object{1})
     2445    if isempty(UvData.Object{1})
    24782446        UvData.Object{1}.Type='plane';%main plotting plane
    24792447        UvData.Object{1}.ProjMode='projection';%main plotting plane
     
    25382506    set(handles.ListObject_1_title,'Visible','off')
    25392507    set(handles.ListObject_1,'Visible','off')
    2540     [PlotType,PlotParamOut]=plot_field(UvData.Field,handles.axes3,read_GUI(handles.uvmat));
     2508    [PlotType,PlotParamOut]=plot_field(UvData.Field,handles.PlotAxes,read_GUI(handles.uvmat));
    25412509    write_plot_param(handles,PlotParamOut) %update the auto plot parameters
    25422510   
     
    25732541        haxes(1)=UvData.plotaxes;
    25742542    else
    2575         haxes(1)=handles.axes3;
     2543        haxes(1)=handles.PlotAxes;
    25762544    end
    25772545    PlotParam{1}=read_GUI(handles.uvmat);
     
    25932561        if ~isempty(view_field_handle)
    25942562            plot_handles{2}=guidata(view_field_handle);
    2595             haxes(2)=plot_handles{2}.axes3;
     2563            haxes(2)=plot_handles{2}.PlotAxes;
    25962564            PlotParam{2}=read_GUI(handles.uvmat);%read plotting parameters on the uvmat interface
    25972565            PosColorbar{2}='*'; %TODO: deal with colorbar position on view_field
     
    27322700histo_value=get(handles.histo1_menu,'Value');
    27332701FieldName=histo_menu{histo_value};
    2734 % update_histo(handles.histo_u,handles.uvmat,FieldName)
     2702% update_histo(handles.HistoAxes,handles.uvmat,FieldName)
    27352703%
    27362704% %------------------------------------------------------------------------
     
    27772745    Amax=double(max(max(max(FieldHisto))));%max of field value
    27782746    if isequal(Amin,Amax)
    2779         cla(handles.histo_u)
     2747        cla(handles.HistoAxes)
    27802748    else
    27812749        Histo.ListVarName={FieldName,'histo'};
     
    28132781            end
    28142782        end
    2815         plot_field(Histo,handles.histo_u);
     2783        plot_field(Histo,handles.HistoAxes);
    28162784        hlegend=legend;
    28172785        if isempty(FieldName_2)
     
    28202788            set(hlegend,'String',{FieldName;FieldName_2})
    28212789        end
    2822 %         hh=get(handles.histo_u,'children');
     2790%         hh=get(handles.HistoAxes,'children');
    28232791%         get(hh(1))
    28242792%         get(hh(2))
     
    29252893    end
    29262894    netcdf.endDef(nc);
    2927     netcdf.putVar(nc,varid,UvData.axes3.FF);
     2895    netcdf.putVar(nc,varid,UvData.PlotAxes.FF);
    29282896    netcdf.close(nc); 
    29292897else %old netcdf library
     
    33703338    [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface with action on haxes,
    33713339                                                      % associate the set_object interface handle to the plotting axes
    3372     if isfield(UvData.OpenParam,'SetObjectOrigin')                                               
    3373     pos_uvmat=get(handles.uvmat,'Position');
    3374     pos_set_object(1:2)=UvData.OpenParam.SetObjectOrigin + pos_uvmat(1:2);
    3375     pos_set_object(3:4)=UvData.OpenParam.SetObjectSize .* pos_uvmat(3:4); 
    3376     set(hset_object,'Position',pos_set_object)
    3377     end
     3340    set(hset_object,'Position',get(handles.uvmat,'Position')+UvData.OpenParam.PosSetObject)
    33783341    UvData.MouseAction='create_object';
    33793342else
    33803343    set(handles.VOLUME,'BackgroundColor',[0 1 0])
    3381 %     UvData.MouseAction='none';
    33823344end
    33833345set(handles.uvmat,'UserData',UvData)
     
    39733935%-------------------------------------------------------------------
    39743936UvData=get(handles.uvmat,'UserData');
    3975 AxeData=UvData.axes3;% retrieve the current plotted data
     3937AxeData=UvData.PlotAxes;% retrieve the current plotted data
    39763938PlotParam=read_GUI(handles.uvmat);
    3977 [tild,PlotParamOut]= plot_field(AxeData,handles.axes3,PlotParam);
     3939[tild,PlotParamOut]= plot_field(AxeData,handles.PlotAxes,PlotParam);
    39783940write_plot_param(handles,PlotParamOut); %update the auto plot parameters
    39793941
     
    39923954%% update the projection plot on uvmat
    39933955ProjData= proj_field(UvData.Field,ObjectData);%project the current input field on object ObjectData
    3994 plot_field(ProjData,handles.axes3,read_GUI(handles.uvmat));% plot the projected field;
     3956plot_field(ProjData,handles.PlotAxes,read_GUI(handles.uvmat));% plot the projected field;
    39953957%replot all the objects within the new projected field
    39963958for IndexObj=1:numel(list_str)
     
    39983960        hobject=UvData.Object{IndexObj}.DisplayHandle.uvmat
    39993961        if isempty(hobject) || ~ishandle(hobject)
    4000             hobject=handles.axes3
     3962            hobject=handles.PlotAxes
    40013963        end
    40023964        if isequal(IndexObj,get(handles.ListObject,'Value'))
     
    40544016hview_field=findobj(allchild(0),'tag','view_field');
    40554017if isempty(hview_field)
    4056     hhview_field.axes3=[];
     4018    hhview_field.PlotAxes=[];
    40574019else
    40584020    Data=get(hview_field,'UserData');
    40594021    hhview_field=guidata(hview_field);
    40604022    ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData
    4061     [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%read plotting parameters on the uvmat interfachhview_fiel
     4023    [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%read plotting parameters on the uvmat interfachhview_fiel
    40624024    write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
    40634025    haxes=findobj(hview_field,'tag','axes3');
     
    40754037
    40764038%% update the color of the graphic object representation: the selected object in magenta, others in blue
    4077 update_object_color(handles.axes3,hhview_field.axes3,UvData.Object{IndexObj}.DisplayHandle.uvmat)
     4039update_object_color(handles.PlotAxes,hhview_field.PlotAxes,UvData.Object{IndexObj}.DisplayHandle.uvmat)
    40784040
    40794041%------------------------------------------------------------------------
     
    42544216    end
    42554217    hhview_field=guidata(hview_field);
    4256     [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%read plotting parameters on the GUI view_field);
     4218    [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%read plotting parameters on the GUI view_field);
    42574219    write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
    42584220    haxes=findobj(hview_field,'tag','axes3');
     
    43104272% huvmat=get(handles.MenuExport,'parent');
    43114273hfig=figure;
    4312 copyobj(handles.axes3,hfig);
    4313 map=colormap(handles.axes3);
     4274copyobj(handles.PlotAxes,hfig);
     4275map=colormap(handles.PlotAxes);
    43144276colormap(map);%transmit the current colormap to the zoom fig
    43154277colorbar
     
    43194281answer=msgbox_uvmat('CONFIRMATION','select a figure/axis on which the current uvmat plot will be exported')
    43204282if strcmp(answer,'Yes')
    4321 hchild=get(handles.axes3,'children');
     4283hchild=get(handles.PlotAxes,'children');
    43224284copyobj(hchild,gca);
    43234285end
     
    43624324%display first view for tests
    43634325newfig=figure;
    4364 newaxes=copyobj(handles.axes3,newfig);%new plotting axes in the new figure
     4326newaxes=copyobj(handles.PlotAxes,newfig);%new plotting axes in the new figure
    43654327set(newaxes,'Tag','movieaxes')
    43664328nbpix=[512 384]*str2double(answer{3});
    43674329set(gcf,'Position',[1 1 nbpix])% resolution XVGA
    43684330set(newaxes,'Position',eval(answer{4}));
    4369 map=colormap(handles.axes3);
     4331map=colormap(handles.PlotAxes);
    43704332colormap(map);%transmit the current colormap to the zoom fig
    43714333msgbox_uvmat('INPUT_Y-N',{['adjust figure ' num2str(newfig) ' with its matlab edit menu '] ;...
     
    43734335UvData.plotaxes=newaxes;% the axis in the new figure becomes the current main plotting axes
    43744336set(huvmat,'UserData',UvData);
    4375 increment=str2num(get(handles.increment_scan,'String')); %get the field increment d
     4337increment=str2num(get(handles.num_IndexIncrement,'String')); %get the field increment d
    43764338set(handles.STOP,'Visible','on')
    43774339set(handles.speed,'Visible','on')
     
    44034365aviobj=close(aviobj);
    44044366UvData=rmfield(UvData,'plotaxes');
    4405 %UvData.Object{1}.plotaxes=handles.axes3;
     4367%UvData.Object{1}.plotaxes=handles.PlotAxes;
    44064368set(huvmat,'UserData',UvData);
    44074369msgbox_uvmat('CONFIRMATION',{['movie ' aviname ' created '];['with ' num2str(imax) ' frames']})
     
    45104472UvData=get(handles.uvmat,'UserData');
    45114473UvData.Object{IndexObj}=[]; %create a new empty object
    4512 UvData.Object{IndexObj}.DisplayHandle.uvmat=handles.axes3; % axes for plot_object
     4474UvData.Object{IndexObj}.DisplayHandle.uvmat=handles.PlotAxes; % axes for plot_object
    45134475UvData.Object{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation
    45144476data.Name=data.Type;% default name=type
     
    46264588if isfield(UvData.OpenParam,'CalOrigin')
    46274589    pos_uvmat=get(handles.uvmat,'Position');
    4628     pos_cal(1)=pos_uvmat(1)+UvData.OpenParam.CalOrigin(1)*pos_uvmat(3);
    4629     pos_cal(2)=pos_uvmat(2)+UvData.OpenParam.CalOrigin(2)*pos_uvmat(4);
    4630     pos_cal(3:4)=UvData.OpenParam.CalSize .* pos_uvmat(3:4);
     4590    pos_cal(1)=pos_uvmat(1)+UvData.OpenParam.PosGeometryCalib(1)*pos_uvmat(3);
     4591    pos_cal(2)=pos_uvmat(2)+UvData.OpenParam.PosGeometryCalib(2)*pos_uvmat(4);
     4592    pos_cal(3:4)=UvData.OpenParam.PosGeometryCalib(3:4).* pos_uvmat(3:4);
    46314593end
    46324594geometry_calib(FileName,pos_cal);% call the geometry_calib interface   
     
    47984760end
    47994761if isequal(get(handles.scan_i,'Value'),1)
    4800     param.incr_i=str2num(get(handles.increment_scan,'String'));
     4762    param.incr_i=str2num(get(handles.num_IndexIncrement,'String'));
    48014763elseif isequal(get(handles.scan_j,'Value'),1)
    4802     param.incr_j=str2num(get(handles.increment_scan,'String'));
     4764    param.incr_j=str2num(get(handles.num_IndexIncrement,'String'));
    48034765end
    48044766param.list_fields=get(handles.Fields,'String');% list menu fields
     
    48444806ProjectDir = uigetdir(fileparts(fileparts(RootPath)), 'select the project source directory');
    48454807datatree_browser(ProjectDir)
    4846 
    4847 
    4848 
  • trunk/src/view_field.m

    r432 r511  
    7676set(handles.view_field,'UserData',ViewFieldData);%store the initial fig size in UserData
    7777AxeData.LimEditBox=1; %initialise AxeData, the parent figure sets plot parameters
    78 set(handles.axes3,'UserData',AxeData)
     78set(handles.PlotAxes,'UserData',AxeData)
    7979if exist('Field','var')
    80     [PlotType,PlotParamOut]= plot_field(Field,handles.axes3);%,PlotParam,KeepLim,PosColorbar)
     80    [PlotType,PlotParamOut]= plot_field(Field,handles.PlotAxes);%,PlotParam,KeepLim,PosColorbar)
    8181    set(handles.Coordinates,'Visible','on')
    8282    if isfield(PlotParamOut,'Vectors')
     
    149149pos(3)=max(1,pos_1(1)-pos(1)-bord(3));
    150150pos(4)=max(1,size_fig(4)-bord(4));
    151 set(handles.axes3,'Position',pos)
     151set(handles.PlotAxes,'Position',pos)
    152152
    153153%------------------------------------------------------------------------
     
    157157%------------------------------------------------------------------------
    158158varargout{1} = handles.output;% the only output argument is the handle to the GUI figure
    159 varargout{2} = strcmp(get(handles.axes3,'Visible'),'on');% check active plot axis
     159varargout{2} = strcmp(get(handles.PlotAxes,'Visible'),'on');% check active plot axis
    160160
    161161%------------------------------------------------------------------------
     
    280280%             uistack(hmask,'top')
    281281        else
    282             axes(handles.axes3)
     282            axes(handles.PlotAxes)
    283283            hold on   
    284284            MaskData.maskhandle=image(Mask.AX,Mask.AY,imflag,'Tag','mask','HitTest','off','AlphaData',0.6*flagmask);
     
    296296UvData=get(huvmat,'UserData');
    297297hfig=figure;
    298 newaxes=copyobj(handles.axes3,hfig);
    299 map=colormap(handles.axes3);
     298newaxes=copyobj(handles.PlotAxes,hfig);
     299map=colormap(handles.PlotAxes);
    300300colormap(map);%transmit the current colormap to the zoom fig
    301301colorbar
     
    774774AxeData=Data.axes3;% retrieve the current plotted data
    775775PlotParam=read_GUI(handles.view_field);
    776 [PP,PlotParamOut]= plot_field(AxeData,handles.axes3,PlotParam);
     776[PP,PlotParamOut]= plot_field(AxeData,handles.PlotAxes,PlotParam);
    777777write_plot_param(handles,PlotParamOut); %update the auto plot parameters
    778778
     
    798798UvData=get(huvmat,'UserData');
    799799hfig=figure;
    800 newaxes=copyobj(handles.axes3,hfig);
    801 map=colormap(handles.axes3);
     800newaxes=copyobj(handles.PlotAxes,hfig);
     801map=colormap(handles.PlotAxes);
    802802colormap(map);%transmit the current colormap to the zoom fig
    803803colorbar
  • trunk/src/write_plot_param.m

    r429 r511  
    44if isempty(PlotParam.Coordinates)
    55    set(handles.Coordinates,'Visible','off')
    6     set(handles.axes3,'Visible','off')
     6    set(handles.PlotAxes,'Visible','off')
    77    set(handles.text_display,'Visible','off')
    88    set(handles.TableDisplay,'Visible','on')
    99else
    1010    set(handles.Coordinates,'Visible','on')
    11     set(handles.axes3,'Visible','on')
     11    set(handles.PlotAxes,'Visible','on')
    1212    set(handles.text_display,'Visible','on')
    1313    if isfield(handles,'TableDisplay')
Note: See TracChangeset for help on using the changeset viewer.