Changeset 747 for trunk/src/uvmat.m


Ignore:
Timestamp:
Apr 22, 2014, 9:44:39 AM (10 years ago)
Author:
sommeria
Message:

adpatations to 3D fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r745 r747  
    195195set(handles.PlotAxes,'UserData',AxeData)
    196196% position of table Coord_y
    197 set(handles.Coord_y,'Unit','pixel')
    198 Pos=get(handles.Coord_y,'Position');
    199 set(handles.Coord_y,'Unit','normalized')
    200 set(handles.Coord_y,'ColumnWidth',{Pos(3)})
    201 set(handles.Coord_y,'ColumnFormat',{'char'})
    202 set(handles.Coord_y,'ColumnEditable',false)
    203 set(handles.Coord_y,'ColumnName',{''})
     197%set(handles.Coord_y,'Unit','pixel')
     198% Pos=get(handles.Coord_y,'Position');
     199% set(handles.Coord_y,'Unit','normalized')
     200% set(handles.Coord_y,'ColumnWidth',{Pos(3)})
     201% set(handles.Coord_y,'ColumnFormat',{'char'})
     202% set(handles.Coord_y,'ColumnEditable',false)
     203% set(handles.Coord_y,'ColumnName',{''})
    204204
    205205%% set functions for the mouse and keyboard
     
    994994% time not set by the input file: images or civ data: indicate that time is read from the xml file
    995995if isfield(XmlData,'Time')&& ~isempty(XmlData.Time) && ...
    996         (strcmp(FileType,'image')|| strcmp(FileType,'multimage')||strcmp(FileType,'civdata')||strcmp(FileType,'civx'))
     996        (strcmp(FileType,'image')|| strcmp(FileType,'multimage'))%||strcmp(FileType,'civdata')||strcmp(FileType,'civx'))
    997997    TimeName='xml';
    998998elseif strcmp(FileType,'civdata')
     
    11101110        set(handles.ColorScalar,'String',ColorList)
    11111111        set(handles.Vectors,'Visible','on')
    1112         set(handles.Coord_x,'Value',1);
     1112        %set(handles.Coord_x,'Value',1);
    11131113        set(handles.Coord_x,'String','X');
    1114 %         set(handles.Coord_y,'Value',1);
    1115         set(handles.Coord_y,'Data',{'Y'});
     1114        set(handles.Coord_y,'String','Y');
    11161115    case 'netcdf'
    11171116        set(handles_Fields,'Value',1)
     
    11251124        set(handles_Fields,'Value',1) % set menu to 'image'
    11261125        set(handles_Fields,'String',{'image'})
    1127         set(handles.Coord_x,'Value',1);
     1126        %set(handles.Coord_x,'Value',1);
    11281127        set(handles.Coord_x,'String','AX');
    1129     set(handles.Coord_y,'Data',{'AY'});
     1128    set(handles.Coord_y,'String','AY');
    11301129end
    11311130set(handles.uvmat,'UserData',UvData)
    11321131
    1133 %% set index navigation options and inputfilerefresh plots
     1132%% set index navigation options
    11341133scan_option='i';%default
    11351134state_j='off'; %default
     
    16231622FileExt=InputFile.FileExt;
    16241623NomType=InputFile.NomType;
    1625 % i1=str2num(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name)
    1626 % i2=[];%default
    1627 % if strcmp(get(handles.i2,'Visible'),'on')
    1628 %     i2=str2num(get(handles.i2,'String'));
    1629 % end
    1630 % j1=[];
    1631 % if strcmp(get(handles.j1,'Visible'),'on')
    1632 %     j1=stra2num(get(handles.j1,'String'));
    1633 % end
    1634 % j2=j1;
    1635 % if strcmp(get(handles.j2,'Visible'),'on')
    1636 %     j2=stra2num(get(handles.j2,'String'));
    1637 % end
    16381624[tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(InputFile.FileIndex);% check back the indices used
    16391625if isempty(i1)
     
    17001686        end
    17011687    else % free increment
    1702         runaction=get(gcbo,'tag');
     1688       % runaction=get(gcbo,'tag');
    17031689        if strcmp(increment,'+')% if runplus or movie is activated
    17041690            step=1;
     
    18171803filename=fullfile_uvmat(InputFile.RootPath,InputFile.SubDir,InputFile.RootFile,FileExt,NomType,i1,i2,j1,j2);
    18181804
    1819 %% inputfilerefresh plots
     1805%% refresh plots
    18201806if sub_value
    18211807    filename_1=fullfile_uvmat(InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileExt_1,InputFile.NomType_1,i1_1,i2_1,j1_1,j2_1);
     
    21492135        end
    21502136    case {'video','mmreader'}
    2151         ParamIn=UvData.MovieObject{1};      
     2137        ParamIn=UvData.MovieObject{1}; % movie object     
    21522138        if strcmp(NomType,'*')
    21532139            frame_index=num_i1;%frame index from a single movies or multimage
     
    21742160    ParamIn.VelType=VelType;
    21752161    ParamIn.Coord_x=get(handles.Coord_x,'String');
    2176     ParamIn.Coord_y=get(handles.Coord_y,'Data');
    2177 end
    2178 check_tps = 0;         
    2179 if strcmp(UvData.FileType{1},'civdata')&&~strcmp(ParamIn.FieldName,'velocity')&&~strcmp(ParamIn.FieldName,'get_field...')
    2180        check_tps=1;%tps needed to get the requested field
    2181 end
     2162    ParamIn.Coord_y=get(handles.Coord_y,'String');
     2163    ParamIn.Coord_z=get(handles.Coord_z,'String');
     2164    TimeName=get(handles.TimeName,'String');
     2165    r=regexp(TimeName,'^(?<type>(dim:)|(var:))','names');%look for 'var:' or 'dim:' at the beginning of time name
     2166    if ~isempty(r)
     2167        frame_index=num_i1;%time index chosen by i1
     2168        if strcmp(r.type,'dim:')
     2169            ParamIn.TimeDimName=TimeName(5:end);
     2170        elseif strcmp(r.type,'var:')
     2171            ParamIn.TimeVarName=TimeName(5:end);
     2172        end
     2173    end
     2174end
     2175% check_tps = 0;         
     2176% if strcmp(UvData.FileType{1},'civdata')&&~strcmp(ParamIn.FieldName,'velocity')&&~strcmp(ParamIn.FieldName,'get_field...')
     2177%        check_tps=1;%tps needed to get the requested field
     2178% end
    21822179[Field{1},ParamOut,errormsg] = read_field(FileName,UvData.FileType{1},ParamIn,frame_index);
    21832180if ~isempty(errormsg)
     
    22242221        case {'video','mmreader'}
    22252222            ParamIn_1=UvData.MovieObject{2};
    2226                         if ~strcmp(NomType_1,'*')
     2223            if ~strcmp(NomType_1,'*')
    22272224                frame_index_1=j1_1;%frame index for movies or multimage
    22282225            else
     
    22452242    end
    22462243    if isequal(get(handles.NomType_1,'Visible'),'on')
    2247     NomType_1=get(handles.NomType_1,'String');
     2244        NomType_1=get(handles.NomType_1,'String');
    22482245    else
    22492246        NomType_1=get(handles.NomType,'String');
     
    22612258        ParamIn_1.VelType=VelType_1;
    22622259        ParamIn_1.Coord_x=get(handles.Coord_x,'String');
    2263         ParamIn_1.Coord_y=get(handles.Coord_y,'Data');
     2260        ParamIn_1.Coord_y=get(handles.Coord_y,'String');
    22642261        end 
    22652262        [Field{2},ParamOut_1,errormsg] = read_field(FileName_1,UvData.FileType{2},ParamIn_1,frame_index_1);
     
    23122309test_veltype_1=0;
    23132310if isempty(FileName_1)
    2314     %     set(handles.FieldName_1,'Value',1); %update the field menu
    2315     %     if isstruct(ParamOut)
    2316     %     set(handles.FieldName_1,'String',[{''};ParamOut.FieldList]); %update the field menu
    2317     %     end
    23182311elseif ~test_keepdata_1
    23192312    if (strcmp(UvData.FileType{2},'civx')||strcmp(UvData.FileType{2},'civdata'))&& ~strcmp(FieldName_1,'get_field...')
    2320 %     if (~strcmp(UvData.FileType{2},'netcdf')&&~strcmp(UvData.FileType{2},'civdata')&&~strcmp(UvData.FileType{2},'civx'))|| isequal(FieldName_1,'get_field...')
    23212313        test_veltype_1=1;
    23222314        set(handles.VelType_1,'Visible','on')
     
    23732365TimeUnit='';
    23742366if isfield(UvData,'TimeUnit')
    2375 TimeUnit=UvData.TimeUnit;%retrieve info from update_rootinfo
    2376 end
     2367    TimeUnit=UvData.TimeUnit;%retrieve info from update_rootinfo
     2368end
     2369TimeName=get(handles.TimeName,'String');
     2370
    23772371% time from xml file or video movie
    2378 TimeName=get(handles.TimeName,'String');% indicate that time is from xml
    23792372if strcmp(TimeName,'xml')||strcmp(TimeName,'video')
    23802373    if isempty(num_i2)||isnan(num_i2)
     
    23982391end
    23992392
    2400 % get time in the input file, not defined in a xml file or movie
     2393% time in the input file, not defined in a xml file or movie
    24012394if isempty(abstime)
    24022395    if strcmp(TimeName,'civdata')||strcmp(TimeName,'civx')
    24032396        abstime=Field{1}.Time;
    2404     elseif ~isempty(regexp(TimeName,'^att:'))||~isempty(regexp(TimeName,'^var:'))
    2405         abstime=Field{1}.(TimeName(5:end));%the time is an attribute or variale selected by get_file
     2397    elseif ~isempty(regexp(TimeName,'^att:', 'once'))
     2398        abstime=Field{1}.(TimeName(5:end));%the time is an attribute  selected by get_file
     2399        if isfield(Field{1},[TimeName(5:end) 'Unit'])
     2400            TimeUnit=Field{1}.([TimeName(5:end) 'Unit']);
     2401        else
     2402            TimeUnit='';
     2403        end
     2404    elseif  ~isempty(regexp(TimeName,'^var:'))
     2405        abstime=Field{1}.(TimeName(5:end));%the time is a variale selected by get_file
     2406        % TODO: look for time unit attribute
    24062407    elseif ~isempty(regexp(TimeName,'^dim:'))
    24072408        abstime=str2num(get(handles.i1,'String'));
     2409        TimeUnit='index';
    24082410    end
    24092411    if isfield(Field{1},'Dt')
    24102412        dt=Field{1}.Dt;%dt read from the netcdf input file
    2411         if isfield(Field{1},'TimeUnit')
    2412             TimeUnit=Field{1}.TimeUnit;
    2413         end
    24142413    elseif numel(Field)==2 && isfield(Field{2},'Dt')%dt obtained from the second field if not defined in the first
    24152414        dt=Field{2}.Dt;%dt read from the netcdf input file
    2416         if isfield(Field{2},'TimeUnit')
    2417             TimeUnit=Field{2}.TimeUnit;
    2418         end
    24192415    end
    24202416end
     
    25232519UvData.Field=find_field_bounds(UvData.Field);
    25242520
    2525 if UvData.Field.NbDim>1
    2526     % default projection plane
    2527     if isempty(UvData.ProjObject{1})
    2528         UvData.ProjObject{1}.Type='plane';%main plotting plane
    2529         UvData.ProjObject{1}.ProjMode='projection';%main plotting plane
    2530        % UvData.ProjObject{1}.Coord=[0 0 0];
    2531         UvData.ProjObject{1}.DisplayHandle.uvmat=[]; %plane not visible in uvmat
    2532         UvData.ProjObject{1}.DisplayHandle.view_field=[]; %plane not visible in uvmat
    2533     end
    2534     %% 3D case (menuvolume)
    2535     if UvData.Field.NbDim==3% && UvData.NewSeries
    2536         test_set_object=1;
    2537         hset_object=findobj(allchild(0),'tag','set_object');% look for the set_object GUI
    2538         ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider
    2539         ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider
    2540         if ~isempty(hset_object) %if set_object is detected
    2541             delete(hset_object);% delete the GUI set_object if it does not fit
    2542         end
    2543         if test_set_object% reinitiate the GUI set_object
    2544             delete_object(1);% delete the current projection object in the list UvData.ProjObject, delete its graphic representations and update the list displayed in handles.ListObject and 2
    2545             UvData.ProjObject{1}.NbDim=NbDim;%test for 3D objects
    2546             UvData.ProjObject{1}.RangeZ=UvData.Field.CoordMesh;%main plotting plane
    2547             UvData.ProjObject{1}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
    2548             UvData.ProjObject{1}.Angle=[0 0 0];
    2549             UvData.ProjObject{1}.HandlesDisplay=plot(0,0,'Tag','proj_object');% A REVOIR
    2550             UvData.ProjObject{1}.Name='1-PLANE';
    2551             UvData.ProjObject{1}.enable_plot=1;
    2552             set_object(UvData.ProjObject{1},handles,ZBounds);
    2553             set(hset_object,'name','set_object');% rename if set_object already used with series
    2554             set(handles.ListObject,'Value',1);
    2555             set(handles.ListObject,'String',{'1-PLANE'});
    2556             set(handles.CheckEditObject,'Value',1)% put the plane in edit mode to enable the z cursor
    2557             CheckEditObject_Callback([],[], handles)
    2558         end
    2559         %multilevel case (single menuplane in a 3D space)
    2560     elseif isfield(UvData,'Z')
    2561         if isfield(UvData,'CoordType')&& isequal(UvData.CoordType,'phys') && isfield(UvData,'XmlData')
    2562             XmlData=UvData.XmlData{1};
    2563             if isfield(XmlData,'PlanePos')
    2564                 UvData.ProjObject{1}.Coord=XmlData.PlanePos(UvData.ZIndex,:);
    2565             end
    2566             if isfield(XmlData,'PlaneAngle')
    2567                 siz=size(XmlData.PlaneAngle);
    2568                 indangle=min(siz(1),UvData.ZIndex);%take first angle if a single angle is defined (translating scanning)
    2569                 UvData.ProjObject{1}.PlaneAngle=XmlData.PlaneAngle(indangle,:);
    2570             end
    2571         elseif isfield(UvData,'ZIndex')
    2572             UvData.ProjObject{1}.ZObject=UvData.ZIndex;
    2573         end
    2574     end
    2575 end
    2576 
    25772521testnewseries=UvData.NewSeries;
    25782522UvData.NewSeries=0;% put to 0 the test for a new field series (set by RootPath_callback)
    2579 set(handles.uvmat,'UserData',UvData)
    25802523
    25812524%% reset the min and max of scalar if only the mask is displayed(TODO: check the need)
     
    25882531if UvData.Field.NbDim<=1
    25892532    set(handles.Objects,'Visible','off')
    2590 %     set(handles.ListObject_1_title,'Visible','off')
    2591 %     set(handles.ListObject_1,'Visible','off')
    25922533    [PlotType,PlotParamOut]=plot_field(UvData.Field,handles.PlotAxes,read_GUI(handles.uvmat));
    25932534    errormsg=fill_GUI(PlotParamOut,handles.uvmat);
     
    25972538        end
    25982539    end
    2599    
     2540    set(handles.uvmat,'UserData',UvData)
    26002541%% 2D or 3D fieldname are generally projected
    26012542else
    26022543    set(handles.Objects,'Visible','on')
    2603 %     set(handles.ListObject_1_title,'Visible','on')
    2604 %     set(handles.ListObject_1,'Visible','on')
    26052544   
    26062545    %% Plot the projections on the selected  projection objects
    2607     % main projection object (uvmat display)
    2608     list_object=get(handles.ListObject_1,'String');
    2609     if isequal(list_object,{''})||isequal(list_object,' ')%refresh list of objects if the menu is empty
     2546    %if no projection object exists, create a default one
     2547    if isempty(UvData.ProjObject{1})
    26102548        set(handles.ListObject,'Value',1)
    26112549        set(handles.ListObject,'String',{'plane'})
     
    26162554        set(handles.ListObject_1,'Value',1)
    26172555        set(handles.ListObject_1,'String',{'plane'})
     2556        if UvData.Field.NbDim==3 %3D case
     2557%             ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider
     2558%             ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider
     2559            UvData.ProjObject{1}.NbDim=3;%test for 3D objects
     2560            UvData.ProjObject{1}.RangeZ=UvData.Field.CoordMesh;%main plotting plane
     2561            UvData.ProjObject{1}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
     2562            UvData.ProjObject{1}.Angle=[0 0 0];
     2563        elseif isfield(UvData,'Z')
     2564            %multilevel case (single menuplane in a 3D space)
     2565            if isfield(UvData,'CoordType')&& isequal(UvData.CoordType,'phys') && isfield(UvData,'XmlData')
     2566                XmlData=UvData.XmlData{1};
     2567                if isfield(XmlData,'PlanePos')
     2568                    UvData.ProjObject{1}.Coord=XmlData.PlanePos(UvData.ZIndex,:);
     2569                end
     2570                if isfield(XmlData,'PlaneAngle')
     2571                    siz=size(XmlData.PlaneAngle);
     2572                    indangle=min(siz(1),UvData.ZIndex);%take first angle if a single angle is defined (translating scanning)
     2573                    UvData.ProjObject{1}.PlaneAngle=XmlData.PlaneAngle(indangle,:);
     2574                end
     2575            elseif isfield(UvData,'ZIndex')
     2576                UvData.ProjObject{1}.ZObject=UvData.ZIndex;
     2577            end
     2578        end
    26182579    end
    26192580    IndexObj=get(handles.ListObject_1,'Value');%selected projection object for main view
     
    26482609   
    26492610    %% second projection object (view_field display)
    2650     if length( IndexObj)>=2
     2611    if length( IndexObj)==2
    26512612        view_field_handle=findobj(allchild(0),'tag','view_field');%handles of the view_field GUI
    26522613        if ~isempty(view_field_handle)
     
    26542615            haxes(2)=plot_handles{2}.PlotAxes;
    26552616            PlotParam{2}=read_GUI(view_field_handle);
    2656            % PlotParam{2}=read_GUI(handles.uvmat);%read plotting parameters on the uvmat interface
    26572617            PosColorbar{2}='*'; %TODO: deal with colorbar position on view_field
    26582618        end
     
    26652625        if numel(UvData.ProjObject)<iobj
    26662626            break
     2627        end
     2628        if UvData.Field.NbDim==3% TO GENERALISE
     2629            UvData.ProjObject{iobj}.NbDim=3;%test for 3D objects
     2630            UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane
     2631            UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
     2632            UvData.ProjObject{iobj}.Angle=[0 0 0];
    26672633        end
    26682634        [ObjectData,errormsg]=proj_field(UvData.Field,UvData.ProjObject{iobj});% project field on the object
     
    27272693    end
    27282694   
     2695    set(handles.uvmat,'UserData',UvData)
     2696   
    27292697    %% update the mask
    27302698    if isequal(get(handles.CheckMask,'Value'),1)%if the mask option is on
     
    27782746    end
    27792747end
     2748
     2749if UvData.Field.NbDim==3
     2750    CheckEditObject_Callback(handles.uvmat, [], handles)
     2751end   
    27802752ResizeFcn(handles.uvmat,[],handles)
    27812753set(handles.uvmat,'Pointer',pointer)
     
    27842756function histo1_menu_Callback(hObject, eventdata, handles)
    27852757%--------------------------------------------
     2758%% get the current field stored in uvmat user data
     2759UvData=get(handles.uvmat,'UserData');
     2760Field=UvData.Field;
     2761
     2762%% get from the menu 'histo1_menu' the name(s) of the fields to use
    27862763histo_menu=get(handles.histo1_menu,'String');
    27872764histo_value=get(handles.histo1_menu,'Value');
    27882765FieldName=histo_menu{histo_value};
    2789 
    2790 UvData=get(handles.uvmat,'UserData');
    2791 Field=UvData.Field;
    27922766r=regexp(FieldName,'(?<var1>.*)(?<sep>,)(?<var2>.*)','names');
    27932767FieldName_2='';
    27942768if ~isempty(r)
    2795     FieldName=r.var1;
    2796     FieldName_2=r.var2;
     2769    FieldName=r.var1;% name of first variable
     2770    FieldName_2=r.var2;% name of second variable
    27972771end
    27982772if ~isfield(UvData.Field,FieldName)
     
    28002774    return
    28012775end
    2802 FieldHisto=Field.(FieldName);
    2803 if isfield(Field,'FF') && ~isempty(Field.FF) && isequal(size(Field.FF),size(FieldHisto))
     2776
     2777%% extract the fields to use
     2778% eliminate false data if relevant (false flag FF exists)
     2779check_false=0;
     2780if isfield(Field,'FF') && ~isempty(Field.FF) && isequal(size(Field.FF),size(Field.(FieldName)))
    28042781    indsel=find(Field.FF==0);%find values marked as false
    28052782    if ~isempty(indsel)
    2806         FieldHisto=FieldHisto(indsel);
     2783        FieldHisto=Field.(FieldName)(indsel);%field of the first variable (U)
    28072784        if ~isempty(FieldName_2)
    2808             FieldHisto(:,:,2)=Field.(FieldName_2)(indsel);
    2809         end
    2810     end
    2811 elseif ~isempty(FieldName_2)
    2812     FieldHisto(:,:,2)=Field.(FieldName_2);
    2813 end
     2785            if isfield(Field,'NbDim') && Field.NbDim==3
     2786                 FieldHisto(:,:,:,2)=Field.(FieldName_2)(indsel);%field of the second variable (U)
     2787            else
     2788            FieldHisto(:,:,2)=Field.(FieldName_2)(indsel);%field of the second variable (U)
     2789            end
     2790        end
     2791        check_false=1;
     2792    end
     2793end
     2794% no false data
     2795if ~check_false
     2796    FieldHisto=Field.(FieldName);%field of the first variable (U)
     2797    if ~isempty(FieldName_2)
     2798        if isfield(Field,'NbDim') && Field.NbDim==3
     2799            FieldHisto(:,:,:,2)=Field.(FieldName_2);%field of the second variable (V)
     2800        else
     2801            FieldHisto(:,:,2)=Field.(FieldName_2);%field of the second variable (V)
     2802        end
     2803    end
     2804end
     2805
     2806%% calculate and plot histogram
    28142807if isempty(Field)
    28152808    msgbox_uvmat('ERROR',['empty field ' FieldName])
     
    28442837            Histo.VarAttribute{1}.units=units;
    28452838        end
    2846         eval(['Histo.' FieldName '=linspace(Amin,Amax,50);'])%absissa values for histo
     2839        Histo.(FieldName)=linspace(Amin,Amax,50); %absissa values for histo
    28472840        if isfield(Field,'NbDim') && isequal(Field.NbDim,3)
    28482841            C=reshape(double(FieldHisto),1,[]);% reshape in a vector
     
    31023095%------------------------------------------------------------------------
    31033096% --- Executes on menu selection FieldName
    3104 function FieldName_Callback(hObject, eventdata, handles)
     3097
     3098    function FieldName_Callback(hObject, eventdata, handles)
    31053099%------------------------------------------------------------------------
    31063100
     
    31143108[tild,tild,tild,i1,i2,j1,j2,tild,NomType]=fileparts_uvmat(['xxx' get(handles.FileIndex,'String') FileExt]);
    31153109
    3116 switch field
    3117    
     3110switch field 
    31183111    case 'get_field...'
    31193112        %% fill the coordinates and variables from selections in get_field
     
    31563149        FieldList={};
    31573150        VecColorList={''};
     3151        ZName='';
    31583152        switch GetFieldData.FieldOption
    31593153            case 'vectors'
    31603154                UName=GetFieldData.PanelVectors.vector_x;
    31613155                VName=GetFieldData.PanelVectors.vector_y;
    3162                 YName={GetFieldData.Coordinates.Coord_y};
     3156                YName=GetFieldData.Coordinates.Coord_y;
     3157                if isfield(GetFieldData.Coordinates,'Coord_z')
     3158                ZName=GetFieldData.Coordinates.Coord_z;
     3159                end
    31633160                CName=GetFieldData.PanelVectors.vec_color;
    31643161                FieldList={['vec(' UName ',' VName ')'];...
     
    31723169            case 'scalar'
    31733170                AName=GetFieldData.PanelScalar.scalar;
    3174                 YName={GetFieldData.Coordinates.Coord_y};
     3171                YName=GetFieldData.Coordinates.Coord_y;
     3172                if isfield(GetFieldData.Coordinates,'Coord_z')
     3173                ZName=GetFieldData.Coordinates.Coord_z;
     3174                end
    31753175                FieldList={AName};
    31763176            case '1D plot'
     
    31793179                display_file_name(handles,FileName,1)
    31803180        end
     3181        % get time as file index, attribute, variable or matrix index
    31813182        if ~strcmp(GetFieldData.FieldOption,'civdata...')
    31823183            XName=GetFieldData.Coordinates.Coord_x;
     
    31913192                    set(handles.NomType,'String','*')
    31923193                    set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
     3194                    set(handles.i1,'String','1')% set counter to 1 (now the time index in the input matrix)
    31933195                    set(handles.FileIndex,'String','')
    31943196                    ParamIn.TimeVarName=GetFieldData.Time.TimeName;
    3195                 case 'matrix_index'
     3197                case 'matrix index'
    31963198                    set(handles.TimeName,'String',['dim:' GetFieldData.Time.TimeName]);
    31973199                    set(handles.NomType,'String','*')
    31983200                    set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
     3201                    set(handles.i1,'String','1')% set counter to 1 (now the time index in the input matrix)
    31993202                    set(handles.FileIndex,'String','')
    32003203                    ParamIn.TimeDimName=GetFieldData.Time.TimeName;
    32013204            end
    32023205            set(handles.Coord_x,'String',XName)
    3203             if ischar(YName)
    3204                 YName={YName};
    3205             end
    3206             set(handles.Coord_y,'Data',YName)
     3206%             if ischar(YName)
     3207%                 YName={YName};
     3208%             end
     3209            set(handles.Coord_y,'String',YName)
     3210            set(handles.Coord_z,'String',ZName)
    32073211            set(handles.FieldName,'Value',1)
    32083212            set(handles.FieldName,'String',[FieldList; {'get_field...'}]);
     
    33133317                UName=GetFieldData.PanelVectors.vector_x;
    33143318                VName=GetFieldData.PanelVectors.vector_y;
    3315                 YName={GetFieldData.Coordinates.Coord_y};
     3319                YName=GetFieldData.Coordinates.Coord_y;
    33163320                CName=GetFieldData.PanelVectors.vec_color;
    33173321                FieldList={['vec(' UName ',' VName ')'];...
     
    33253329            case 'scalar'
    33263330                AName=GetFieldData.PanelScalar.scalar;
    3327                 YName={GetFieldData.Coordinates.Coord_y};
     3331                YName=GetFieldData.Coordinates.Coord_y;
    33283332                FieldList={AName};
    33293333            case '1D plot'
     
    33543358            end
    33553359            set(handles.Coord_x,'String',XName)
    3356             if ischar(YName)
    3357                 YName={YName};
    3358             end
    3359             set(handles.Coord_y,'Data',YName)
     3360%             if ischar(YName)
     3361%                 YName={YName};
     3362%             end
     3363            set(handles.Coord_y,'String',YName)
    33603364            set(handles.FieldName_1,'Value',1)
    33613365            set(handles.FieldName_1,'String',[FieldList; {'get_field...'}]);
     
    37963800
    37973801%% adapt the GUI to the input/output conditions of the selected transform fct
    3798 DataOut=[];
    37993802CoordUnit='';
    38003803CoordUnitPrev='';
     
    38043807if ~isempty(list_path{ichoice})
    38053808    if nargin(transform_handle)>1 && isfield(UvData,'XmlData')&&~isempty(UvData.XmlData)
    3806         %XmlData=UvData.XmlData{1};
    3807         DataOut=feval(transform_handle,'*',UvData.XmlData{1});
     3809        DataOut=feval(transform_handle,'*',UvData.XmlData{1});% execute the transform fct to get the required conditions
    38083810        if isfield(DataOut,'CoordUnit')% set the requested coord unit (info used to possibly delete the current projection objects)
    38093811            CoordUnit=DataOut.CoordUnit;
     
    38143816        if isfield(DataOut,'TransformInput')%  used to add transform parameters at selection of the transform fct
    38153817            UvData.XmlData{1}.TransformInput=DataOut.TransformInput;
    3816 %             ListFields=fieldnames(DataOut.XmlData);
    3817 %             for ilist=1:numel(ListFields)
    3818 %             UvData.XmlData{1}.(ListFields{ilist})=DataOut.XmlData.(ListFields{ilist});
    3819 %             end
    3820         end
    3821 %     else
    3822 %         DataOut=feval(transform_handle,'*');
    3823     end
    3824 end
    3825 
     3818        end
     3819    end
     3820end
    38263821
    38273822%% delete drawn objects if the output CooordUnit is different from the previous one
     
    43064301    ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData
    43074302    [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%read plotting parameters on the uvmat interface
    4308    
    4309     %write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
    43104303    haxes=findobj(hview_field,'tag','axes3');
    43114304    pos=get(hview_field,'Position'); 
     
    44854478        end
    44864479    end
    4487     %write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
    44884480    haxes=findobj(hview_field,'tag','axes3');
    44894481    pos=get(hview_field,'Position');
     
    44944486    else
    44954487        Data=get(hview_field,'UserData');
    4496 %         set(hview_field,'Position',Data.GUISize)% restore the size of view_field for plots
    44974488    end
    44984489else
     
    55455536Param.TransformName=TransformList{get(handles.TransformName,'Value')};
    55465537Param.Coord_x_str=get(handles.Coord_x,'String');
    5547 Param.Coord_x_val=get(handles.Coord_x,'Value');
    5548 Param.Coord_y_str=get(handles.Coord_y,'Data');
     5538%Param.Coord_x_val=get(handles.Coord_x,'Value');
     5539Param.Coord_y_str=get(handles.Coord_y,'String');
    55495540
    55505541% --------------------------------------------------------------------
     
    55625553% end
    55635554
    5564 % --- Executes on selection change in Coord_y.
    5565 function Coord_y_Callback(hObject, eventdata, handles)
    5566 
    5567 % --- Executes on selection change in Coord_x.
    5568 function Coord_x_Callback(hObject, eventdata, handles)
    5569 
    5570 
    5571 % --- Executes on button press in CheckColorBar.
    5572 function CheckColorBar_Callback(hObject, eventdata, handles)
    5573 
    5574 
    5575 
    5576 function TransformPath_Callback(hObject, eventdata, handles)
    5577 % hObject    handle to TransformPath (see GCBO)
    5578 % eventdata  reserved - to be defined in a future version of MATLAB
    5579 % handles    structure with handles and user data (see GUIDATA)
    5580 
    5581 % Hints: get(hObject,'String') returns contents of TransformPath as text
    5582 %        str2double(get(hObject,'String')) returns contents of TransformPath as a double
    55835555
    55845556
     
    56925664    set(handles.TableDisplay,'Visible','off')
    56935665end
     5666
     5667
     5668
     5669function Coord_z_Callback(hObject, eventdata, handles)
     5670% hObject    handle to Coord_z (see GCBO)
     5671% eventdata  reserved - to be defined in a future version of MATLAB
     5672% handles    structure with handles and user data (see GUIDATA)
     5673
     5674% Hints: get(hObject,'String') returns contents of Coord_z as text
     5675%        str2double(get(hObject,'String')) returns contents of Coord_z as a double
     5676
     5677
     5678% --- Executes during object creation, after setting all properties.
     5679function Coord_z_CreateFcn(hObject, eventdata, handles)
     5680% hObject    handle to Coord_z (see GCBO)
     5681% eventdata  reserved - to be defined in a future version of MATLAB
     5682% handles    empty - handles not created until after all CreateFcns called
     5683
     5684% Hint: edit controls usually have a white background on Windows.
     5685%       See ISPC and COMPUTER.
     5686if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
     5687    set(hObject,'BackgroundColor','white');
     5688end
Note: See TracChangeset for help on using the changeset viewer.