Changeset 292 for trunk/src/uvmat.m
- Timestamp:
- Nov 21, 2011, 11:12:06 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r278 r292 147 147 % = translate: translate an existing object 148 148 % = calibration: move a calibration point 149 % = zoom: isolate a subregion for zoom in=1 if an object is being currently drawn, 0 else (set to 0 by releasing mouse button)149 % = CheckZoom: isolate a subregion for CheckZoom in=1 if an object is being currently drawn, 0 else (set to 0 by releasing mouse button) 150 150 % .CurrentOrigin: Origin of a curently drawn edit_object 151 151 % .CurrentLine: currently drawn menuline (A REVOIR) 152 152 % .CurrentObject: handle of the currently drawn edit_object 153 % .CurrentRectZoom: current rectangle used for zoom153 % .CurrentRectZoom: current rectangle used for CheckZoom 154 154 155 155 % Properties attached to projection objects (create, menuline, menuplane...): … … 714 714 if isfield(imainfo,'Width') && isfield(imainfo,'Height') 715 715 if length(imainfo)>1 716 set(handles.n px,'String',num2str(imainfo(1).Width));%fills nbre of pixels x box717 set(handles.n py,'String',num2str(imainfo(1).Height));%fills nbre of pixels x box716 set(handles.num_Npx,'String',num2str(imainfo(1).Width));%fills nbre of pixels x box 717 set(handles.num_Npy,'String',num2str(imainfo(1).Height));%fills nbre of pixels x box 718 718 else 719 set(handles.n px,'String',num2str(imainfo.Width));%fills nbre of pixels x box720 set(handles.n py,'String',num2str(imainfo.Height));%fills nbre of pixels x box721 end 722 else 723 set(handles.n px,'String','');%fills nbre of pixels x box724 set(handles.n py,'String','');%fills nbre of pixels x box725 end 726 set(handles. BW,'Value',strcmp(ColorType,'grayscale'))% select handles.BW if grayscale image719 set(handles.num_Npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box 720 set(handles.num_Npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box 721 end 722 else 723 set(handles.num_Npx,'String','');%fills nbre of pixels x box 724 set(handles.num_Npy,'String','');%fills nbre of pixels x box 725 end 726 set(handles.CheckBW,'Value',strcmp(ColorType,'grayscale'))% select handles.CheckBW if grayscale image 727 727 728 728 % read parameters (time, geometric calibration..) from a documentation file (.xml advised) … … 783 783 elseif error==1, warntext='inconsistent number of fields in the .civ file'; 784 784 end 785 set(handles.n px,'String',num2str(npx));%fills nbre of pixels x box786 set(handles.n py,'String',num2str(npy));%fills nbre of pixels y box785 set(handles.num_Npx,'String',num2str(npx));%fills nbre of pixels x box 786 set(handles.num_Npy,'String',num2str(npy));%fills nbre of pixels y box 787 787 set(handles.pxcm,'String',num2str(pxcmx));%fills scale x (pixel/cm) box 788 788 set(handles.pycm,'String',num2str(pxcmy));%fills scale y (pixel/cm) box … … 842 842 set(handles.pycm,'String',num2str(pixcmy)) 843 843 end 844 if ~get(handles. FixLimits,'Value')844 if ~get(handles.CheckFixLimits,'Value') 845 845 set(handles.transform_fct,'Value',2); % phys transform by default if fixedLimits is off 846 846 end … … 900 900 col_vec={'get_field...'}; 901 901 end 902 set(handles. col_vec,'String',col_vec)902 set(handles.ListColorScalar,'String',col_vec) 903 903 end 904 904 end … … 1246 1246 end 1247 1247 if ~isempty(imainfo)% (an image has been introduced as second fierld input) 1248 if strcmp(get(handles.n px,'String'),'') || strcmp(get(handles.npy,'String'),'')%update npx and npy if it is not already filled by the first input field1248 if strcmp(get(handles.num_Npx,'String'),'') || strcmp(get(handles.num_Npy,'String'),'')%update npx and npy if it is not already filled by the first input field 1249 1249 if isfield(imainfo,'Width') && isfield(imainfo,'Height') 1250 set(handles.n px,'String',num2str(imainfo.Width));%fills nbre of pixels x box1251 set(handles.n py,'String',num2str(imainfo.Height));%fills nbre of pixels x box1250 set(handles.num_Npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box 1251 set(handles.num_Npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box 1252 1252 else 1253 set(handles.n px,'String','');%fills nbre of pixels x box1254 set(handles.n py,'String','');%fills nbre of pixels x box1255 end 1256 set(handles. BW,'Value',strcmp(ColorType,'grayscale'))% select handles.BW if grayscale image1253 set(handles.num_Npx,'String','');%fills nbre of pixels x box 1254 set(handles.num_Npy,'String','');%fills nbre of pixels x box 1255 end 1256 set(handles.CheckBW,'Value',strcmp(ColorType,'grayscale'))% select handles.CheckBW if grayscale image 1257 1257 end 1258 1258 end … … 1290 1290 end 1291 1291 1292 set(handles.n px,'String',num2str(npx));%fills nbre of pixels x box1293 set(handles.n py,'String',num2str(npy));%fills nbre of pixels y box1292 set(handles.num_Npx,'String',num2str(npx));%fills nbre of pixels x box 1293 set(handles.num_Npy,'String',num2str(npy));%fills nbre of pixels y box 1294 1294 set(handles.pxcm,'String',num2str(pxcmx));%fills scale x (pixel/cm) box 1295 1295 set(handles.pycm,'String',num2str(pxcmy));%fills scale y (pixel/cm) box … … 1683 1683 function runplus_Callback(hObject, eventdata, handles) 1684 1684 %------------------------------------------------------------------- 1685 eventdata1686 1685 set(handles.runplus,'BackgroundColor',[1 1 0])%paint the command button in yellow 1687 1686 drawnow … … 2115 2114 end 2116 2115 if strcmp(FieldName,'velocity') 2117 list_code=get(handles. color_code,'String');% list menu fields2118 index_code=get(handles. color_code,'Value');% selected string index2116 list_code=get(handles.ListColorCode,'String');% list menu fields 2117 index_code=get(handles.ListColorCode,'Value');% selected string index 2119 2118 if ~strcmp(list_code{index_code},'black') && ~strcmp(list_code{index_code},'white') 2120 list_code=get(handles. col_vec,'String');% list menu fields2121 index_code=get(handles. col_vec,'Value');% selected string index2119 list_code=get(handles.ListColorScalar,'String');% list menu fields 2120 index_code=get(handles.ListColorScalar,'Value');% selected string index 2122 2121 ParamIn.ColorVar= list_code{index_code}; % selected field 2123 2122 end … … 2156 2155 end 2157 2156 if isfield(ParamOut,'Npx')&& isfield(ParamOut,'Npy') 2158 set(handles.n px,'String',num2str(ParamOut.Npx));% display image size on the interface2159 set(handles.n py,'String',num2str(ParamOut.Npy));2157 set(handles.num_Npx,'String',num2str(ParamOut.Npx));% display image size on the interface 2158 set(handles.num_Npy,'String',num2str(ParamOut.Npy)); 2160 2159 end 2161 2160 if isfield(ParamOut,'TimeIndex') … … 2235 2234 end 2236 2235 if strcmp(FieldName_1,'velocity') 2237 list_code=get(handles. color_code,'String');% list menu fields2238 index_code=get(handles. color_code,'Value');% selected string index2236 list_code=get(handles.ListColorCode,'String');% list menu fields 2237 index_code=get(handles.ListColorCode,'Value');% selected string index 2239 2238 if ~strcmp(list_code{index_code},'black') && ~strcmp(list_code{index_code},'white') 2240 list_code=get(handles. col_vec,'String');% list menu fields2241 index_code=get(handles. col_vec,'Value');% selected string index2239 list_code=get(handles.ListColorScalar,'String');% list menu fields 2240 index_code=get(handles.ListColorScalar,'Value');% selected string index 2242 2241 ParamIn.ColorVar= list_code{index_code}; % selected field 2243 2242 end … … 2268 2267 %% update uvmat interface 2269 2268 if isfield(ParamOut,'Npx') 2270 set(handles.n px,'String',num2str(ParamOut.Npx));% display image size on the interface2271 set(handles.n py,'String',num2str(ParamOut.Npy));2269 set(handles.num_Npx,'String',num2str(ParamOut.Npx));% display image size on the interface 2270 set(handles.num_Npy,'String',num2str(ParamOut.Npy)); 2272 2271 elseif isfield(ParamOut_1,'Npx') 2273 set(handles.n px,'String',num2str(ParamOut_1.Npx));% display image size on the interface2274 set(handles.n py,'String',num2str(ParamOut_1.Npy));2272 set(handles.num_Npx,'String',num2str(ParamOut_1.Npx));% display image size on the interface 2273 set(handles.num_Npy,'String',num2str(ParamOut_1.Npy)); 2275 2274 end 2276 2275 … … 2581 2580 UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat 2582 2581 set(handles.list_object_1,'Value',1); 2583 list_object=get(handles.list_object_1,'String') 2582 list_object=get(handles.list_object_1,'String'); 2584 2583 if isempty(list_object) 2585 2584 list_object={''}; … … 2599 2598 %% reset the min and max of scalar if only the mask is displayed(TODO: check the need) 2600 2599 if isfield(UvData,'Mask')&& ~isfield(UvData,'A') 2601 set(handles. MinA,'String','0')2602 set(handles. MaxA,'String','255')2600 set(handles.num_MinA,'String','0') 2601 set(handles.num_MaxA,'String','255') 2603 2602 end 2604 2603 … … 2625 2624 haxes(1)=handles.axes3; 2626 2625 end 2627 PlotParam{1}=read_plot_param(handles);%read plotting parameters on the uvmat interfac 2628 keeplim(1)=get(handles.FixLimits,'Value');% test for fixed graph limits 2626 %PlotParam{1}=read_plot_param(handles);%read plotting parameters on the uvmat interfac 2627 PlotParam{1}=read_GUI(handles.uvmat); 2628 keeplim(1)=get(handles.CheckFixLimits,'Value');% test for fixed graph limits 2629 2629 PosColorbar{1}=UvData.OpenParam.PosColorbar;%prescribe the colorbar position on the uvmat interface 2630 2630 … … 2640 2640 plot_handles{2}=guidata(view_field_handle); 2641 2641 haxes(2)=plot_handles{2}.axes3; 2642 PlotParam{2}=read_plot_param(plot_handles{2});%read plotting parameters on the uvmat interface 2643 keeplim(2)=get(plot_handles{2}.FixLimits,'Value'); 2642 %PlotParam{2}=read_plot_param(plot_handles{2});%read plotting parameters on the viewinterface 2643 PlotParam{2}=read_GUI(handles.uvmat);%read plotting parameters on the uvmat interface 2644 keeplim(2)=get(plot_handles{2}.CheckFixLimits,'Value'); 2644 2645 PosColorbar{2}='*'; %TODO: deal with colorbar position on view_field 2645 2646 end … … 2650 2651 iobj=IndexObj(imap); 2651 2652 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj});% project field on the object 2652 if testnewseries && isfield(ObjectData,'CoordUnit') 2653 PlotParam{imap}=rmfield(PlotParam{imap} ,'FixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field)2653 if testnewseries && isfield(ObjectData,'CoordUnit')&& isfield(PlotParam{imap},'Coordinates') 2654 PlotParam{imap}=rmfield(PlotParam{imap}.Coordinates,'CheckFixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field) 2654 2655 end 2655 2656 if ~isempty(errormsg) … … 2872 2873 2873 2874 %------------------------------------------------------------------- 2874 % --- Executes on button press in ' FixLimits'.2875 %------------------------------------------------------------------- 2876 function FixLimits_Callback(hObject, eventdata, handles)2877 test=get(handles. FixLimits,'Value');2875 % --- Executes on button press in 'CheckFixLimits'. 2876 %------------------------------------------------------------------- 2877 function CheckFixLimits_Callback(hObject, eventdata, handles) 2878 test=get(handles.CheckFixLimits,'Value'); 2878 2879 if test 2879 set(handles. FixLimits,'BackgroundColor',[1 1 0])2880 else 2881 set(handles. FixLimits,'BackgroundColor',[0.7 0.7 0.7])2880 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 2881 else 2882 set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 2882 2883 update_plot(handles); 2883 2884 end 2884 2885 2885 2886 %------------------------------------------------------------------- 2886 % --- Executes on button press in FixEqual.2887 function FixEqual_Callback(hObject, eventdata, handles)2888 test=get(handles. FixEqual,'Value');2887 % --- Executes on button press in CheckFixEqual. 2888 function CheckFixEqual_Callback(hObject, eventdata, handles) 2889 test=get(handles.CheckFixEqual,'Value'); 2889 2890 if test 2890 set(handles. FixEqual,'BackgroundColor',[1 1 0])2891 set(handles.CheckFixEqual,'BackgroundColor',[1 1 0]) 2891 2892 cla(handles.axes3) 2892 2893 update_plot(handles); 2893 2894 else 2894 set(handles. FixEqual,'BackgroundColor',[0.7 0.7 0.7])2895 set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7]) 2895 2896 update_plot(handles); 2896 2897 % axis(handles.axes3,'image') … … 2901 2902 2902 2903 %------------------------------------------------------------------- 2903 % --- Executes on button press in ' zoom'.2904 %------------------------------------------------------------------- 2905 function zoom_Callback(hObject, eventdata, handles)2906 2907 if (get(handles. zoom,'Value') == 1);2908 set(handles. zoom,'BackgroundColor',[1 1 0])2909 set(handles. FixLimits,'Value',1)% propose by default fixed limits for the plotting axes2910 set(handles. FixLimits,'BackgroundColor',[1 1 0])2911 else 2912 set(handles. zoom,'BackgroundColor',[0.7 0.7 0.7])2904 % --- Executes on button press in 'CheckZoom'. 2905 %------------------------------------------------------------------- 2906 function CheckZoom_Callback(hObject, eventdata, handles) 2907 2908 if (get(handles.CheckZoom,'Value') == 1); 2909 set(handles.CheckZoom,'BackgroundColor',[1 1 0]) 2910 set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes 2911 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 2912 else 2913 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 2913 2914 end 2914 2915 … … 3258 3259 %common to Fields_1_Callback 3259 3260 if isequal(field,'image')||isequal(field_1,'image') 3260 set(handles. npx_title,'Visible','on')% visible npx,pxcm... buttons3261 set(handles. npy_title,'Visible','on')3262 set(handles.n px,'Visible','on')3263 set(handles.n py,'Visible','on')3264 else 3265 set(handles. npx_title,'Visible','off')% visible npx,pxcm... buttons3266 set(handles. npy_title,'Visible','off')3267 set(handles.n px,'Visible','off')3268 set(handles.n py,'Visible','off')3261 set(handles.TitleNpx,'Visible','on')% visible npx,pxcm... buttons 3262 set(handles.TitleNpy,'Visible','on') 3263 set(handles.num_Npx,'Visible','on') 3264 set(handles.num_Npy,'Visible','on') 3265 else 3266 set(handles.TitleNpx,'Visible','off')% visible npx,pxcm... buttons 3267 set(handles.TitleNpy,'Visible','off') 3268 set(handles.num_Npx,'Visible','off') 3269 set(handles.num_Npy,'Visible','off') 3269 3270 end 3270 3271 setfield(handles);% update the field structure ('civ1'....) … … 3446 3447 %common to Fields_Callback 3447 3448 if isequal(field,'image')||isequal(field_1,'image') 3448 set(handles. npx_title,'Visible','on')% visible npx,pxcm... buttons3449 set(handles. npy_title,'Visible','on')3450 set(handles.n px,'Visible','on')3451 set(handles.n py,'Visible','on')3449 set(handles.TitleNpx,'Visible','on')% visible npx,pxcm... buttons 3450 set(handles.TitleNpy,'Visible','on') 3451 set(handles.num_Npx,'Visible','on') 3452 set(handles.num_Npy,'Visible','on') 3452 3453 % set(handles.fix_pair,'Value',0) 3453 3454 else 3454 set(handles. npx_title,'Visible','off')% visible npx,pxcm... buttons3455 set(handles. npy_title,'Visible','off')3456 set(handles.n px,'Visible','off')3457 set(handles.n py,'Visible','off')3455 set(handles.TitleNpx,'Visible','off')% visible npx,pxcm... buttons 3456 set(handles.TitleNpy,'Visible','off') 3457 set(handles.num_Npx,'Visible','off') 3458 set(handles.num_Npy,'Visible','off') 3458 3459 % set(handles.fix_pair,'Value',1) 3459 3460 end … … 3574 3575 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 3575 3576 if isequal(get(handles.VOLUME,'Value'),1) 3576 set(handles. zoom,'Value',0)3577 set(handles. zoom,'BackgroundColor',[0.7 0.7 0.7])3577 set(handles.CheckZoom,'Value',0) 3578 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 3578 3579 set(handles.edit_vect,'Value',0) 3579 3580 edit_vect_Callback(hObject, eventdata, handles) … … 3633 3634 set(handles.edit_vect,'BackgroundColor',[1 1 0]) 3634 3635 set(handles.edit_object,'Value',0) 3635 set(handles. zoom,'Value',0)3636 set(handles. zoom,'BackgroundColor',[0.7 0.7 0.7])3636 set(handles.CheckZoom,'Value',0) 3637 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 3637 3638 % set(handles.create,'Value',0) 3638 3639 % set(handles.create,'BackgroundColor',[0 1 0]) … … 3741 3742 3742 3743 %------------------------------------------------------------------ 3743 % --- Executes on selection change in col_vec: choice of the color code.3744 % --- Executes on selection change in ListColorScalar: choice of the color code. 3744 3745 % 3745 function col_vec_Callback(hObject, eventdata, handles)3746 function ListColorScalar_Callback(hObject, eventdata, handles) 3746 3747 %------------------------------------------------------------------ 3747 3748 % edit the choice for color code 3748 list_code=get(handles. col_vec,'String');% list menu fields3749 index_code=get(handles. col_vec,'Value');% selected string index3749 list_code=get(handles.ListColorScalar,'String');% list menu fields 3750 index_code=get(handles.ListColorScalar,'Value');% selected string index 3750 3751 col_code= list_code{index_code(1)}; % selected field 3751 3752 if isequal(col_code,'black') || isequal(col_code,'white') 3752 set(handles. slider1,'Visible','off')3753 set(handles. slider2,'Visible','off')3754 set(handles. colcode1,'Visible','off')3755 set(handles. colcode2,'Visible','off')3756 set(handles. AutoVecColor,'Visible','off')3753 set(handles.Slider1,'Visible','off') 3754 set(handles.Slider2,'Visible','off') 3755 set(handles.num_ColCode1,'Visible','off') 3756 set(handles.num_ColCode2,'Visible','off') 3757 set(handles.CheckFixVecColor,'Visible','off') 3757 3758 set_vec_col_bar(handles) 3758 3759 else 3759 set(handles. slider1,'Visible','on')3760 set(handles. slider2,'Visible','on')3761 set(handles. colcode1,'Visible','on')3762 set(handles. colcode2,'Visible','on')3763 set(handles. AutoVecColor,'Visible','on')3760 set(handles.Slider1,'Visible','on') 3761 set(handles.Slider2,'Visible','on') 3762 set(handles.num_ColCode1,'Visible','on') 3763 set(handles.num_ColCode2,'Visible','on') 3764 set(handles.CheckFixVecColor,'Visible','on') 3764 3765 if isequal(col_code,'ima_cor') 3765 set(handles. AutoVecColor,'Value',0)%fixed scale by default3766 set(handles. vec_col_bar,'Value',0)% 3 colors r,g,b by default3767 set(handles. slider1,'Min',0);3768 set(handles. slider1,'Max',1);3769 set(handles. slider2,'Min',0);3770 set(handles. slider2,'Max',1);3766 set(handles.CheckFixVecColor,'Value',0)%fixed scale by default 3767 set(handles.VecColBar,'Value',0)% 3 colors r,g,b by default 3768 set(handles.Slider1,'Min',0); 3769 set(handles.Slider1,'Max',1); 3770 set(handles.Slider2,'Min',0); 3771 set(handles.Slider2,'Max',1); 3771 3772 % set(handles.min_title_vec,'String','0') 3772 set(handles. max_vec,'String','1')3773 set(handles. colcode1,'String','0.333')3773 set(handles.num_MaxVec,'String','1') 3774 set(handles.num_ColCode1,'String','0.333') 3774 3775 colcode1_Callback(hObject, eventdata, handles) 3775 set(handles. colcode2,'String','0.666')3776 set(handles.num_ColCode2,'String','0.666') 3776 3777 colcode2_Callback(hObject, eventdata, handles) 3777 3778 else 3778 set(handles. AutoVecColor,'Value',1)%auto scale between min,max by default3779 set(handles. vec_col_bar,'Value',1)% colormap 'jet' by default3780 minval=get(handles. slider1,'Min');3781 maxval=get(handles. slider1,'Max');3782 set(handles. slider1,'Value',minval)3783 set(handles. slider2,'Value',maxval)3779 set(handles.CheckFixVecColor,'Value',1)%auto scale between min,max by default 3780 set(handles.VecColBar,'Value',1)% colormap 'jet' by default 3781 minval=get(handles.Slider1,'Min'); 3782 maxval=get(handles.Slider1,'Max'); 3783 set(handles.Slider1,'Value',minval) 3784 set(handles.Slider2,'Value',maxval) 3784 3785 set_vec_col_bar(handles) 3785 3786 end … … 3793 3794 % -- Executes on slider movement to set the color code 3794 3795 % 3795 function slider1_Callback(hObject, eventdata, handles)3796 function Slider1_Callback(hObject, eventdata, handles) 3796 3797 %------------------------------------------------------------------ 3797 slider1=get(handles. slider1,'Value');3798 min_val=str2num(get(handles. min_vec,'String'));3799 max_val=str2num(get(handles. max_vec,'String'));3798 slider1=get(handles.Slider1,'Value'); 3799 min_val=str2num(get(handles.num_MinVec,'String')); 3800 max_val=str2num(get(handles.num_MaxVec,'String')); 3800 3801 col=min_val+(max_val-min_val)*slider1; 3801 set(handles. colcode1,'String',num2str(col))3802 if(get(handles. slider2,'Value') < col)%move also the second slider at the same value if needed3803 set(handles. slider2,'Value',col)3804 set(handles. colcode2,'String',num2str(col))3802 set(handles.num_ColCode1,'String',num2str(col)) 3803 if(get(handles.Slider2,'Value') < col)%move also the second slider at the same value if needed 3804 set(handles.Slider2,'Value',col) 3805 set(handles.num_ColCode2,'String',num2str(col)) 3805 3806 end 3806 3807 colcode1_Callback(hObject, eventdata, handles) … … 3809 3810 % Executes on slider movement to set the color code 3810 3811 %---------------------------------------------------------------- 3811 function slider2_Callback(hObject, eventdata, handles)3812 slider2=get(handles. slider2,'Value');3813 min_val=str2num(get(handles. min_vec,'String'));3814 max_val=str2num(get(handles. max_vec,'String'));3812 function Slider2_Callback(hObject, eventdata, handles) 3813 slider2=get(handles.Slider2,'Value'); 3814 min_val=str2num(get(handles.num_MinVec,'String')); 3815 max_val=str2num(get(handles.num_MaxVec,'String')); 3815 3816 col=min_val+(max_val-min_val)*slider2; 3816 set(handles. colcode2,'String',num2str(col))3817 if(get(handles. slider1,'Value') > col)%move also the first slider at the same value if needed3818 set(handles. slider1,'Value',col)3819 set(handles. colcode1,'String',num2str(col))3817 set(handles.num_ColCode2,'String',num2str(col)) 3818 if(get(handles.Slider1,'Value') > col)%move also the first slider at the same value if needed 3819 set(handles.Slider1,'Value',col) 3820 set(handles.num_ColCode1,'String',num2str(col)) 3820 3821 end 3821 3822 colcode2_Callback(hObject, eventdata, handles) … … 3824 3825 %execute on return carriage on the edit box corresponding to slider 1 3825 3826 %---------------------------------------------------------------- 3826 function colcode1_Callback(hObject, eventdata, handles)3827 % col=str2num(get(handles. colcode1,'String'));3828 % set(handles. slider1,'Value',col)3827 function num_ColCode1_Callback(hObject, eventdata, handles) 3828 % col=str2num(get(handles.num_ColCode1,'String')); 3829 % set(handles.Slider1,'Value',col) 3829 3830 set_vec_col_bar(handles) 3830 3831 update_plot(handles); … … 3833 3834 %execute on return carriage on the edit box corresponding to slider 2 3834 3835 %---------------------------------------------------------------- 3835 function colcode2_Callback(hObject, eventdata, handles)3836 % col=str2num(get(handles. colcode2,'String'));3837 % set(handles. slider2,'Value',col)3836 function num_ColCode2_Callback(hObject, eventdata, handles) 3837 % col=str2num(get(handles.num_ColCode2,'String')); 3838 % set(handles.Slider2,'Value',col) 3838 3839 % slider2_Callback(hObject, eventdata, handles) 3839 3840 set_vec_col_bar(handles) … … 3842 3843 %update the slider values after displaying vectors 3843 3844 %-------------------------------------------------------- 3844 % function slider_update(handles,auto,minC, colcode1,colcode2,maxC)3845 % set(handles. slider1,'Min',minC)3846 % set(handles. slider1,'Max',maxC)3847 % set(handles. slider2,'Min',minC)3848 % set(handles. slider2,'Max',maxC)3845 % function slider_update(handles,auto,minC,num_ColCode1,num_ColCode2,maxC) 3846 % set(handles.Slider1,'Min',minC) 3847 % set(handles.Slider1,'Max',maxC) 3848 % set(handles.Slider2,'Min',minC) 3849 % set(handles.Slider2,'Max',maxC) 3849 3850 % set(handles.min_title_vec,'String',num2str(minC)) 3850 % set(handles. max_vec,'String',num2str(maxC))3851 % set(handles.num_MaxVec,'String',num2str(maxC)) 3851 3852 % if auto 3852 % set(handles. colcode1,'String',num2str(colcode1,3))%update display3853 % set(handles. colcode2,'String',num2str(colcode2,3))3853 % set(handles.num_ColCode1,'String',num2str(num_ColCode1,3))%update display 3854 % set(handles.num_ColCode2,'String',num2str(num_ColCode2,3)) 3854 3855 % end 3855 % set(handles. slider1,'Value',colcode1)%update slider with constant display3856 % set(handles. slider2,'Value',colcode2)3856 % set(handles.Slider1,'Value',num_ColCode1)%update slider with constant display 3857 % set(handles.Slider2,'Value',num_ColCode2) 3857 3858 % set_vec_col_bar(handles) 3858 3859 3859 3860 3860 3861 %------------------------------------------------------- 3861 % --- Executes on button press in AutoVecColor.3862 % --- Executes on button press in CheckFixVecColor. 3862 3863 %------------------------------------------------------- 3863 function vec_col_bar_Callback(hObject, eventdata, handles)3864 function VecColBar_Callback(hObject, eventdata, handles) 3864 3865 set_vec_col_bar(handles) 3865 3866 … … 3924 3925 end 3925 3926 3926 set(handles. FixLimits,'Value',0)3927 set(handles. FixLimits,'BackgroundColor',[0.7 0.7 0.7])3927 set(handles.CheckFixLimits,'Value',0) 3928 set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 3928 3929 3929 3930 %delete drawn objects … … 4041 4042 end 4042 4043 end 4043 % set(haxes,'XLimMode','auto')%reset auto mode (after zoom effect)4044 % set(haxes,'XLimMode','auto')%reset auto mode (after CheckZoom effect) 4044 4045 % set(haxes,'YLimMode','auto') 4045 4046 % PlotParam.Auto_xy=1; … … 4053 4054 4054 4055 %------------------------------------------------------------------------ 4055 function MinX_Callback(hObject, eventdata, handles)4056 %------------------------------------------------------------------------ 4057 set(handles. FixLimits,'Value',1) %suppress auto mode4058 set(handles. FixLimits,'BackgroundColor',[1 1 0])4056 function num_MinX_Callback(hObject, eventdata, handles) 4057 %------------------------------------------------------------------------ 4058 set(handles.CheckFixLimits,'Value',1) %suppress auto mode 4059 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 4059 4060 update_plot(handles); 4060 4061 4061 4062 %------------------------------------------------------------------------ 4062 function MaxX_Callback(hObject, eventdata, handles)4063 %------------------------------------------------------------------------ 4064 set(handles. FixLimits,'Value',1) %suppress auto mode4065 set(handles. FixLimits,'BackgroundColor',[1 1 0])4063 function num_MaxX_Callback(hObject, eventdata, handles) 4064 %------------------------------------------------------------------------ 4065 set(handles.CheckFixLimits,'Value',1) %suppress auto mode 4066 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 4066 4067 update_plot(handles); 4067 4068 4068 4069 %------------------------------------------------------------------------ 4069 function MinY_Callback(hObject, eventdata, handles)4070 function num_MinY_Callback(hObject, eventdata, handles) 4070 4071 %------------------------------------------ 4071 set(handles. FixLimits,'Value',1) %suppress auto mode4072 set(handles. FixLimits,'BackgroundColor',[1 1 0])4072 set(handles.CheckFixLimits,'Value',1) %suppress auto mode 4073 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 4073 4074 update_plot(handles); 4074 4075 4075 4076 %------------------------------------------------------------------------ 4076 function MaxY_Callback(hObject, eventdata, handles)4077 %------------------------------------------------------------------------ 4078 set(handles. FixLimits,'Value',1) %suppress auto mode4079 set(handles. FixLimits,'BackgroundColor',[1 1 0])4077 function num_MaxY_Callback(hObject, eventdata, handles) 4078 %------------------------------------------------------------------------ 4079 set(handles.CheckFixLimits,'Value',1) %suppress auto mode 4080 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 4080 4081 update_plot(handles); 4081 4082 4082 4083 %------------------------------------------------------------------------ 4083 function MinA_Callback(hObject, eventdata, handles)4084 function num_MinA_Callback(hObject, eventdata, handles) 4084 4085 %------------------------------------------ 4085 set(handles. FixScal,'Value',1) %suppress auto mode4086 set(handles. FixScal,'BackgroundColor',[1 1 0])4087 MinA=str2double(get(handles. MinA,'String'));4088 MaxA=str2double(get(handles. MaxA,'String'));4086 set(handles.CheckFixScalar,'Value',1) %suppress auto mode 4087 set(handles.CheckFixScalar,'BackgroundColor',[1 1 0]) 4088 MinA=str2double(get(handles.num_MinA,'String')); 4089 MaxA=str2double(get(handles.num_MaxA,'String')); 4089 4090 if MinA>MaxA% switch minA and maxA in case of error 4090 4091 MinA_old=MinA; 4091 4092 MinA=MaxA; 4092 4093 MaxA=MinA_old; 4093 set(handles. MinA,'String',num2str(MinA,5));4094 set(handles. MaxA,'String',num2str(MaxA,5));4094 set(handles.num_MinA,'String',num2str(MinA,5)); 4095 set(handles.num_MaxA,'String',num2str(MaxA,5)); 4095 4096 end 4096 4097 update_plot(handles); 4097 4098 4098 4099 %------------------------------------------------------------------------ 4099 function MaxA_Callback(hObject, eventdata, handles)4100 %------------------------------------------------------------------------ 4101 set(handles. FixScal,'Value',1) %suppress auto mode4102 set(handles. FixScal,'BackgroundColor',[1 1 0])4103 MinA=str2double(get(handles. MinA,'String'));4104 MaxA=str2double(get(handles. MaxA,'String'));4100 function num_MaxA_Callback(hObject, eventdata, handles) 4101 %------------------------------------------------------------------------ 4102 set(handles.CheckFixScalar,'Value',1) %suppress auto mode 4103 set(handles.CheckFixScalar,'BackgroundColor',[1 1 0]) 4104 MinA=str2double(get(handles.num_MinA,'String')); 4105 MaxA=str2double(get(handles.num_MaxA,'String')); 4105 4106 if MinA>MaxA% switch minA and maxA in case of error 4106 4107 MinA_old=MinA; 4107 4108 MinA=MaxA; 4108 4109 MaxA=MinA_old; 4109 set(handles. MinA,'String',num2str(MinA,5));4110 set(handles. MaxA,'String',num2str(MaxA,5));4110 set(handles.num_MinA,'String',num2str(MinA,5)); 4111 set(handles.num_MaxA,'String',num2str(MaxA,5)); 4111 4112 end 4112 4113 update_plot(handles); 4113 4114 4114 4115 %------------------------------------------------------------------------ 4115 function FixScal_Callback(hObject, eventdata, handles)4116 %------------------------------------------------------------------------ 4117 test=get(handles. FixScal,'Value');4116 function CheckFixScalar_Callback(hObject, eventdata, handles) 4117 %------------------------------------------------------------------------ 4118 test=get(handles.CheckFixScalar,'Value'); 4118 4119 if test 4119 set(handles. FixScal,'BackgroundColor',[1 1 0])4120 else 4121 set(handles. FixScal,'BackgroundColor',[0.7 0.7 0.7])4120 set(handles.CheckFixScalar,'BackgroundColor',[1 1 0]) 4121 else 4122 set(handles.CheckFixScalar,'BackgroundColor',[0.7 0.7 0.7]) 4122 4123 update_plot(handles); 4123 4124 end 4124 4125 4125 4126 %------------------------------------------------------------------- 4126 function BW_Callback(hObject, eventdata, handles)4127 function CheckBW_Callback(hObject, eventdata, handles) 4127 4128 %------------------------------------------------------------------- 4128 4129 update_plot(handles); 4129 4130 4130 4131 %------------------------------------------------------------------- 4131 function Contours_Callback(hObject, eventdata, handles)4132 %------------------------------------------------------------------- 4133 val=get(handles. Contours,'Value');4132 function ListContour_Callback(hObject, eventdata, handles) 4133 %------------------------------------------------------------------- 4134 val=get(handles.ListContour,'Value'); 4134 4135 if val==2 4135 4136 set(handles.interval_txt,'Visible','on') 4136 set(handles. IncrA,'Visible','on')4137 set(handles.num_IncrA,'Visible','on') 4137 4138 else 4138 4139 set(handles.interval_txt,'Visible','off') 4139 set(handles. IncrA,'Visible','off')4140 set(handles.num_IncrA,'Visible','off') 4140 4141 end 4141 4142 update_plot(handles); 4142 4143 4143 4144 %------------------------------------------------------------------- 4144 function IncrA_Callback(hObject, eventdata, handles)4145 function num_IncrA_Callback(hObject, eventdata, handles) 4145 4146 %------------------------------------------------------------------- 4146 4147 update_plot(handles); 4147 4148 4148 4149 %------------------------------------------------------------------- 4149 function HideWarning_Callback(hObject, eventdata, handles)4150 function CheckHideWarning_Callback(hObject, eventdata, handles) 4150 4151 %------------------------------------------------------------------- 4151 4152 update_plot(handles); 4152 4153 4153 4154 %------------------------------------------------------------------- 4154 function HideFalse_Callback(hObject, eventdata, handles)4155 function CheckHideFalse_Callback(hObject, eventdata, handles) 4155 4156 %------------------------------------------------------------------- 4156 4157 update_plot(handles); 4157 4158 4158 4159 %------------------------------------------------------------------- 4159 function VecScale_Callback(hObject, eventdata, handles)4160 %------------------------------------------------------------------- 4161 set(handles. FixVec,'Value',1);4162 set(handles. FixVec,'BackgroundColor',[1 1 0])4160 function num_VecScale_Callback(hObject, eventdata, handles) 4161 %------------------------------------------------------------------- 4162 set(handles.CheckFixVectors,'Value',1); 4163 set(handles.CheckFixVectors,'BackgroundColor',[1 1 0]) 4163 4164 update_plot(handles); 4164 4165 4165 4166 %------------------------------------------------------------------- 4166 function FixVec_Callback(hObject, eventdata, handles)4167 %------------------------------------------------------------------- 4168 test=get(handles. FixVec,'Value');4167 function CheckFixVectors_Callback(hObject, eventdata, handles) 4168 %------------------------------------------------------------------- 4169 test=get(handles.CheckFixVectors,'Value'); 4169 4170 if test 4170 set(handles. FixVec,'BackgroundColor',[1 1 0])4171 set(handles.CheckFixVectors,'BackgroundColor',[1 1 0]) 4171 4172 else 4172 4173 update_plot(handles); 4173 %set(handles. VecScale,'String',num2str(ScalOut.VecScale,3))4174 set(handles. FixVec,'BackgroundColor',[0.7 0.7 0.7])4175 end 4176 4177 %------------------------------------------------------------------------ 4178 % --- Executes on selection change in decimate4 (nb_vec/4).4179 function decimate4_Callback(hObject, eventdata, handles)4174 %set(handles.num_VecScale,'String',num2str(ScalOut.num_VecScale,3)) 4175 set(handles.CheckFixVectors,'BackgroundColor',[0.7 0.7 0.7]) 4176 end 4177 4178 %------------------------------------------------------------------------ 4179 % --- Executes on selection change in CheckDecimate4 (nb_vec/4). 4180 function CheckDecimate4_Callback(hObject, eventdata, handles) 4180 4181 %------------------------------------------------------------------------ 4181 4182 update_plot(handles); 4182 4183 4183 4184 %------------------------------------------------------------------------ 4184 % --- Executes on selection change in color_code menu4185 function color_code_Callback(hObject, eventdata, handles)4185 % --- Executes on selection change in ListColorCode menu 4186 function ListColorCode_Callback(hObject, eventdata, handles) 4186 4187 %------------------------------------------------------------------------ 4187 4188 set_vec_col_bar(handles) … … 4189 4190 4190 4191 %------------------------------------------------------------------------ 4191 % --- Executes on button press in AutoVecColor.4192 function AutoVecColor_Callback(hObject, eventdata, handles)4193 %------------------------------------------------------------------------ 4194 test=get(handles. AutoVecColor,'Value');4192 % --- Executes on button press in CheckFixVecColor. 4193 function CheckFixVecColor_Callback(hObject, eventdata, handles) 4194 %------------------------------------------------------------------------ 4195 test=get(handles.CheckFixVecColor,'Value'); 4195 4196 if test 4196 set(handles. AutoVecColor,'BackgroundColor',[1 1 0])4197 set(handles.CheckFixVecColor,'BackgroundColor',[1 1 0]) 4197 4198 else 4198 4199 update_plot(handles); 4199 %set(handles. VecScale,'String',num2str(ScalOut.VecScale,3))4200 set(handles. AutoVecColor,'BackgroundColor',[0.7 0.7 0.7])4201 end 4202 4203 %------------------------------------------------------------------------ 4204 % --- Executes on selection change in max_vec.4205 function min_vec_Callback(hObject, eventdata, handles)4200 %set(handles.num_VecScale,'String',num2str(ScalOut.num_VecScale,3)) 4201 set(handles.CheckFixVecColor,'BackgroundColor',[0.7 0.7 0.7]) 4202 end 4203 4204 %------------------------------------------------------------------------ 4205 % --- Executes on selection change in num_MaxVec. 4206 function num_MinVec_Callback(hObject, eventdata, handles) 4206 4207 %------------------------------------------------------------------------ 4207 4208 max_vec_Callback(hObject, eventdata, handles) 4208 4209 4209 4210 %------------------------------------------------------------------------ 4210 % --- Executes on selection change in max_vec.4211 function max_vec_Callback(hObject, eventdata, handles)4212 %------------------------------------------------------------------------ 4213 set(handles. AutoVecColor,'Value',1)4211 % --- Executes on selection change in num_MaxVec. 4212 function num_MaxVec_Callback(hObject, eventdata, handles) 4213 %------------------------------------------------------------------------ 4214 set(handles.CheckFixVecColor,'Value',1) 4214 4215 AutoVecColor_Callback(hObject, eventdata, handles) 4215 min_val=str2num(get(handles. min_vec,'String'));4216 max_val=str2num(get(handles. max_vec,'String'));4217 slider1=get(handles. slider1,'Value');4218 slider2=get(handles. slider2,'Value');4216 min_val=str2num(get(handles.num_MinVec,'String')); 4217 max_val=str2num(get(handles.num_MaxVec,'String')); 4218 slider1=get(handles.Slider1,'Value'); 4219 slider2=get(handles.Slider2,'Value'); 4219 4220 colcode1=min_val+(max_val-min_val)*slider1; 4220 4221 colcode2=min_val+(max_val-min_val)*slider2; 4221 set(handles. colcode1,'String',num2str(colcode1))4222 set(handles. colcode2,'String',num2str(colcode2))4222 set(handles.num_ColCode1,'String',num2str(colcode1)) 4223 set(handles.num_ColCode2,'String',num2str(colcode2)) 4223 4224 update_plot(handles); 4224 4225 … … 4227 4228 function set_vec_col_bar(handles) 4228 4229 %------------------------------------------------------------------------ 4229 %get the image of the color display button ' vec_col_bar' in pixels4230 set(handles. vec_col_bar,'Unit','pixel');4231 pos_vert=get(handles. vec_col_bar,'Position');4232 set(handles. vec_col_bar,'Unit','Normalized');4230 %get the image of the color display button 'VecColBar' in pixels 4231 set(handles.VecColBar,'Unit','pixel'); 4232 pos_vert=get(handles.VecColBar,'Position'); 4233 set(handles.VecColBar,'Unit','Normalized'); 4233 4234 width=ceil(pos_vert(3)); 4234 4235 height=ceil(pos_vert(4)); 4235 4236 4236 4237 %get slider indications 4237 list=get(handles. color_code,'String');4238 ichoice=get(handles. color_code,'Value');4238 list=get(handles.ListColorCode,'String'); 4239 ichoice=get(handles.ListColorCode,'Value'); 4239 4240 colcode.ColorCode=list{ichoice}; 4240 colcode.MinC=str2num(get(handles. min_vec,'String'));4241 colcode.MaxC=str2num(get(handles. max_vec,'String'));4241 colcode.MinC=str2num(get(handles.num_MinVec,'String')); 4242 colcode.MaxC=str2num(get(handles.num_MaxVec,'String')); 4242 4243 test3color=strcmp(colcode.ColorCode,'rgb') || strcmp(colcode.ColorCode,'bgr'); 4243 4244 if test3color 4244 colcode.colcode1=str2num(get(handles. colcode1,'String'));4245 colcode.colcode2=str2num(get(handles. colcode2,'String'));4245 colcode.colcode1=str2num(get(handles.num_ColCode1,'String')); 4246 colcode.colcode2=str2num(get(handles.num_ColCode2,'String')); 4246 4247 end 4247 4248 colcode.FixedCbounds=0; … … 4256 4257 A(:,:,2)=A2'; 4257 4258 A(:,:,3)=A3'; 4258 set(handles. vec_col_bar,'Cdata',A)4259 set(handles.VecColBar,'Cdata',A) 4259 4260 4260 4261 … … 4265 4266 UvData=get(handles.uvmat,'UserData'); 4266 4267 AxeData=UvData.axes3; 4267 PlotParam=read_plot_param(handles); 4268 %PlotParam=read_plot_param(handles); 4269 PlotParam=read_GUI(handles.uvmat); 4268 4270 [PP,PlotParamOut]= plot_field(AxeData,haxes,PlotParam); 4269 4271 write_plot_param(handles,PlotParamOut); %update the auto plot parameters … … 4283 4285 set(handles.edit_object,'BackgroundColor',[1,1,0]) 4284 4286 %suppress the other options 4285 set(handles. zoom,'Value',0)4287 set(handles.CheckZoom,'Value',0) 4286 4288 zoom_Callback(hObject, eventdata, handles) 4287 4289 hgeometry_calib=findobj(allchild(0),'tag','geometry_calib'); … … 4396 4398 if option==1 ||option==2% lefet mouse selection, peroject the field: 4397 4399 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 4398 plot_field(ProjData,PlotHandles.axes3,read_plot_param(PlotHandles));%read plotting parameters on the uvmat interfacPlotHandles); 4400 %plot_field(ProjData,PlotHandles.axes3,read_plot_param(PlotHandles));%read plotting parameters on the uvmat interfacPlotHandles); 4401 plot_field(ProjData,PlotHandles.axes3,read_GUI(get(PlotHandles.axes3,'Parent')));%read plotting parameters on the uvmat interfacPlotHandles); 4399 4402 UvData.Object=update_obj(UvData,IndexObj,[]); 4400 4403 set(handles.uvmat,'UserData',UvData) … … 4587 4590 4588 4591 %suppress competing options 4589 set(handles. zoom,'Value',0)4590 set(handles. zoom,'BackgroundColor',[0.7 0.7 0.7])4592 set(handles.CheckZoom,'Value',0) 4593 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 4591 4594 set(handles.list_object_1,'Value',1) 4592 4595 % initiate display of GUI geometry_calib … … 5028 5031 set(handles.MenuObject,'checked','on') 5029 5032 set(handles.uvmat,'UserData',UvData) 5030 set(handles. zoom,'Value',0)5031 zoom_Callback(handles.uvmat, [], handles)5033 set(handles.CheckZoom,'Value',0) 5034 CheckZoom_Callback(handles.uvmat, [], handles) 5032 5035 set(handles.delete_object,'Visible','on') 5033 5036 set(handles.uvmat_title,'Visible','on') … … 5037 5040 function MenuRuler_Callback(hObject, eventdata, handles) 5038 5041 %------------------------------------------------------------------------ 5039 set(handles. zoom,'Value',0)5040 zoom_Callback(handles.uvmat, [], handles)5042 set(handles.CheckZoom,'Value',0) 5043 CheckZoom_Callback(handles.uvmat, [], handles) 5041 5044 set(handles.MenuRuler,'checked','on') 5042 5045 UvData=get(handles.uvmat,'UserData');
Note: See TracChangeset
for help on using the changeset viewer.