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