- Timestamp:
- Jul 5, 2013, 11:15:09 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/activate.m
r627 r660 71 71 pause(0.2) 72 72 end 73 if strcmp(get(hObject,' Style'),'axes')73 if strcmp(get(hObject,'Type'),'axes') 74 74 mouse_down(hFig,[]) 75 pause(2) 75 76 mouse_up(hFig,[]) 77 drawnow 76 78 else 77 79 BackgroundColor=get(hObject,'BackgroundColor'); -
trunk/src/check_files.m
r659 r660 192 192 193 193 %% check dates of compilation 194 currentdir=pwd;195 cd(pathuvmat)196 list_compile=dir('*.sh');197 for ilist=1:numel(list_compile)198 mfile=regexprep(list_compile(ilist).name,'.sh$','.m');199 if exist(mfile,'file')200 datfile=dir(mfile);201 if ~isempty(datfile) && isfield(datfile,'datenum') && datfile.datenum>list_compile(ilist).datenum202 checkmsg=[checkmsg;{[list_compile(ilist).name ' needs to be updated by compile_functions']}];203 end204 end205 end206 cd(currentdir)207 194 % currentdir=pwd; 195 % cd(pathuvmat) 196 % list_compile=dir('*.sh'); 197 % for ilist=1:numel(list_compile) 198 % mfile=regexprep(list_compile(ilist).name,'.sh$','.m'); 199 % if exist(mfile,'file') 200 % datfile=dir(mfile); 201 % if ~isempty(datfile) && isfield(datfile,'datenum') && datfile.datenum>list_compile(ilist).datenum 202 % checkmsg=[checkmsg;{[list_compile(ilist).name ' needs to be updated by compile_functions']}]; 203 % end 204 % end 205 % end 206 % cd(currentdir) 207 -
trunk/src/demo_uvmat.m
r627 r660 4 4 % brigtness 5 5 huvmat=findobj(allchild(0),'Tag','uvmat'); 6 figure(huvmat)6 uistack(huvmat,'top') 7 7 activate('uvmat','Scalar','num_MaxA',[],100) 8 8 activate('uvmat','Scalar','CheckFixScalar',[],0) -
trunk/src/geometry_calib.m
r657 r660 50 50 % Edit the above text to modify the response to help geometry_calib 51 51 52 % Last Modified by GUIDE v2.5 0 3-Jul-2013 09:23:3552 % Last Modified by GUIDE v2.5 05-Jul-2013 08:29:07 53 53 54 54 % Begin initialization code - DO NOT edit … … 480 480 huvmat=findobj(allchild(0),'Tag','uvmat'); 481 481 hhuvmat=guidata(huvmat); 482 coord_files=get(handles. coord_files,'String');482 coord_files=get(handles.ListCoordFiles,'String'); 483 483 if ischar(coord_files) 484 484 coord_files={coord_files}; … … 487 487 coord_files={}; 488 488 end 489 %retrieve the calibration points stored in the files listed in the popup list coord_files489 %retrieve the calibration points stored in the files listed in the popup list ListCoordFiles 490 490 x_1=Coord(:,4:5)';%px coordinates of the ref points 491 491 nx=str2num(get(hhuvmat.num_Npx,'String')); … … 551 551 hhuvmat=guidata(huvmat); 552 552 % check_cond=0; 553 coord_files=get(handles. coord_files,'String');553 coord_files=get(handles.ListCoordFiles,'String'); 554 554 if ischar(coord_files) 555 555 coord_files={coord_files}; … … 559 559 end 560 560 561 %retrieve the calibration points stored in the files listed in the popup list coord_files561 %retrieve the calibration points stored in the files listed in the popup list ListCoordFiles 562 562 x_1=Coord(:,4:5)';%px coordinates of the ref points 563 563 nx=str2num(get(hhuvmat.num_Npx,'String')); … … 737 737 msgbox_uvmat('ERROR',errormsg); 738 738 end 739 listfile=get(handles. coord_files,'string');739 listfile=get(handles.ListCoordFiles,'string'); 740 740 if isequal(listfile,{''}) 741 741 listfile={outputfile}; … … 743 743 listfile=[listfile;{outputfile}];%update the list of coord files 744 744 end 745 set(handles. coord_files,'string',listfile);745 set(handles.ListCoordFiles,'string',listfile); 746 746 end 747 747 % set(handles.ListCoord,'Value',1)% refresh the display of coordinates … … 762 762 function CLEAR_Callback(hObject, eventdata, handles) 763 763 %------------------------------------------------------------------------ 764 set(handles. coord_files,'Value',1)765 set(handles. coord_files,'String',{''})764 set(handles.ListCoordFiles,'Value',1) 765 set(handles.ListCoordFiles,'String',{''}) 766 766 767 767 %------------------------------------------------------------------------ … … 811 811 812 812 %------------------------------------------------------------------------ 813 % --- Executes on selection change in edit_append.814 function edit_append_Callback(hObject, eventdata, handles)815 %------------------------------------------------------------------------ 816 choice=get(handles. edit_append,'Value');813 % --- Executes on selection change in CheckEnableMouse. 814 function CheckEnableMouse_Callback(hObject, eventdata, handles) 815 %------------------------------------------------------------------------ 816 choice=get(handles.CheckEnableMouse,'Value'); 817 817 if choice 818 set(handles. edit_append,'BackgroundColor',[1 1 0])818 set(handles.CheckEnableMouse,'BackgroundColor',[1 1 0]) 819 819 huvmat=findobj(allchild(0),'tag','uvmat'); 820 820 if ishandle(huvmat) … … 826 826 end 827 827 else 828 set(handles. edit_append,'BackgroundColor',[0.7 0.7 0.7])828 set(handles.CheckEnableMouse,'BackgroundColor',[0.7 0.7 0.7]) 829 829 end 830 830 … … 918 918 919 919 %grid in phys space 920 Coord=get(handles.ListCoord,'String'); 921 val=get(handles.ListCoord,'Value'); 922 data=read_geometry_calib(Coord); 923 %nbpoints=size(data.Coord,1); %nbre of calibration points 924 data.Coord(val:val+size(T,1)-1,1:3)=T(end:-1:1,:);%update the existing list of phys coordinates from the GUI create_grid 925 % for i=1:nbpoints 926 % for j=1:5 920 Coord=get(handles.ListCoord,'Data'); 921 Coord(1:size(T,1),1:3)=T;%update the existing list of phys coordinates from the GUI create_grid 922 923 % for i=1:size(data.Coord,1) 924 % for j=1:5 927 925 % Coord{i,j}=num2str(data.Coord(i,j),4);%display coordiantes with 4 digits 928 % end926 % end 929 927 % end 930 %update the phys coordinates starting from the selected point (down in the 931 Coord(end,:)=[]; %remove last string '.....' 932 for i=1:size(data.Coord,1) 933 for j=1:5 934 Coord{i,j}=num2str(data.Coord(i,j),4);%display coordiantes with 4 digits 935 end 936 end 937 938 %size(data.Coord,1) 939 Tabchar=cell2tab(Coord,' | '); 940 Tabchar=[Tabchar ;{'......'}]; 941 set(handles.ListCoord,'String',Tabchar) 928 set(handles.ListCoord,'Data',Coord) 942 929 943 930 % ----------------------------------------------------------------------- … … 946 933 %------------------------------------------------------------------------ 947 934 %% read the four last point coordinates in pixels 948 Coord_cell=get(handles.ListCoord,'String');%read list of coordinates on geometry_calib 949 data=read_geometry_calib(Coord_cell); 950 nbpoints=size(data.Coord,1); %nbre of calibration points 935 Coord=get(handles.ListCoord,'Data');%read list of coordinates on geometry_calib 936 nbpoints=size(Coord,1); %nbre of calibration points 951 937 if nbpoints~=4 952 938 msgbox_uvmat('ERROR','four points must have be selected by the mouse to delimitate the phys grid area; the Ox axis will be defined by the two first points') 953 939 return 954 940 end 955 corners_X=( data.Coord(end:-1:end-3,4)); %pixel absissa of the four corners956 corners_Y=( data.Coord(end:-1:end-3,5));941 corners_X=(Coord(end:-1:end-3,4)); %pixel absissa of the four corners 942 corners_Y=(Coord(end:-1:end-3,5)); 957 943 958 944 %reorder the last two points (the two first in the list) if needed … … 1064 1050 Tmod=T(:,(1:2))+Delta; 1065 1051 [Xpx,Ypx]=px_XYZ(GeometryCalib,Tmod(:,1),Tmod(:,2)); 1066 for ipoint=1:nbpoints 1067 Coord{ipoint,1}=num2str(T(ipoint,1),4);%display coordiantes with 4 digits 1068 Coord{ipoint,2}=num2str(T(ipoint,2),4);%display coordiantes with 4 digits 1069 Coord{ipoint,3}=num2str(T(ipoint,3),4);%display coordiantes with 4 digits; 1070 Coord{ipoint,4}=num2str(Xpx(ipoint),4);%display coordiantes with 4 digits 1071 Coord{ipoint,5}=num2str(Ypx(ipoint),4);%display coordiantes with 4 digits 1072 end 1073 Tabchar=cell2tab(Coord(end:-1:1,:),' | '); 1074 Tabchar=[Tabchar ;{'......'}]; 1075 set(handles.ListCoord,'Value',1) 1076 set(handles.ListCoord,'String',Tabchar) 1052 % for ipoint=1:nbpoints 1053 % Coord{ipoint,1}=num2str(T(ipoint,1),4);%display coordiantes with 4 digits 1054 % Coord{ipoint,2}=num2str(T(ipoint,2),4);%display coordiantes with 4 digits 1055 % Coord{ipoint,3}=num2str(T(ipoint,3),4);%display coordiantes with 4 digits; 1056 % Coord{ipoint,4}=num2str(Xpx(ipoint),4);%display coordiantes with 4 digits 1057 % Coord{ipoint,5}=num2str(Ypx(ipoint),4);%display coordiantes with 4 digits 1058 % end 1059 Coord=[T Xpx Ypx zeros(size(T,1),1)]; 1060 set(handles.ListCoord,'Data',Coord) 1061 % Tabchar=cell2tab(Coord(end:-1:1,:),' | '); 1062 % Tabchar=[Tabchar ;{'......'}]; 1063 % set(handles.ListCoord,'Value',1) 1064 % set(handles.ListCoord,'String',Tabchar) 1077 1065 PLOT_Callback(hObject, eventdata, handles) 1078 1066 … … 1197 1185 % ----------------------------------------------------------------------- 1198 1186 inputfile=browse_xml(hObject, eventdata, handles); 1199 listfile=get(handles. coord_files,'string');1187 listfile=get(handles.ListCoordFiles,'string'); 1200 1188 if isequal(listfile,{''}) 1201 1189 listfile={inputfile}; … … 1203 1191 listfile=[listfile;{inputfile}];%update the list of coord files 1204 1192 end 1205 set(handles. coord_files,'string',listfile);1193 set(handles.ListCoordFiles,'string',listfile); 1206 1194 1207 1195 %------------------------------------------------------------------------ … … 1308 1296 1309 1297 if isempty(CoordCell)% allow mouse action by default in the absence of input points 1310 set(handles. edit_append,'Value',1)1311 set(handles. edit_append,'BackgroundColor',[1 1 0])1298 set(handles.CheckEnableMouse,'Value',1) 1299 set(handles.CheckEnableMouse,'BackgroundColor',[1 1 0]) 1312 1300 else % does not allow mouse action by default in the presence of input points 1313 set(handles. edit_append,'Value',0)1314 set(handles. edit_append,'BackgroundColor',[0.7 0.7 0.7])1301 set(handles.CheckEnableMouse,'Value',0) 1302 set(handles.CheckEnableMouse,'BackgroundColor',[0.7 0.7 0.7]) 1315 1303 end 1316 1304 … … 1478 1466 set(hhh,'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range]) 1479 1467 end 1468 1469 1470 % --- Executes on button press in Copy. 1471 function Copy_Callback(hObject, eventdata, handles) 1472 % hObject handle to Copy (see GCBO) 1473 % eventdata reserved - to be defined in a future version of MATLAB 1474 % handles structure with handles and user data (see GUIDATA) -
trunk/src/mouse_down.m
r657 r660 74 74 else 75 75 hh_calib=guidata(h_calib); 76 test_cal=get(hh_calib. edit_append,'Value');76 test_cal=get(hh_calib.CheckEnableMouse,'Value'); 77 77 end 78 78 end … … 403 403 h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI 404 404 hh_geometry_calib=guidata(h_geometry_calib); 405 h_ edit_append=hh_geometry_calib.edit_append;%findobj(h_geometry_calib,'Tag','edit_append');406 if isequal(get(h_ edit_append,'Value'),1) && ~isempty(haxes)405 h_CheckEnableMouse=hh_geometry_calib.CheckEnableMouse; 406 if isequal(get(h_CheckEnableMouse,'Value'),1) && ~isempty(haxes) 407 407 if ~isequal(get(hhuvmat.TransformName,'Value'),1); %active only with no transform (px coordinates) 408 408 set(hhuvmat.TransformName,'Value',1) -
trunk/src/mouse_motion.m
r657 r660 397 397 end 398 398 hh=findobj('Tag','calib_points');%look for handle of calibration points 399 if ~isempty(hh) && ~isempty(get(hh,'UserData')) && get(hh_geometry_calib. edit_append,'Value')399 if ~isempty(hh) && ~isempty(get(hh,'UserData')) && get(hh_geometry_calib.CheckEnableMouse,'Value') 400 400 %set(hh,'UserData',index_point) 401 401 index_point=get(hh,'UserData'); -
trunk/src/mouse_up.m
r657 r660 333 333 if ~isempty(h_geometry_calib) 334 334 hh_geometry_calib=guidata(h_geometry_calib); 335 edit_test=get(hh_geometry_calib. edit_append,'Value');335 edit_test=get(hh_geometry_calib.CheckEnableMouse,'Value'); 336 336 hh=findobj(hcurrentaxes,'tag','calib_points');%look for handle of calibration points 337 337 if ~isempty(hh) && edit_test -
trunk/src/uvmat.m
r657 r660 4321 4321 if ishandle(hgeometry_calib) 4322 4322 hhgeometry_calib=guidata(hgeometry_calib); 4323 set(hhgeometry_calib. edit_append,'Value',0)% desactivate mouse action in geometry_calib4323 set(hhgeometry_calib.CheckEnableMouse,'Value',0)% desactivate mouse action in geometry_calib 4324 4324 end 4325 4325 set(handles.CheckViewObject,'value',1) … … 4781 4781 if ishandle(hgeometry_calib) 4782 4782 hhgeometry_calib=guidata(hgeometry_calib); 4783 set(hhgeometry_calib. edit_append,'Value',0)% desactivate mouse action in geometry_calib4783 set(hhgeometry_calib.CheckEnableMouse,'Value',0)% desactivate mouse action in geometry_calib 4784 4784 end 4785 4785 set(handles.CheckEditObject,'Value',0) %desactivate the object edit mode
Note: See TracChangeset
for help on using the changeset viewer.