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