1 | %'write_plot_param': update the plotting parameters on the uvmat or view_field interface after a plotting operation |
---|
2 | function write_plot_param(handles,PlotParam) |
---|
3 | %% coordinates |
---|
4 | if isempty(PlotParam.Coordinates) |
---|
5 | set(handles.Coordinates,'Visible','off') |
---|
6 | set(handles.PlotAxes,'Visible','off') |
---|
7 | set(handles.text_display,'Visible','off') |
---|
8 | set(handles.TableDisplay,'Visible','on') |
---|
9 | else |
---|
10 | set(handles.Coordinates,'Visible','on') |
---|
11 | set(handles.PlotAxes,'Visible','on') |
---|
12 | set(handles.text_display,'Visible','on') |
---|
13 | if isfield(handles,'TableDisplay') |
---|
14 | set(handles.TableDisplay,'Visible','off') |
---|
15 | end |
---|
16 | Coordinates=PlotParam.Coordinates; |
---|
17 | if isfield(Coordinates,'CheckFixAspectRatio') |
---|
18 | if Coordinates.CheckFixAspectRatio |
---|
19 | set(handles.CheckFixAspectRatio,'Value',1) |
---|
20 | set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0]) |
---|
21 | else |
---|
22 | set(handles.CheckFixAspectRatio,'Value',0) |
---|
23 | set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7]) |
---|
24 | end |
---|
25 | end |
---|
26 | if isfield(Coordinates,'AspectRatio') |
---|
27 | set(handles.num_AspectRatio,'String',num2str(Coordinates.AspectRatio)) |
---|
28 | end |
---|
29 | if isfield(Coordinates,'MinX') |
---|
30 | set(handles.num_MinX,'String',num2str(Coordinates.MinX,4)); |
---|
31 | set(handles.num_MaxX,'String',num2str(Coordinates.MaxX,4)); |
---|
32 | set(handles.num_MinY,'String',num2str(Coordinates.MinY,4)); |
---|
33 | set(handles.num_MaxY,'String',num2str(Coordinates.MaxY,4)); |
---|
34 | else |
---|
35 | set(handles.num_MinX,'String',''); |
---|
36 | set(handles.num_MaxX,'String',''); |
---|
37 | set(handles.num_MinY,'String',''); |
---|
38 | set(handles.num_MaxY,'String',''); |
---|
39 | end |
---|
40 | end |
---|
41 | |
---|
42 | %% scalar or image parameters |
---|
43 | if isfield(PlotParam,'Scalar') |
---|
44 | set(handles.Scalar,'Visible','on') |
---|
45 | if isfield(PlotParam.Scalar,'MaxA') |
---|
46 | set(handles.num_MaxA,'String',num2str(PlotParam.Scalar.MaxA,3)); |
---|
47 | end |
---|
48 | if isfield(PlotParam.Scalar,'MinA') |
---|
49 | set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3)); |
---|
50 | end |
---|
51 | if isfield(PlotParam.Scalar,'IncrA') |
---|
52 | set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3)) |
---|
53 | end |
---|
54 | set(handles.CheckBW,'Value',PlotParam.Scalar.CheckBW) |
---|
55 | if isfield(PlotParam.Scalar,'Opacity')&&isfield(handles,'num_Opacity') |
---|
56 | set(handles.num_Opacity,'String',num2str(PlotParam.Scalar.Opacity)) |
---|
57 | end |
---|
58 | else |
---|
59 | set(handles.Scalar,'Visible','off') |
---|
60 | end |
---|
61 | |
---|
62 | %% parameter for vector field |
---|
63 | if isfield(PlotParam,'Vectors') |
---|
64 | set(handles.Vectors,'Visible','on') |
---|
65 | if isfield(PlotParam.Vectors,'VecScale') |
---|
66 | set(handles.num_VecScale,'String',num2str(PlotParam.Vectors.VecScale,3)) |
---|
67 | end |
---|
68 | if isfield(PlotParam.Vectors,'MinC')&& isfield(PlotParam.Vectors,'MaxC') |
---|
69 | MinC=PlotParam.Vectors.MinC; |
---|
70 | MaxC=PlotParam.Vectors.MaxC; |
---|
71 | set(handles.num_MinVec,'String', num2str(MinC,3)); |
---|
72 | set(handles.num_MaxVec,'String',num2str(MaxC,3)); |
---|
73 | list=get(handles.ColorCode,'String'); |
---|
74 | ichoice=get(handles.ColorCode,'Value'); |
---|
75 | color_option=list{ichoice}; |
---|
76 | test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr'); |
---|
77 | if test3color% need to update color thresholds |
---|
78 | set(handles.num_ColCode1,'Visible','on') |
---|
79 | set(handles.num_ColCode2,'Visible','on') |
---|
80 | set(handles.Slider1,'Visible','on') |
---|
81 | set(handles.Slider2,'Visible','on') |
---|
82 | %ColCode1=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode1; |
---|
83 | %ColCode2=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode2; |
---|
84 | % ColCode1=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode1; |
---|
85 | %ColCode2=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode2; |
---|
86 | set(handles.num_ColCode1,'String',num2str(PlotParam.Vectors.ColCode1,3)) |
---|
87 | set(handles.num_ColCode2,'String',num2str(PlotParam.Vectors.ColCode2,3)) |
---|
88 | set(handles.Slider1,'Value',(PlotParam.Vectors.ColCode1-MinC)/(MaxC-MinC)) |
---|
89 | set(handles.Slider2,'Value',(PlotParam.Vectors.ColCode2-MinC)/(MaxC-MinC)) |
---|
90 | else |
---|
91 | set(handles.num_ColCode1,'Visible','off') |
---|
92 | set(handles.num_ColCode2,'Visible','off') |
---|
93 | set(handles.Slider1,'Visible','off') |
---|
94 | set(handles.Slider2,'Visible','off') |
---|
95 | end |
---|
96 | end |
---|
97 | else |
---|
98 | set(handles.Vectors,'Visible','off') |
---|
99 | if isfield(handles,'edit_vect') |
---|
100 | set(handles.edit_vect,'Visible','off') |
---|
101 | set(handles.record,'Visible','off') |
---|
102 | end |
---|
103 | end |
---|