Changeset 40
- Timestamp:
- Mar 9, 2010, 9:00:40 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 10 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_plot_handles.m
r19 r40 50 50 PlotHandles.min_C_title=handles.min_C_title; 51 51 PlotHandles.max_C_title=handles.max_C_title; 52 PlotHandles.MenuVectors=handles.MenuVectors;52 %PlotHandles.MenuVectors=handles.MenuVectors; 53 53 PlotHandles.MenuEditVectors=handles.MenuEditVectors; 54 54 PlotHandles.edit_vect=handles.edit_vect; -
trunk/src/keyboard_callback.m
r11 r40 27 27 % UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface 28 28 hlist_object=findobj(huvmat,'Tag','list_object'); 29 ObjIndex=get(hlist_object,'Value') ;29 ObjIndex=get(hlist_object,'Value') 30 30 if ObjIndex>1 31 31 delete_object(ObjIndex) -
trunk/src/mouse_down.m
r35 r40 37 37 %test_cal=get(handles.cal,'Value'); 38 38 test_cal=isequal(MouseAction,'calib'); 39 handles_coord=findobj(huvmat,'Tag','menu_coord'); 40 menu_coord=get(handles_coord,'String'); 41 coord_choice=get(handles_coord,'Value'); 39 menu_coord=get(hhuvmat.transform_fct,'String'); 40 coord_choice=get(hhuvmat.transform_fct,'Value'); 42 41 coord_type=menu_coord{coord_choice}; 43 42 test_edit=isequal(MouseAction,'edit_object'); … … 255 254 YCoord=data.Coord(:,2); 256 255 end 257 hh=findobj('Tag','calib_points') 256 hh=findobj('Tag','calib_points'); 258 257 if isempty(hh) 259 258 line(XCoord,YCoord,'Color','m','Tag','calib_points','LineStyle','.','Marker','+'); -
trunk/src/set_object.m
r2 r40 514 514 oldfile=' '; 515 515 huvmat=findobj('Tag','uvmat'); 516 % if isempty(huvmat)517 % huvmat=findobj(allchild(0),'Name','series');518 % end519 516 hchild=get(huvmat,'Children'); 520 517 hrootpath=findobj(hchild,'Tag','RootPath'); … … 525 522 end 526 523 end 527 %[FileName,PathName] = uigetfile('*.civ','Select a .civ file',oldfile)528 524 [FileName, PathName, filterindex] = uigetfile( ... 529 525 {'*.xml;*.mat', ' (*.xml,*.mat)'; … … 534 530 testblank=findstr(fileinput,' ');%look for blanks 535 531 if ~isempty(testblank) 536 errordlg('forbidden input file name: contain blanks')532 msgbox_uvmat('ERROR','forbidden input file name: contain blanks') 537 533 return 538 534 end 539 535 sizf=size(fileinput); 540 if (~ischar(fileinput)| ~isequal(sizf(1),1)),return;end536 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end 541 537 542 538 %read the file … … 553 549 if ~isempty(huvmat) 554 550 hhuvmat=guidata(huvmat); 555 % set(hhuvmat.POINTS,'Value',0)556 % set(hhuvmat.POINTS,'BackgroundColor',[0 1 0])%put unactivated buttons to green557 % set(hhuvmat.LINE,'Value',0)558 % set(hhuvmat.LINE,'BackgroundColor',[0 1 0])%put unactivated buttons to green559 % set(hhuvmat.PATCH,'Value',0)560 % set(hhuvmat.PATCH,'BackgroundColor',[0 1 0])%put unactivated buttons to green561 % set(hhuvmat.PLANE,'Value',0)562 % set(hhuvmat.PLANE,'BackgroundColor',[0 1 0])%put unactivated buttons to green563 % set(hhuvmat.VOLUME,'Value',0)564 % set(hhuvmat.VOLUME,'BackgroundColor',[0 1 0])%put unactivated buttons to green565 % if ~isequal(title,'MASK')566 % eval(['set(hhuvmat.' title ',''Value'',1)'])567 % eval(['set(hhuvmat.' title ',''BackgroundColor'',[1 1 0])'])568 % end569 551 end 570 552 menu=get(handles.TITLE,'String'); -
trunk/src/uvmat.m
r39 r40 202 202 guidata(hObject, handles); 203 203 204 dircur=pwd ;%current working directory204 dircur=pwd %current working directory 205 205 dir_opening=dircur; 206 206 … … 236 236 testexist(ilist)=0; 237 237 end 238 % fct_handle{ilist,1}=fullfile(path_uvmat,'transform_field');%path to the transform functions path_transform;239 238 end 240 239 rmpath(fullfile(path_uvmat,'transform_field')) 241 240 242 241 %load the list of previously browsed files in menus Open and Open_1 243 dir_perso=prefdir; 244 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 242 dir_perso=prefdir; % path to the directory .matlab for personal data 243 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');% personal data file uvmauvmat_perso.mat' in .matlab 245 244 if exist(profil_perso,'file') 246 245 h=load (profil_perso); … … 297 296 [errormsg,date_str]=check_functions;%check the path of the functions called by uvmat.m 298 297 299 %check the path of transform_fct transform300 %set(handles.transform_fct,'String',{'';'phys';'px';'more...'})301 % path_fct{1}='';302 % path_fct{2}=fileparts(path_to_uvmat);303 % path_fct{3}=fileparts(path_to_uvmat);304 % path_fct{4}=fileparts(path_to_uvmat);305 % set(handles.transform_fct,'UserData',path_fct)306 307 298 %case of an input argument for uvmat 308 299 testinputfield=0; … … 381 372 end 382 373 end 383 384 set_vec_col_bar(handles) 374 set_vec_col_bar(handles) %update the display of color code for vectors 385 375 386 376 %------------------------------------------------------------------- … … 3373 3363 delete(handles.UVMAT_title) 3374 3364 end 3365 % handles.uvmat 3375 3366 huvmat=get(handles.create,'parent'); 3376 3367 UvData=get(huvmat,'UserData');%read UvData properties stored on the uvmat interface 3377 % if (get(handles.LINE,'Value')==1) 3378 %suppress the other options if MENULINE is chosen 3379 set(handles.zoom,'Value',0) 3380 zoom_Callback(hObject, eventdata, handles) 3381 % set(handles.create,'Value',0) 3382 % set(handles.create,'BackgroundColor',[0 1 0]) 3383 % set(handles.LINE,'Value',1) 3384 % set(handles.LINE,'BackgroundColor',[1 1 0]) 3385 % set(handles.PATCH,'Value',0) 3386 % set(handles.PATCH,'BackgroundColor',[0 1 0]) 3387 % set(handles.PLANE,'Value',0) 3388 % set(handles.PLANE,'BackgroundColor',[0 1 0])%put activated buttons to yellow 3389 % set(handles.VOLUME,'Value',0) 3390 % set(handles.VOLUME,'BackgroundColor',[0 1 0]) 3391 %et(handles.makemask,'Value',0) 3392 %makemask_Callback(hObject, eventdata, handles) 3393 set(handles.edit_vect,'BackgroundColor',[0.7 0.7 0.7]) 3394 set(handles.edit_vect,'Value',0) 3395 edit_vect_Callback(hObject, eventdata, handles) 3396 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7]) 3397 set(handles.edit,'Value',0) 3398 set(handles.list_object,'Value',1); 3399 edit_vect_Callback(hObject, eventdata, handles) 3400 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7]) 3401 set(handles.cal,'Value',0) 3402 set(handles.cal,'BackgroundColor',[0 1 0]) 3403 % set(handles.grid,'Value',0) 3404 % set(handles.grid,'BackgroundColor',[0 1 0]) 3368 set(handles.zoom,'Value',0) 3369 zoom_Callback(hObject, eventdata, handles) 3370 set(handles.edit_vect,'BackgroundColor',[0.7 0.7 0.7]) 3371 set(handles.edit_vect,'Value',0) 3372 edit_vect_Callback(hObject, eventdata, handles) 3373 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7]) 3374 set(handles.edit,'Value',0) 3375 set(handles.list_object,'Value',1); 3376 edit_vect_Callback(hObject, eventdata, handles) 3377 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7]) 3378 set(handles.cal,'Value',0) 3379 set(handles.cal,'BackgroundColor',[0 1 0]) 3405 3380 % initiate the set_object GUI 3406 data.TITLE='LINE'; 3407 if isfield(UvData,'CoordType') 3408 data.CoordType=UvData.CoordType; 3409 end 3410 if isfield(UvData,'Mesh')&~isempty(UvData.Mesh) 3411 data.RangeX=UvData.Mesh; 3412 data.RangeY=UvData.Mesh; 3413 % data.YMax=UvData.Mesh; 3414 % data.XMax=UvData.Mesh; 3415 data.DX=UvData.Mesh; 3416 data.DY=UvData.Mesh; 3417 elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image 3418 np=size(UvData.Field.A); 3419 meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/np(2); 3420 meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/np(1); 3421 data.RangeY=max(meshx,meshy); 3422 data.RangeX=max(meshx,meshy); 3423 % data.YMax=max(meshx,meshy); 3424 % data.XMax=max(meshx,meshy); 3425 data.DX=max(meshx,meshy); 3426 end 3427 if isfield(data,'DX') 3428 data.Coord=[[0 0 0];[data.DX 0 0]]; %default 3429 else 3430 data.Coord=[[0 0 0];[1 0 0]]; %default 3431 end 3432 data.ParentButton=handles.create; 3433 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters 3434 [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface with action on haxes, 3435 % associate the set_edit interface handle to the plotting axes 3436 pos_uvmat=get(huvmat,'Position'); 3437 if isfield(UvData,'SetObjectOrigin') 3438 pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2); 3439 pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4); 3440 set(hset_object,'Position',pos_set_object) 3441 end 3442 list_object=get(handles.list_object,'String'); 3443 if ~isempty(list_object) 3444 set(handles.list_object,'Value',length(list_object)) 3445 end 3446 MouseAction='create_object'; 3447 % else 3448 % set(handles.LINE,'BackgroundColor',[0 1 0]) 3449 % MouseAction='none'; 3450 % end 3451 3381 data.TITLE='LINE'; 3382 if isfield(UvData,'CoordType') 3383 data.CoordType=UvData.CoordType; 3384 end 3385 if isfield(UvData,'Mesh')&~isempty(UvData.Mesh) 3386 data.RangeX=UvData.Mesh; 3387 data.RangeY=UvData.Mesh; 3388 data.DX=UvData.Mesh; 3389 data.DY=UvData.Mesh; 3390 elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image 3391 np=size(UvData.Field.A); 3392 meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/np(2); 3393 meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/np(1); 3394 data.RangeY=max(meshx,meshy); 3395 data.RangeX=max(meshx,meshy); 3396 data.DX=max(meshx,meshy); 3397 end 3398 if isfield(data,'DX') 3399 data.Coord=[[0 0 0];[data.DX 0 0]]; %default 3400 else 3401 data.Coord=[[0 0 0];[1 0 0]]; %default 3402 end 3403 data.ParentButton=handles.create; 3404 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters 3405 [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface with action on haxes, 3406 % associate the set_edit interface handle to the plotting axes 3407 pos_uvmat=get(huvmat,'Position'); 3408 if isfield(UvData,'SetObjectOrigin') 3409 pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2); 3410 pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4); 3411 set(hset_object,'Position',pos_set_object) 3412 end 3413 list_object=get(handles.list_object,'String'); 3414 if ~isempty(list_object) 3415 set(handles.list_object,'Value',length(list_object)) 3416 end 3417 MouseAction='create_object'; 3452 3418 UvData.MouseAction=MouseAction; 3453 3419 set(huvmat,'UserData',UvData) … … 4002 3968 coord_option=menu{ind_coord}; 4003 3969 list_transform=get(handles.transform_fct,'UserData'); 4004 ff=functions(list_transform{end}) 3970 ff=functions(list_transform{end}); 4005 3971 if isequal(coord_option,'more...'); 4006 3972 coord_fct=''; … … 4052 4018 4053 4019 %check the current path to the selected function 4054 func=functions(list_transform{ind_coord}); 4055 set(handles.path_transform,'String',fileparts(func.file)); %show the path to the senlected function 4020 if isa(list_transform{ind_coord},'function_handle') 4021 func=functions(list_transform{ind_coord}); 4022 set(handles.path_transform,'String',fileparts(func.file)); %show the path to the senlected function 4023 else 4024 set(handles.path_transform,'String','') 4025 end 4056 4026 %CurrentPath=fileparts(which(coord_option)); 4057 4027 % if ~isequal(PathName,CurrentPath) … … 4327 4297 test3color=strcmp(colcode.ColorCode,'rgb') || strcmp(colcode.ColorCode,'bgr'); 4328 4298 if test3color 4329 % set(handles.colcode1,'Visible','on')4330 % set(handles.colcode2,'Visible','on')4331 % set(handles.slider1,'Visible','on')4332 % set(handles.slider2,'Visible','on')4333 4299 colcode.colcode1=str2num(get(handles.colcode1,'String')); 4334 4300 colcode.colcode2=str2num(get(handles.colcode2,'String')); 4335 else4336 % set(handles.colcode1,'Visible','off')4337 % set(handles.colcode2,'Visible','off')4338 % set(handles.slider1,'Visible','off')4339 % set(handles.slider2,'Visible','off')4340 % colcode.colcode1=colcode.min;4341 % colcode.colcode2=colcode.max;4342 4301 end 4343 4302 % colcode.option=get(handles.vec_col_bar,'Value'); … … 4652 4611 msgbox_uvmat('CONFIRMATION',{['movie ' aviname ' created '];['with ' num2str(imax) ' frames']}) 4653 4612 4654 % --------------------------------------------------------------------4655 function MenuPoints_Callback(hObject, eventdata, handles)4656 set(handles.create,'Visible','on')4657 set(handles.create,'Value',1)4658 POINTS_Callback(hObject,eventdata,handles)4659 4660 % --------------------------------------------------------------------4661 function MenuLine_Callback(hObject, eventdata, handles)4662 set(handles.create,'Visible','on')4663 set(handles.create,'Value',1)4664 LINE_Callback(hObject,eventdata,handles)4665 4666 % ------------------------------------------------------------------4667 function MenuPatch_Callback(hObject, eventdata, handles)4668 set(handles.create,'Visible','on')4669 set(handles.create,'Value',1)4670 PATCH_Callback(hObject,eventdata,handles)4671 4672 % ------------------------------------------------------------------4673 function MenuPlane_Callback(hObject, eventdata, handles)4674 set(handles.create,'Visible','on')4675 set(handles.create,'Value',1)4676 PLANE_Callback(hObject,eventdata,handles)4677 4678 % ------------------------------------------------------------------4679 function MenuVolume_Callback(hObject, eventdata, handles)4680 set(handles.create,'Visible','on')4681 set(handles.create,'Value',1)4682 VOLUME_Callback(hObject,eventdata,handles)4683 4613 4684 4614 % ------------------------------------------------------------------ … … 4770 4700 %---------------------------------------------------------------- 4771 4701 function MenuSeries_Callback(hObject, eventdata, handles) 4702 %------------------------------------------------------------------- 4772 4703 4773 4704 [param.FileName]=read_file_boxes(handles); … … 4872 4803 set(handles.pycm,'Visible',state) 4873 4804 4874 % 4805 %------------------------------------------------------------------------ 4875 4806 function MenuEditVectors_Callback(hObject, eventdata, handles) 4807 %------------------------------------------------------------------------ 4876 4808 set(handles.edit_vect,'Visible','on') 4877 4809 set(handles.edit_vect,'Value',1) 4878 4810 edit_vect_Callback(hObject, eventdata, handles) 4879 4811 4880 4881 4882 4812 % -------------------------------------------------------------------- 4813 function Menupoints_Callback(hObject, eventdata, handles) 4814 % set(handles.create,'Visible','on') 4815 % set(handles.create,'Value',1) 4816 % POINTS_Callback(hObject,eventdata,handles) 4817 data.Style='points'; 4818 data.ProjMode='projection';%default 4819 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters 4820 create_object(data,handles.uvmat,PlotHandles) 4821 4822 % -------------------------------------------------------------------- 4823 function Menuline_Callback(hObject, eventdata, handles) 4824 % set(handles.create,'Visible','on') 4825 % set(handles.create,'Value',1) 4826 % LINE_Callback(hObject,eventdata,handles) 4827 data.Style='line'; 4828 data.ProjMode='projection';%default 4829 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters 4830 create_object(data,handles.uvmat,PlotHandles) 4831 4832 %------------------------------------------------------------------------ 4833 function Menupolyline_Callback(hObject, eventdata, handles) 4834 %------------------------------------------------------------------------ 4835 data.Style='polyline'; 4836 data.ProjMode='projection';%default 4837 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters 4838 create_object(data,handles.uvmat,PlotHandles) 4839 4840 % ------------------------------------------------------------------ 4841 function Menupolygon_Callback(hObject, eventdata, handles) 4842 set(handles.create,'Visible','on') 4843 set(handles.create,'Value',1) 4844 PATCH_Callback(hObject,eventdata,handles) 4845 4846 %------------------------------------------------------------------------ 4847 function Menurectangle_Callback(hObject, eventdata, handles) 4848 %------------------------------------------------------------------------ 4849 data.Style='rectangle'; 4850 data.ProjMode='inside';%default 4851 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters 4852 create_object(data,handles.uvmat,PlotHandles) 4853 4854 %------------------------------------------------------------------------ 4855 function Menuellipse_Callback(hObject, eventdata, handles) 4856 %------------------------------------------------------------------------ 4857 data.Style='ellipse'; 4858 data.ProjMode='inside';%default 4859 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters 4860 create_object(data,handles.uvmat,PlotHandles) 4861 4862 % ------------------------------------------------------------------ 4863 function Menuplane_Callback(hObject, eventdata, handles) 4864 % set(handles.create,'Visible','on') 4865 % set(handles.create,'Value',1) 4866 % PLANE_Callback(hObject,eventdata,handles) 4867 data.Style='plane'; 4868 data.ProjMode='projection';%default 4869 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters 4870 create_object(data,handles.uvmat,PlotHandles) 4871 4872 % ------------------------------------------------------------------ 4873 function Menuvolume_Callback(hObject, eventdata, handles) 4874 set(handles.create,'Visible','on') 4875 set(handles.create,'Value',1) 4876 VOLUME_Callback(hObject,eventdata,handles) 4877 4878 %------------------------------------------------------------------------ 4879 function MenuBrowseObject_Callback(hObject, eventdata, handles) 4880 %------------------------------------------------------------------------ 4881 %get the object file 4882 [FileName, PathName, filterindex] = uigetfile( ... 4883 {'*.xml;*.mat', ' (*.xml,*.mat)'; 4884 '*.xml', '.xml files '; ... 4885 '*.mat', '.mat matlab files '}, ... 4886 'Pick a file',get(handles.RootPath,'String')); 4887 fileinput=[PathName FileName];%complete file name 4888 testblank=findstr(fileinput,' ');%look for blanks 4889 if ~isempty(testblank) 4890 msgbox_uvmat('ERROR','forbidden input file name: contain blanks') 4891 return 4892 end 4893 sizf=size(fileinput); 4894 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end 4895 4896 %read the file 4897 t=xmltree(fileinput); 4898 data=convert(t); 4899 if ~isfield(data,'Style') 4900 data.Style='points'; 4901 end 4902 if ~isfield(data,'ProjMode') 4903 data.ProjMode='none'; 4904 end 4905 PlotHandles=get_plot_handles(handles);%get the handles of the interface elements setting the plotting parameters 4906 create_object(data,handles.uvmat,PlotHandles) 4907 4908 %------------------------------------------------------------------------ 4909 function create_object(data,huvmat,PlotHandles) 4910 %------------------------------------------------------------------------ 4911 hset_object=findobj(allchild(0),'Name','set_object') 4912 if ~isempty(hset_object) 4913 delete(hset_object)% delete existing version of set_object 4914 end 4915 UvData=get(huvmat,'UserData'); 4916 if isfield(UvData,'CoordType') 4917 data.CoordType=UvData.CoordType; 4918 end 4919 if isfield(UvData,'Mesh')&~isempty(UvData.Mesh) 4920 data.RangeX=UvData.Mesh; 4921 data.RangeY=UvData.Mesh; 4922 data.DX=UvData.Mesh; 4923 data.DY=UvData.Mesh; 4924 elseif isfield(UvData.Field,'AX')&isfield(UvData.Field,'AY')& isfield(UvData.Field,'A')%only image 4925 np=size(UvData.Field.A); 4926 meshx=(UvData.Field.AX(end)-UvData.Field.AX(1))/np(2); 4927 meshy=abs(UvData.Field.AY(end)-UvData.Field.AY(1))/np(1); 4928 data.RangeY=max(meshx,meshy); 4929 data.RangeX=max(meshx,meshy); 4930 data.DX=max(meshx,meshy); 4931 end 4932 if isfield(data,'DX') 4933 data.Coord=[[0 0 0];[data.DX 0 0]]; %default 4934 else 4935 data.Coord=[[0 0 0];[1 0 0]]; %default 4936 end 4937 %data.ParentButton=handles.create; 4938 4939 [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface 4940 UvData.MouseAction='create_object'; 4941 set(huvmat,'UserData',UvData) 4942 4943
Note: See TracChangeset
for help on using the changeset viewer.