1 | %'write_plot_param': update the plotting parameters on the uvmat interface after a plotting operation |
---|
2 | function write_plot_param(handles,PlotParam) |
---|
3 | |
---|
4 | %coordinates |
---|
5 | if isfield(PlotParam,'FixEqual') |
---|
6 | if PlotParam.FixEqual |
---|
7 | set(handles.FixEqual,'Value',1) |
---|
8 | set(handles.FixEqual,'BackgroundColor',[1 1 0]) |
---|
9 | else |
---|
10 | set(handles.FixEqual,'Value',0) |
---|
11 | set(handles.FixEqual,'BackgroundColor',[0.7 0.7 0.7]) |
---|
12 | end |
---|
13 | end |
---|
14 | set(handles.MinX,'String',num2str(PlotParam.MinX,4)); |
---|
15 | set(handles.MaxX,'String',num2str(PlotParam.MaxX,4)); |
---|
16 | set(handles.MinY,'String',num2str(PlotParam.MinY,4)); |
---|
17 | set(handles.MaxY,'String',num2str(PlotParam.MaxY,4)); |
---|
18 | |
---|
19 | %scalar or image parameters |
---|
20 | if isfield(PlotParam,'Scalar') |
---|
21 | set_scal_display(handles,'on') |
---|
22 | if isfield(PlotParam.Scalar,'MaxA') |
---|
23 | set(handles.MaxA,'String',num2str(PlotParam.Scalar.MaxA,3)); |
---|
24 | end |
---|
25 | if isfield(PlotParam.Scalar,'MinA') |
---|
26 | set(handles.MinA,'String',num2str(PlotParam.Scalar.MinA,3)); |
---|
27 | end |
---|
28 | |
---|
29 | if isfield(PlotParam.Scalar,'IncrA') |
---|
30 | set(handles.IncrA,'String',num2str(PlotParam.Scalar.IncrA,3)) |
---|
31 | end |
---|
32 | else |
---|
33 | set_scal_display(handles,'off') |
---|
34 | end |
---|
35 | |
---|
36 | % parameter for vector field |
---|
37 | if isfield(PlotParam,'Vectors') |
---|
38 | set_vect_display(handles,'on') |
---|
39 | if isfield(PlotParam.Vectors,'VecScale') |
---|
40 | set(handles.VecScale,'String',num2str(PlotParam.Vectors.VecScale,3)) |
---|
41 | end |
---|
42 | if isfield(PlotParam.Vectors,'MinC')&& isfield(PlotParam.Vectors,'MaxC') |
---|
43 | MinC=PlotParam.Vectors.MinC; |
---|
44 | MaxC=PlotParam.Vectors.MaxC; |
---|
45 | set(handles.min_vec,'String', num2str(MinC,3)); |
---|
46 | set(handles.max_vec,'String',num2str(MaxC,3)); |
---|
47 | list=get(handles.color_code,'String'); |
---|
48 | ichoice=get(handles.color_code,'Value'); |
---|
49 | color_option=list{ichoice}; |
---|
50 | test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr'); |
---|
51 | if test3color% need to update color thresholds |
---|
52 | set(handles.colcode1,'Visible','on') |
---|
53 | set(handles.colcode2,'Visible','on') |
---|
54 | set(handles.slider1,'Visible','on') |
---|
55 | set(handles.slider2,'Visible','on') |
---|
56 | % slider1=get(handles.slider1,'Value'); |
---|
57 | % slider2=get(handles.slider2,'Value'); |
---|
58 | colcode1=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode1; |
---|
59 | colcode2=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode2; |
---|
60 | set(handles.colcode1,'String',num2str(colcode1,3)) |
---|
61 | set(handles.colcode2,'String',num2str(colcode2,3)) |
---|
62 | set(handles.slider1,'Value',PlotParam.Vectors.colcode1) |
---|
63 | set(handles.slider2,'Value',PlotParam.Vectors.colcode2) |
---|
64 | else |
---|
65 | set(handles.colcode1,'Visible','off') |
---|
66 | set(handles.colcode2,'Visible','off') |
---|
67 | set(handles.slider1,'Visible','off') |
---|
68 | set(handles.slider2,'Visible','off') |
---|
69 | end |
---|
70 | end |
---|
71 | else |
---|
72 | set_vect_display(handles,'off') |
---|
73 | if isfield(handles,'edit_vect') |
---|
74 | set(handles.edit_vect,'Visible','off') |
---|
75 | set(handles.record,'Visible','off') |
---|
76 | end |
---|
77 | end |
---|
78 | |
---|
79 | %------------------------------------------------------------------ |
---|
80 | %prepare interface for scalar display: state ='on' or 'off' |
---|
81 | function set_scal_display(handles,state) |
---|
82 | %------------------------------------------------------------------ |
---|
83 | % set(handles.SCALAR_title,'Visible',state) |
---|
84 | set(handles.MaxA,'Visible',state) |
---|
85 | set(handles.MinA,'Visible',state) |
---|
86 | %set(handles.IncrA,'Visible',state) |
---|
87 | set(handles.FixScal,'Visible',state) |
---|
88 | set(handles.BW,'Visible',state) |
---|
89 | set(handles.Contours,'Visible',state) |
---|
90 | set(handles.min_title,'Visible',state) |
---|
91 | set(handles.max_title,'Visible',state) |
---|
92 | set(handles.frame_scal,'Visible',state) |
---|
93 | set(handles.npx,'Visible',state) |
---|
94 | set(handles.npy,'Visible',state) |
---|
95 | set(handles.npx_title,'Visible',state) |
---|
96 | set(handles.npy_title,'Visible',state) |
---|
97 | %set(handles.makemask,'Visible',state) |
---|
98 | |
---|
99 | %--------------------------------------------- |
---|
100 | %prepare interface for vector display: state ='on' or 'off' |
---|
101 | function set_vect_display(handles,state) |
---|
102 | %------------------------------------------------------------------ |
---|
103 | set(handles.frame_vect,'Visible',state) |
---|
104 | % set(handles.VECT_title,'Visible',state) |
---|
105 | set(handles.VecScale,'Visible',state) |
---|
106 | set(handles.FixVec,'Visible',state) |
---|
107 | set(handles.HideFalse,'Visible',state) |
---|
108 | set(handles.HideWarning,'Visible',state) |
---|
109 | % if isfield(handles,'record') |
---|
110 | % set(handles.record,'Visible',state) |
---|
111 | % end |
---|
112 | set(handles.colcode1,'Visible',state) |
---|
113 | set(handles.colcode2,'Visible',state) |
---|
114 | set(handles.min_vec,'Visible',state) |
---|
115 | set(handles.max_vec,'Visible',state) |
---|
116 | set(handles.scale_title,'Visible',state) |
---|
117 | set(handles.slider1,'Visible',state) |
---|
118 | set(handles.slider2,'Visible',state) |
---|
119 | set(handles.col_vec,'Visible',state) |
---|
120 | set(handles.Color_title,'Visible',state) |
---|
121 | set(handles.color_code,'Visible',state) |
---|
122 | set(handles.vec_col_bar,'Visible',state) |
---|
123 | % set(handles.record,'Visible',state) |
---|
124 | set(handles.AutoVecColor,'Visible',state) |
---|
125 | set(handles.decimate4,'Visible',state) |
---|
126 | set(handles.min_C_title,'Visible',state) |
---|
127 | set(handles.max_C_title,'Visible',state) |
---|
128 | if isfield(handles,'MenuEditVectors') |
---|
129 | set(handles.MenuEditVectors,'Enable',state) |
---|
130 | end |
---|