Changeset 660 for trunk/src/geometry_calib.m
- Timestamp:
- Jul 5, 2013, 11:15:09 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.