Changeset 871 for trunk/src/uvmat.m
- Timestamp:
- Feb 16, 2015, 12:15:23 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r867 r871 44 44 % .Field: cell array of 1 or 2 structures representing the current input field(s) 45 45 % .PlotAxes: field structure representing the current field plotted on the main axes (used for mouse operations) 46 % .HistoAxes: idem for histogram axes46 % .HistoAxes: idem for Histogram axes 47 47 48 48 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DATA FLOW (for REFRESH_Callback) %%%%%%%%%%%%%%%%%%%%: … … 69 69 % (tps_coeff_field.m) calculate tps coefficients (for filter projection or spatial derivatives). 70 70 % | 71 % UvData.Field--------------> histogram71 % UvData.Field-------------->Histogram 72 72 % _____________|____________ 73 73 % | | … … 358 358 %% reset position of text_display and TableDisplay 359 359 set(handles.text_display,'Units','pixels') 360 set(handles.TableDisplay,'Units','pixels') 360 361 pos_1=get(handles.text_display,'Position');% [lower x lower y width height] for text_display 361 362 pos_1(3)=1.2*ColumnWidth; … … 363 364 pos_1(2)=size_fig(4)-pos_InputFile(4)-pos_1(4); % set text display to the top of the fig 364 365 set(handles.text_display,'Position',pos_1) 365 set(handles.TableDisplay,'Position', pos_1)366 set(handles.TableDisplay,'Position',[pos_1(1) 10 pos_1(3) 5*pos_1(4)]) 366 367 % reset position of CheckTable 367 368 set(handles.CheckTable,'Units','pixels') … … 2556 2557 msgbox_uvmat('ERROR',errormsg); 2557 2558 end 2559 set(handles.runplus,'BackgroundColor',[1 0 0])%paint the command button back in red 2558 2560 2559 2561 %------------------------------------------------------------------------ … … 2574 2576 msgbox_uvmat('ERROR',errormsg); 2575 2577 end 2578 set(handles.runmin,'BackgroundColor',[1 0 0])%paint the command button back in red 2576 2579 2577 2580 %------------------------------------------------------------------------ … … 3614 3617 if UvData.Field.NbDim<=1 3615 3618 set(handles.Objects,'Visible','off') 3619 set(handles.CheckFixAspectRatio,'Value',0) 3616 3620 [PlotType,PlotParamOut,haxes]=plot_field(UvData.Field,handles.PlotAxes,read_GUI(handles.uvmat)); 3617 3621 UvData.PlotAxes=UvData.Field; %store data for further plot modifications … … 3622 3626 end 3623 3627 end 3628 set(handles.Histogram,'Visible','off') 3629 set(handles.HistoMenu,'Visible','off') 3630 set(handles.HistoAxes,'Visible','off') 3631 hlegend=findobj(handles.uvmat,'Tag','HistoLegend'); 3632 if ~isempty(hlegend) 3633 delete(hlegend) 3634 end 3635 cla(handles.HistoAxes)% clear the curves and legend in histogram axes 3624 3636 set(handles.uvmat,'UserData',UvData) 3625 3637 %% 2D or 3D fieldname are generally projected … … 3690 3702 PlotParam{1}.Vectors.ColorCode= {'rgb'}; 3691 3703 end 3692 %PosColorbar{1}=UvData.OpenParam.PosColorbar;%prescribe the colorbar position on the uvmat interface3693 3704 3694 3705 %% second projection object (view_field display) … … 3699 3710 haxes(2)=plot_handles{2}.PlotAxes; 3700 3711 PlotParam{2}=read_GUI(view_field_handle); 3701 %PosColorbar{2}='*'; %TODO: deal with colorbar position on view_field3702 3712 end 3703 3713 end 3704 3714 3705 %% loop on the projection objects: one or two 3706 3715 %% loop on the projection objects: one or two 3707 3716 for imap=1:numel(IndexObj) 3708 3717 iobj=IndexObj(imap); … … 3758 3767 set(handles.uvmat,'UserData',UvData) 3759 3768 if ~isempty(ObjectData) 3760 %PlotType='none'; %default3761 3769 if imap==2 && isempty(view_field_handle) 3762 3770 view_field(ObjectData) … … 3772 3780 set_object('ProjMode_Callback',hset_object,[],hhset_object); 3773 3781 end 3774 % errormsg=PlotType;3775 3782 return 3776 3783 end … … 3797 3804 end 3798 3805 3799 %% prepare the menus of histograms and plot them ( histogram of the whole volume in 3D case)3806 %% prepare the menus of histograms and plot them (Histogram of the whole volume in 3D case) 3800 3807 menu_histo=(UvData.Field.ListVarName)';%list of field variables to be displayed for the menu of histogram display 3801 3808 ind_skip=[]; … … 3803 3810 Ustring=''; 3804 3811 Vstring=''; 3805 % suppress axes from the histogram menu3812 % suppress axes from the Histogram menu 3806 3813 for ivar=1:numel(menu_histo)%l loop on field variables: 3807 3814 if isfield(UvData.Field,'VarAttribute') && numel(UvData.Field.VarAttribute)>=ivar && isfield(UvData.Field.VarAttribute{ivar},'Role') … … 3838 3845 test_v=0; 3839 3846 if ~isempty(menu_histo) 3840 set(handles.histo1_menu,'Value',1) 3841 set(handles.histo1_menu,'String',menu_histo) 3842 histo1_menu_Callback(handles.histo1_menu, [], handles)% plot first histogram 3847 set(handles.HistoMenu,'Value',1) 3848 set(handles.HistoMenu,'String',menu_histo) 3849 set(handles.Histogram,'Visible','on') 3850 set(handles.HistoMenu,'Visible','on') 3851 set(handles.HistoAxes,'Visible','on') 3852 HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram 3843 3853 end 3844 3854 end … … 3852 3862 3853 3863 %------------------------------------------------------------------------ 3854 function histo1_menu_Callback(hObject, eventdata, handles)3864 function HistoMenu_Callback(hObject, eventdata, handles) 3855 3865 %-------------------------------------------- 3856 3866 %% get the current field stored in uvmat user data … … 3858 3868 Field=UvData.Field; 3859 3869 3860 %% get from the menu ' histo1_menu' the name(s) of the fields to use3861 histo_menu=get(handles. histo1_menu,'String');3862 histo_value=get(handles. histo1_menu,'Value');3870 %% get from the menu 'HistoMenu' the name(s) of the fields to use 3871 histo_menu=get(handles.HistoMenu,'String'); 3872 histo_value=get(handles.HistoMenu,'Value'); 3863 3873 FieldName=histo_menu{histo_value}; 3864 3874 r=regexp(FieldName,'(?<var1>.*)(?<sep>,)(?<var2>.*)','names'); … … 3902 3912 end 3903 3913 3904 %% calculate and plot histogram3914 %% calculate and plot Histogram 3905 3915 if isempty(Field) 3906 3916 msgbox_uvmat('ERROR',['empty field ' FieldName]) … … 3935 3945 Histo.VarAttribute{1}.units=units; 3936 3946 end 3937 Histo.(FieldName)=linspace(Amin,Amax,50); %absissa values for histo 3947 VarMesh=(Amax-Amin)/100; 3948 ord=10^(floor(log10(VarMesh)));%order of magnitude 3949 if VarMesh/ord >=5 3950 VarMesh=5*ord; 3951 elseif VarMesh/ord >=2 3952 VarMesh=2*ord; 3953 else 3954 VarMesh=ord; 3955 end 3956 Amin=VarMesh*(ceil(Amin/VarMesh)); 3957 Amax=VarMesh*(floor(Amax/VarMesh)); 3958 Histo.(FieldName)=Amin:VarMesh:Amax; %absissa values for histo 3938 3959 if isfield(Field,'NbDim') && isequal(Field.NbDim,3) 3939 3960 C=reshape(double(FieldHisto),1,[]);% reshape in a vector … … 3947 3968 end 3948 3969 plot_field(Histo,handles.HistoAxes); 3949 hlegend=legend; 3970 hlegend=findobj(handles.uvmat,'Tag','HistoLegend'); 3971 if isempty(hlegend) 3972 hlegend=legend; 3973 set(hlegend,'Tag','HistoLegend') 3974 end 3950 3975 if isempty(FieldName_2) 3951 set(hlegend,'String',FieldName)3976 set(hlegend,'String',FieldName) 3952 3977 else 3953 3978 set(hlegend,'String',{FieldName;FieldName_2}) … … 4677 4702 data.CoordType=UvData.CoordType; 4678 4703 end 4679 if isfield(UvData.Field,'CoordMesh')& ~isempty(UvData.Field.CoordMesh)4704 if isfield(UvData.Field,'CoordMesh')&& ~isempty(UvData.Field.CoordMesh) 4680 4705 data.RangeX=[UvData.Field.XMin UvData.Field.XMax]; 4681 4706 data.RangeY=[UvData.Field.YMin UvData.Field.YMax]; 4682 4707 data.DX=UvData.Field.CoordMesh; 4683 4708 data.DY=UvData.Field.CoordMesh; 4684 elseif isfield(UvData.Field,'Coord_x')& isfield(UvData.Field,'Coord_y')& isfield(UvData.Field,'A')%only image4709 elseif isfield(UvData.Field,'Coord_x')&& isfield(UvData.Field,'Coord_y') && isfield(UvData.Field,'A')%only image 4685 4710 np=size(UvData.Field.A); 4686 4711 meshx=(UvData.Field.Coord_x(end)-UvData.Field.Coord_x(1))/np(2); … … 5686 5711 set(handles.PlotAxes,'Visible','on') 5687 5712 set(handles.text_display,'Visible','on') 5688 if isfield(handles,'TableDisplay')5689 set(handles.TableDisplay,'Visible','off')5690 end5713 % if isfield(handles,'TableDisplay') 5714 % set(handles.TableDisplay,'Visible','off') 5715 % end 5691 5716 Coordinates=PlotParam.Axes; 5692 5717 if isfield(Coordinates,'CheckFixAspectRatio')
Note: See TracChangeset
for help on using the changeset viewer.