Changeset 150 for trunk/src/uvmat.m


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)

File:
1 edited

Legend:

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