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