[8]  1  %'read_plot_param': read plotting parameters from the interface uvmat


 2  %


 3  % function PlotParam=read_plot_param(handles)


 4  %


 5  % OUTPUT:


 6  % PlotParam: structure containing the values of all the relevant plotting parameters


 7  %


 8  % INPUT:


 9  % handles: structure containing the handles of the relevant uicontrols in the uvmat interface


 10  %


 11  %  TODO: get the handles using get_plot_handles and findobj as default input 


 12 


 13  function PlotParam=read_plot_param(handles)


 14 


 15  PlotParam.Auto_xy=get(handles.auto_xy,'Value');


 16 


 17  % scalars


 18  Scalar.MaxA=str2double(get(handles.MaxA,'String'));


 19  Scalar.MinA=str2double(get(handles.MinA,'String'));


 20  Scalar.AutoScal=get(handles.AutoScal,'Value');


 21  Scalar.BW=get(handles.BW,'Value');


 22  Scalar.Contours=get(handles.Contours,'Value')==2;


 23  Scalar.IncrA=str2double(get(handles.IncrA,'String'));


 24  PlotParam.Scalar=Scalar;


 25 


 26  %vectors


 27  Vectors.VecScale=str2double(get(handles.VecScale,'String'));


 28  Vectors.AutoVec=get(handles.AutoVec,'Value');%automatic vector length


 29  Vectors.HideFalse=get(handles.HideFalse,'Value');


 30  Vectors.HideWarning=get(handles.HideWarning,'Value');


 31  Vectors.decimate4=get(handles.decimate4,'Value');% =1; for reducing the nbre of vectors


 32 


 33  %vector color


 34  code_list=get(handles.color_code,'String');


 35  val=get(handles.color_code,'Value');


 36  % menu_col=get(handles.col_vec,'String');


 37  % menu_val=get(handles.col_vec,'Value');


 38  colcode1=str2double(get(handles.colcode1,'String'));% first threshold for rgb, first value for'continuous'


 39  colcode2=str2double(get(handles.colcode2,'String'));% second threshold for rgb, last value (saturation) for 'continuous'


 40 


 41  Vectors.ColorCode=code_list{val}; % option of color code for vectors


 42  Vectors.FixedCbounds=get(handles.AutoVecColor,'Value');% =1; fixed scale for color vector, =0 otherwise (default)


 43  Vectors.MinC=str2num(get(handles.min_vec,'String')); % imposed min of C, (needed if .FixedCbounds=1)


 44  Vectors.MaxC=str2num(get(handles.max_vec,'String')); % imposed max of C, needed if .FixedCbounds=1


 45  if Vectors.MaxC <= Vectors.MinC


 46  Vectors.ColorCode='black';


 47  else


 48  Vectors.colcode1=Vectors.MinC+(colcode1Vectors.MinC)/(Vectors.MaxCVectors.MinC);% relative thresholds


 49  Vectors.colcode2=Vectors.MinC+(colcode2Vectors.MinC)/(Vectors.MaxCVectors.MinC);


 50  end


 51  PlotParam.Vectors=Vectors;


 52 

