- Timestamp:
- Feb 5, 2011, 11:25:38 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r177 r191 204 204 205 205 % store the calibration data, by default in the xml file of the currently displayed image 206 hhuvmat=guidata(findobj(allchild(0),'Name','uvmat'));%handles of elements in the GUI uvmat 206 huvmat=findobj(allchild(0),'Name','uvmat'); 207 UvData=get(huvmat,'UserData'); 208 NbSlice_j=1;%default 209 ZStart=Z_plane; 210 ZEnd=Z_plane; 211 if isfield(UvData,'XmlData') 212 UvData.XmlData 213 if isfield(UvData.XmlData,'TranslationMotor') 214 NbSlice_j=UvData.XmlData.TranslationMotor.Nbslice; 215 ZStart=UvData.XmlData.TranslationMotor.ZStart; 216 ZEnd=UvData.XmlData.TranslationMotor.ZEnd; 217 end 218 end 219 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat 207 220 RootPath=''; 208 221 RootFile=''; … … 227 240 if strcmp(answer,'Yes') 228 241 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration 229 answer_1=msgbox_uvmat('INPUT_TXT',' Z= ',num2str(Z_plane)); 230 if strcmp(answer_1,'Cancel') 242 input_key={'Z (first position)','Z (last position)','Z (water surface)', 'refractive index','NbSlice','volume scan (y/n)','tilt angle'}; 243 input_val=[{num2str(ZEnd/10)} {num2str(ZStart/10)} {num2str(ZStart/10)} {'1.33'} num2str(NbSlice_j) {'y'} {'0'}]; 244 answer=inputdlg(input_key,'slice position(s)',ones(1,7), input_val,'on'); 245 %answer_1=msgbox_uvmat('INPUT_TXT',' Z= ',num2str(Z_plane)); 246 GeometryCalib.NbSlice=str2double(answer{5}); 247 GeometryCalib.VolumeScan=answer{6}; 248 if isempty(answer) 231 249 Z_plane=0; %default 232 250 else 233 Z_plane=str2double(answer_1); 234 end 235 GeometryCalib.NbSlice=1; 236 GeometryCalib.SliceCoord=[0 0 Z_plane]; 251 Z_plane=linspace(str2double(answer{1}),str2double(answer{2}),GeometryCalib.NbSlice); 252 end 253 GeometryCalib.SliceCoord=Z_plane'*[0 0 1] 237 254 end 238 255 errormsg=update_imadoc(GeometryCalib,outputfile);% introduce the calibration data in the xml file … … 250 267 delete(hhh); 251 268 end 252 set(hhuvmat.Fix edLimits,'Value',0)% put FixedLimits option to 'off'253 set(hhuvmat.Fix edLimits,'BackgroundColor',[0.7 0.7 0.7])269 set(hhuvmat.FixLimits,'Value',0)% put FixedLimits option to 'off' 270 set(hhuvmat.FixLimits,'BackgroundColor',[0.7 0.7 0.7]) 254 271 UserData=get(handles.geometry_calib,'UserData'); 255 272 UserData.XmlInputFile=outputfile;%save the current xml file name -
trunk/src/imadoc2struct.m
r185 r191 112 112 end 113 113 114 %% motor 115 if strcmp(option,'*') || strcmp(option,'GeometryCalib') 116 uid_subtree=find(t,'/ImaDoc/TranslationMotor'); 117 if length(uid_subtree)==1 118 subt=branch(t,uid_subtree);%subtree under GeometryCalib 119 [s.TranslationMotor,errormsg]=read_subtree(subt,{'Nbslice','ZStart','ZEnd'},[1 1 1],[1 1 1]) 120 end 121 end 114 122 %% geometric calibration 115 123 if strcmp(option,'*') || strcmp(option,'GeometryCalib') … … 200 208 end 201 209 end 210 uid_VolumeScan=find(subt,'/GeometryCalib/VolumeScan'); 211 if ~isempty(uid_VolumeScan) 212 tsai.VolumeScan=get(subt,children(subt,uid_VolumeScan),'value'); 213 end 202 214 if strcmp(option,'GeometryCalib') 203 215 tsai.PointCoord=get_value(subt,'/GeometryCalib/SourceCalib/PointCoord',[0 0 0 0 0]); … … 207 219 end 208 220 end 221 222 %-------------------------------------------------- 223 % read a subtree 224 % INPUT: 225 % t: xltree 226 % head_element: head elelemnt of the subtree 227 % Data, structure containing 228 % .Key: element name 229 % .Type: type of element ('charg', 'float'....) 230 % .NbOccur: nbre of occurrence, NaN for un specified number 231 function [s,errormsg]=read_subtree(subt,Data,NbOccur,NumTest) 232 %-------------------------------------------------- 233 s=[];%default 234 errormsg=''; 235 head_element=get(subt,1,'name') 236 cont=get(subt,1,'contents'); 237 if ~isempty(cont) 238 for ilist=1:length(Data) 239 uid_key=find(subt,[head_element '/' Data{ilist}]) 240 if ~isequal(length(uid_key),NbOccur(ilist)) 241 errormsg=['wrong number of occurence for ' Data{ilist}] 242 return 243 end 244 for ival=1:length(uid_key) 245 val=get(subt,children(subt,uid_key(ival)),'value') 246 if ~NumTest(ilist) 247 eval(['s.' Data{ilist} '=val;']); 248 else 249 eval(['s.' Data{ilist} '=str2double(val);']) 250 end 251 end 252 end 253 end 254 209 255 210 256 %-------------------------------------------------- -
trunk/src/plot_field.m
r188 r191 53 53 % 54 54 % PlotParam: parameters for plotting, as read on the uvmat interface (by function 'read_plot_param.m') 55 % .Fix edLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits56 % . Auto_xy: =0 (default): kepp 1 to 1 aspect ratio for x and y scales, =1: automatic adjustment of the graph55 % .FixLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits 56 % .FixEqual: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales. 57 57 % --scalars-- 58 58 % .Scalar.MaxA: upper bound (saturation color) for the scalar representation, max(field) by default 59 59 % .Scalar.MinA: lower bound (saturation) for the scalar representation, min(field) by default 60 % .Scalar. AutoScal: =1(default) lower and upper bounds of the scalar representation set to the min and max of the field61 % = 0lower and upper bound imposed by .AMax and .MinA60 % .Scalar.FixScal: =0 (default) lower and upper bounds of the scalar representation set to the min and max of the field 61 % =1 lower and upper bound imposed by .AMax and .MinA 62 62 % .Scalar.BW= 1 black and white representation imposed, =0 by default. 63 63 % .Scalar.Contours= 1: represent scalars by contour plots (Matlab function 'contour'); =0 by default … … 65 65 % -- vectors-- 66 66 % .Vectors.VecScale: scale for the vector representation 67 % .Vectors. AutoVec: =0 (default) automatic length for vector representation, =1: length set by .VecScale67 % .Vectors.FixVec: =0 (default) automatic length for vector representation, =1: length set by .VecScale 68 68 % .Vectors.HideFalse= 0 (default) false vectors represented in magenta, =1: false vectors not represented; 69 69 % .Vectors.HideWarning= 0 (default) vectors marked by warnflag~=0 marked in black, 1: no warning representation; … … 177 177 178 178 %% set axes properties 179 if isfield(PlotParam,'Fix edLimits') && isequal(PlotParam.FixedLimits,1) %adjust the graph limits*179 if isfield(PlotParam,'FixLimits') && isequal(PlotParam.FixLimits,1) %adjust the graph limits* 180 180 set(haxes,'XLimMode', 'manual') 181 181 set(haxes,'YLimMode', 'manual') … … 184 184 set(haxes,'YLimMode', 'auto') 185 185 end 186 if isfield(PlotParam,'Auto_xy') && isequal(PlotParam.Auto_xy,1) 186 if ~isfield(PlotParam,'FixEqual')&& isfield(Data,'CoordUnit') 187 PlotParam.FixEqual=1; 188 end 189 if isfield(PlotParam,'FixEqual') && isequal(PlotParam.FixEqual,1) 190 set(haxes,'DataAspectRatioMode','manual') 191 set(haxes,'DataAspectRatio',[1 1 1]) 192 else 187 193 set(haxes,'DataAspectRatioMode','auto')%automatic aspect ratio 188 else189 set(haxes,'DataAspectRatioMode','manual')190 194 end 191 195 else … … 199 203 errormsg=[]; 200 204 AxeData=get(haxes,'UserData'); 205 if isempty(index_1D) 206 plot_profile([],[],[],haxes);% 207 else 208 PlotParamOut=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,PlotParam);% 209 if testzoomaxes 210 [zoomaxes,PlotParamOut]=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),zoomaxes,PlotParam); 211 AxeData.ZoomAxes=zoomaxes; 212 end 213 PlotType='line'; 214 end 201 215 if isempty(index_2D) 202 216 plot_plane([],[],[],haxes);%removes images or vector plots if any … … 209 223 end 210 224 end 211 if isempty(index_1D)212 plot_profile([],[],[],haxes);%213 else214 plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,PlotParam);%215 if testzoomaxes216 [zoomaxes,PlotParamOut]=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),zoomaxes,PlotParam);217 AxeData.ZoomAxes=zoomaxes;218 end219 PlotType='line';220 end221 225 htext=findobj(hfig,'Tag','text_display'); 222 226 if ~isempty(htext) … … 230 234 if ~isempty(errormsg) 231 235 msgbox_uvmat('ERROR', errormsg) 236 end 237 if isfield(PlotParamOut,'MinX') 238 set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX]) 239 set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY]) 232 240 end 233 241 … … 320 328 321 329 %------------------------------------------------------------------- 322 function [haxes]=plot_profile(data,CellVarIndex,VarType,haxes,PlotParam)330 function PlotParamOut=plot_profile(data,CellVarIndex,VarType,haxes,PlotParam) 323 331 %------------------------------------------------------------------- 332 PlotParamOut=PlotParam; %default 324 333 hfig=get(haxes,'parent'); 325 334 %suppress existing plot isf empty data … … 504 513 PlotParam.Vectors=[]; 505 514 end 515 506 516 PlotParamOut=PlotParam;%default 507 517 hfig=get(haxes,'parent'); 508 518 hcol=findobj(hfig,'Tag','Colorbar'); %look for colorbar axes 509 519 hima=findobj(haxes,'Tag','ima');% search existing image in the current axes 510 % AxeData=get(haxes,'UserData'); %default511 % if ~isstruct(AxeData)% AxeData must be a structure512 % AxeData=[];513 % end514 % AxeData.NbDim=2;515 % if isfield(Data,'ObjectCoord')516 % AxeData.ObjectCoord=Data.ObjectCoord;517 % end518 520 errormsg=[];%default 519 521 test_ima=0; %default: test for image or map plot … … 720 722 %case of grey level images or contour plot 721 723 if siz==2 722 if ~isfield(PlotParam.Scalar,' AutoScal')723 PlotParam.Scalar. AutoScal=0;%default724 if ~isfield(PlotParam.Scalar,'FixScal') 725 PlotParam.Scalar.FixScal=0;%default 724 726 end 725 727 if ~isfield(PlotParam.Scalar,'MinA') … … 729 731 PlotParam.Scalar.MaxA=[];%default 730 732 end 731 if isequal(PlotParam.Scalar. AutoScal,0)||isempty(PlotParam.Scalar.MinA)||~isa(PlotParam.Scalar.MinA,'double') %correct if there is no numerical data in edit box733 if isequal(PlotParam.Scalar.FixScal,0)||isempty(PlotParam.Scalar.MinA)||~isa(PlotParam.Scalar.MinA,'double') %correct if there is no numerical data in edit box 732 734 MinA=double(min(min(A))); 733 735 else 734 736 MinA=PlotParam.Scalar.MinA; 735 737 end; 736 if isequal(PlotParam.Scalar. AutoScal,0)||isempty(PlotParam.Scalar.MaxA)||~isa(PlotParam.Scalar.MaxA,'double') %correct if there is no numerical data in edit box738 if isequal(PlotParam.Scalar.FixScal,0)||isempty(PlotParam.Scalar.MaxA)||~isa(PlotParam.Scalar.MaxA,'double') %correct if there is no numerical data in edit box 737 739 MaxA=double(max(max(A))); 738 740 else … … 1049 1051 AxeData.RangeX=Xlim; 1050 1052 AxeData.RangeY=Ylim; 1053 1051 1054 % adjust the size of the plot to include the whole field, except if PlotParam.FixedLimits=1 1052 if ~(isfield(PlotParam,'FixedLimits') && PlotParam.FixedLimits) && test_lim 1053 if Xlim(2)>Xlim(1) 1054 set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates 1055 end 1056 if Ylim(2)>Ylim(1) 1057 set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate 1058 end 1059 end 1060 if ~(isfield(PlotParam,'Auto_xy') && isequal(PlotParam.Auto_xy,1)) 1061 set(haxes,'DataAspectRatio',[1 1 1]) 1062 end 1055 if ~(isfield(PlotParam,'FixLimits') && PlotParam.FixLimits) && test_lim 1056 PlotParamOut.MinX=Xlim(1); 1057 PlotParamOut.MaxX=Xlim(2); 1058 PlotParamOut.MinY=Ylim(1); 1059 PlotParamOut.MaxY=Ylim(2); 1060 if Xlim(2)>Xlim(1) 1061 set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates 1062 end 1063 if Ylim(2)>Ylim(1) 1064 set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate 1065 end 1066 end 1067 1063 1068 set(haxes,'YDir','normal') 1064 1069 set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']); -
trunk/src/read_plot_param.m
r61 r191 13 13 function PlotParam=read_plot_param(handles) 14 14 15 PlotParam.Auto_xy=get(handles.auto_xy,'Value'); 16 PlotParam.FixedLimits=get(handles.FixedLimits,'Value'); 17 15 PlotParam.FixEqual=get(handles.FixEqual,'Value'); 16 PlotParam.FixLimits=get(handles.FixLimits,'Value'); 17 if PlotParam.FixLimits 18 PlotParam.MinX=str2double(get(handles.MinX,'String')); 19 PlotParam.MaxX=str2double(get(handles.MaxX,'String')); 20 PlotParam.MinY=str2double(get(handles.MinY,'String')); 21 PlotParam.MaxY=str2double(get(handles.MaxY,'String')); 22 end 18 23 % scalars 19 24 Scalar.MaxA=str2double(get(handles.MaxA,'String')); 20 25 Scalar.MinA=str2double(get(handles.MinA,'String')); 21 Scalar. AutoScal=get(handles.AutoScal,'Value');26 Scalar.FixScal=get(handles.FixScal,'Value'); 22 27 Scalar.BW=get(handles.BW,'Value'); 23 28 Scalar.Contours=get(handles.Contours,'Value')==2; … … 27 32 %vectors 28 33 Vectors.VecScale=str2double(get(handles.VecScale,'String')); 29 Vectors. AutoVec=get(handles.AutoVec,'Value');%automatic vector length34 Vectors.FixVec=get(handles.FixVec,'Value');%automatic vector length 30 35 Vectors.HideFalse=get(handles.HideFalse,'Value'); 31 36 Vectors.HideWarning=get(handles.HideWarning,'Value'); … … 42 47 Vectors.ColorCode=code_list{val}; % option of color code for vectors 43 48 Vectors.FixedCbounds=get(handles.AutoVecColor,'Value');% =1; fixed scale for color vector, =0 otherwise (default) 44 Vectors.MinC=str2 num(get(handles.min_vec,'String')); % imposed min of C, (needed if .FixedCbounds=1)45 Vectors.MaxC=str2 num(get(handles.max_vec,'String')); % imposed max of C, needed if .FixedCbounds=149 Vectors.MinC=str2double(get(handles.min_vec,'String')); % imposed min of C, (needed if .FixedCbounds=1) 50 Vectors.MaxC=str2double(get(handles.max_vec,'String')); % imposed max of C, needed if .FixedCbounds=1 46 51 if Vectors.MaxC <= Vectors.MinC 47 52 Vectors.ColorCode='black'; -
trunk/src/update_imadoc.m
r156 r191 8 8 %------------------------------------------------------------- 9 9 function errormsg=update_imadoc(GeometryCalib,outputfile) 10 tic11 10 errormsg=''; 12 11 testappend=0; … … 64 63 [t,uid_calib]=add(t,1,'element','GeometryCalib'); 65 64 end 65 'TESTupdate' 66 GeometryCalib 66 67 t=struct2xml(GeometryCalib,t,uid_calib); 67 68 save(t,outputfile); 68 toc -
trunk/src/uvmat.m
r187 r191 309 309 set(handles.transform_fct,'UserData',fct_handle)% store the list of path in UserData of ACTION 310 310 set(handles.uvmat,'UserData',UvData) 311 %initiates menu of vector colors 312 % list_menu=calc_field; 313 % %list_menu=[{'ima_cor'};{'black'};{'white'};list_menu(3:end)]; 314 % set(handles.col_vec,'String',list_menu) 311 %set(handles.FixEqual,'Value',1)% by default: axes free to adapt in aspect ratio 312 %set(handles.FixEqual,'BackgroundColor',[1 1 0]) 315 313 316 314 %check the path and date of modification of all functions in uvmat … … 352 350 testinputfield=1; 353 351 end 354 % if ~isempty(Field)355 % menu_str=update_menu(handles.Fields,'get_field...');356 % % set(handles.Fields,'Value',1)357 % % set(handles.Fields,'String',{'get_field...'})358 % testinputfield=1;359 % elseif ischar(input)360 % scan_i_Callback(handles.scan_i, eventdata, handles);361 % end362 352 else 363 353 if ishandle(handles.UVMAT_title) … … 749 739 drawnow 750 740 if isfield(XmlData, 'GeometryCalib') && ~isempty(XmlData.GeometryCalib) 741 XmlData.GeometryCalib 742 if isfield(XmlData.GeometryCalib,'VolumeScan') && isequal(XmlData.GeometryCalib.VolumeScan,'y') 743 'TESTvol' 744 set (handles.nb_slice,'String','volume') 745 end 751 746 hgeometry_calib=findobj('tag','geometry_calib'); 752 747 if ~isempty(hgeometry_calib) … … 837 832 set(handles.pycm,'String',num2str(pixcmy)) 838 833 end 839 if ~get(handles.Fix edLimits,'Value')834 if ~get(handles.FixLimits,'Value') 840 835 set(handles.transform_fct,'Value',2); % phys transform by default if fixedLimits is off 841 836 end … … 848 843 set(handles.slices,'Value',1) 849 844 end 850 if isfield(GeometryCalib,' NbSlice') && isequal(GeometryCalib.NbSlice,'volume')845 if isfield(GeometryCalib,'VolumeScan') && isequal(GeometryCalib.VolumeScan,'y') 851 846 set(handles.nb_slice,'String','volume') 852 847 else … … 2098 2093 %update the z position index 2099 2094 nbslice_str=get(handles.nb_slice,'String'); 2100 if isequal(nbslice_str,'volume') 2095 if isequal(nbslice_str,'volume')%NOT USED 2101 2096 z_index=num_j1; 2102 2097 set(handles.z_index,'String',num2str(z_index)) … … 2523 2518 UvData.Object{1}.plotaxes=handles.axes3;%default plotting axis 2524 2519 end 2520 testnewseries=UvData.NewSeries; 2525 2521 UvData.NewSeries=0;% put to 0 the test for a new field series (set by RootPath_callback) 2526 2522 set(handles.uvmat,'UserData',UvData) … … 2543 2539 haxes(1)=handles.axes3; 2544 2540 PlotParam{1}=read_plot_param(handles);%read plotting parameters on the uvmat interfac 2545 keeplim(1)=get(handles.Fix edLimits,'Value');% test for fixed graph limits2541 keeplim(1)=get(handles.FixLimits,'Value');% test for fixed graph limits 2546 2542 PosColorbar{1}=UvData.OpenParam.PosColorbar;%prescribe the colorbar position on the uvmat interface 2547 2543 … … 2564 2560 iobj=IndexObj(imap); 2565 2561 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj});% project field on the object 2562 if testnewseries && isfield(ObjectData,'CoordUnit') 2563 PlotParam{imap}=rmfield(PlotParam{imap},'FixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field) 2564 end 2566 2565 if ~isempty(errormsg) 2567 2566 return … … 2610 2609 ObjectData.DimValue(ind_off)=[]; 2611 2610 end 2612 end 2613 2611 end 2614 2612 if ~isempty(ObjectData) 2615 2613 PlotType='none'; %default … … 2622 2620 ObjectData.Mesh=Field.Mesh; % gives an estimated mesh size (useful for mouse action on the plot) 2623 2621 end 2624 % if imap==12625 % UvData.axes3=ObjectData;2626 % else2627 % ViewFieldData=get(view_field_handle,'UserData');2628 % ViewFieldData.axes3=ObjectData;2629 % set(view_field_handle,'UserData',ViewFieldData)2630 % end2631 2622 end 2632 2623 if isequal(PlotType,'none') … … 2640 2631 end 2641 2632 end 2642 2643 2633 2644 2634 %% update the mask … … 2764 2754 2765 2755 %------------------------------------------------------------------- 2766 % --- Executes on button press in 'Fix edLimits'.2767 %------------------------------------------------------------------- 2768 function Fix edLimits_Callback(hObject, eventdata, handles)2769 test=get(handles.Fix edLimits,'Value');2756 % --- Executes on button press in 'FixLimits'. 2757 %------------------------------------------------------------------- 2758 function FixLimits_Callback(hObject, eventdata, handles) 2759 test=get(handles.FixLimits,'Value'); 2770 2760 if test 2771 set(handles.Fix edLimits,'BackgroundColor',[1 1 0])2772 else 2773 set(handles.Fix edLimits,'BackgroundColor',[0.7 0.7 0.7])2761 set(handles.FixLimits,'BackgroundColor',[1 1 0]) 2762 else 2763 set(handles.FixLimits,'BackgroundColor',[0.7 0.7 0.7]) 2774 2764 update_plot(handles); 2775 2765 end 2776 2766 2777 2767 %------------------------------------------------------------------- 2778 % --- Executes on button press in auto_xy.2779 function auto_xy_Callback(hObject, eventdata, handles)2780 test=get(handles. auto_xy,'Value');2768 % --- Executes on button press in FixEqual. 2769 function FixEqual_Callback(hObject, eventdata, handles) 2770 test=get(handles.FixEqual,'Value'); 2781 2771 if test 2782 set(handles. auto_xy,'BackgroundColor',[1 1 0])2772 set(handles.FixEqual,'BackgroundColor',[1 1 0]) 2783 2773 cla(handles.axes3) 2784 2774 update_plot(handles); 2785 2775 else 2786 set(handles. auto_xy,'BackgroundColor',[0.7 0.7 0.7])2776 set(handles.FixEqual,'BackgroundColor',[0.7 0.7 0.7]) 2787 2777 update_plot(handles); 2788 2778 % axis(handles.axes3,'image') … … 2799 2789 if (get(handles.zoom,'Value') == 1); 2800 2790 set(handles.zoom,'BackgroundColor',[1 1 0]) 2801 set(handles.Fix edLimits,'Value',1)% propose by default fixed limits for the plotting axes2802 set(handles.Fix edLimits,'BackgroundColor',[1 1 0])2791 set(handles.FixLimits,'Value',1)% propose by default fixed limits for the plotting axes 2792 set(handles.FixLimits,'BackgroundColor',[1 1 0]) 2803 2793 else 2804 2794 set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7]) … … 3148 3138 setfield(handles);% update the field structure ('civ1'....) 3149 3139 3150 if ~ isfield(UvData,'NewSeries')||isequal(UvData.NewSeries,0)3140 if ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1)) 3151 3141 run0_Callback(hObject, eventdata, handles) 3152 3142 end … … 3353 3343 set(handles.uvmat,'UserData',UvData) 3354 3344 setfield(handles);% update the field structure ('civ1'....) 3355 if ~ isfield(UvData,'NewSeries')||isequal(UvData.NewSeries,0)3345 if ~(isfield(UvData,'NewSeries')&&isequal(UvData.NewSeries,1)) 3356 3346 run0_Callback(hObject, eventdata, handles) 3357 3347 end … … 3883 3873 end 3884 3874 3885 set(handles.Fix edLimits,'Value',0)3886 set(handles.Fix edLimits,'BackgroundColor',[0.7 0.7 0.7])3875 set(handles.FixLimits,'Value',0) 3876 set(handles.FixLimits,'BackgroundColor',[0.7 0.7 0.7]) 3887 3877 3888 3878 UvData=get(huvmat,'UserData'); … … 4004 3994 % set(haxes,'XLimMode','auto')%reset auto mode (after zoom effect) 4005 3995 % set(haxes,'YLimMode','auto') 4006 PlotParam.Auto_xy=1; 4007 plot_field(Histo,haxes,PlotParam); 4008 end 4009 end 4010 4011 3996 % PlotParam.Auto_xy=1; 3997 plot_field(Histo,haxes); 3998 end 3999 end 4012 4000 4013 4001 %------------------------------------------------ 4014 4002 %CALLBACKS FOR PLOTTING PARAMETERS 4015 4003 %------------------------------------------------- 4004 %----------------------------------------------------------------- 4005 function MinX_Callback(hObject, eventdata, handles) 4006 %------------------------------------------ 4007 set(handles.FixLimits,'Value',1) %suppress auto mode 4008 set(handles.FixLimits,'BackgroundColor',[1 1 0]) 4009 update_plot(handles); 4010 4011 %----------------------------------------------------------------- 4012 function MaxX_Callback(hObject, eventdata, handles) 4013 %------------------------------------------ 4014 set(handles.FixLimits,'Value',1) %suppress auto mode 4015 set(handles.FixLimits,'BackgroundColor',[1 1 0]) 4016 update_plot(handles); 4017 4018 %----------------------------------------------------------------- 4019 function MinY_Callback(hObject, eventdata, handles) 4020 %------------------------------------------ 4021 set(handles.FixLimits,'Value',1) %suppress auto mode 4022 set(handles.FixLimits,'BackgroundColor',[1 1 0]) 4023 update_plot(handles); 4024 4025 %----------------------------------------------------------------- 4026 function MaxY_Callback(hObject, eventdata, handles) 4027 %------------------------------------------ 4028 set(handles.FixLimits,'Value',1) %suppress auto mode 4029 set(handles.FixLimits,'BackgroundColor',[1 1 0]) 4030 update_plot(handles); 4016 4031 4017 4032 %----------------------------------------------------------------- 4018 4033 function MinA_Callback(hObject, eventdata, handles) 4019 4034 %------------------------------------------ 4020 set(handles. AutoScal,'Value',1) %suppress auto mode4021 set(handles. AutoScal,'BackgroundColor',[1 1 0])4035 set(handles.FixScal,'Value',1) %suppress auto mode 4036 set(handles.FixScal,'BackgroundColor',[1 1 0]) 4022 4037 update_plot(handles); 4023 4038 … … 4025 4040 function MaxA_Callback(hObject, eventdata, handles) 4026 4041 %-------------------------------------------- 4027 set(handles. AutoScal,'Value',1) %suppress auto mode4028 set(handles. AutoScal,'BackgroundColor',[1 1 0])4042 set(handles.FixScal,'Value',1) %suppress auto mode 4043 set(handles.FixScal,'BackgroundColor',[1 1 0]) 4029 4044 update_plot(handles); 4030 4045 4031 4046 %----------------------------------------------- 4032 function AutoScal_Callback(hObject, eventdata, handles)4047 function FixScal_Callback(hObject, eventdata, handles) 4033 4048 %-------------------------------------------- 4034 test=get(handles. AutoScal,'Value');4049 test=get(handles.FixScal,'Value'); 4035 4050 if test 4036 set(handles. AutoScal,'BackgroundColor',[1 1 0])4037 else 4038 set(handles. AutoScal,'BackgroundColor',[0.7 0.7 0.7])4051 set(handles.FixScal,'BackgroundColor',[1 1 0]) 4052 else 4053 set(handles.FixScal,'BackgroundColor',[0.7 0.7 0.7]) 4039 4054 update_plot(handles); 4040 4055 end … … 4076 4091 function VecScale_Callback(hObject, eventdata, handles) 4077 4092 %------------------------------------------------------------------- 4078 set(handles. AutoVec,'Value',1);4079 set(handles. AutoVec,'BackgroundColor',[1 1 0])4093 set(handles.FixVec,'Value',1); 4094 set(handles.FixVec,'BackgroundColor',[1 1 0]) 4080 4095 update_plot(handles); 4081 4096 4082 4097 %------------------------------------------------------------------- 4083 function AutoVec_Callback(hObject, eventdata, handles)4084 %------------------------------------------------------------------- 4085 test=get(handles. AutoVec,'Value');4098 function FixVec_Callback(hObject, eventdata, handles) 4099 %------------------------------------------------------------------- 4100 test=get(handles.FixVec,'Value'); 4086 4101 if test 4087 set(handles. AutoVec,'BackgroundColor',[1 1 0])4102 set(handles.FixVec,'BackgroundColor',[1 1 0]) 4088 4103 else 4089 4104 update_plot(handles); 4090 4105 %set(handles.VecScale,'String',num2str(ScalOut.VecScale,3)) 4091 set(handles. AutoVec,'BackgroundColor',[0.7 0.7 0.7])4106 set(handles.FixVec,'BackgroundColor',[0.7 0.7 0.7]) 4092 4107 end 4093 4108 … … 4187 4202 AxeData=UvData.axes3; 4188 4203 PlotParam=read_plot_param(handles); 4204 PlotParam.Scalar 4189 4205 [PP,PlotParamOut]= plot_field(AxeData,haxes,PlotParam); 4190 4206 write_plot_param(handles,PlotParamOut); %update the auto plot parameters … … 4308 4324 PlotHandles=guidata(hview_field); 4309 4325 end 4310 % if ~isempty(ProjData) 4311 'TEST' 4312 ProjData 4313 plot_field(ProjData,PlotHandles.axes3,PlotHandles); 4314 % end 4326 plot_field(ProjData,PlotHandles.axes3,PlotHandles); 4315 4327 set(handles.uvmat,'UserData',UvData) 4316 4328 hother=findobj('Tag','proj_object');%find all the proj objects … … 4982 4994 delete_object(IndexObj) 4983 4995 end 4984 4985 4986 4987 4988 4996 4997 -
trunk/src/write_plot_param.m
r128 r191 1 1 %'write_plot_param': update the plotting parameters on the uvmat interface after a plotting operation 2 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)); 3 18 4 19 %scalar or image parameters … … 70 85 set(handles.MinA,'Visible',state) 71 86 %set(handles.IncrA,'Visible',state) 72 set(handles. AutoScal,'Visible',state)87 set(handles.FixScal,'Visible',state) 73 88 set(handles.BW,'Visible',state) 74 89 set(handles.Contours,'Visible',state) … … 89 104 % set(handles.VECT_title,'Visible',state) 90 105 set(handles.VecScale,'Visible',state) 91 set(handles. AutoVec,'Visible',state)106 set(handles.FixVec,'Visible',state) 92 107 set(handles.HideFalse,'Visible',state) 93 108 set(handles.HideWarning,'Visible',state)
Note: See TracChangeset
for help on using the changeset viewer.