Changeset 738 for trunk/src/geometry_calib.m
- Timestamp:
- Apr 14, 2014, 11:41:21 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r724 r738 50 50 % Edit the above text to modify the response to help geometry_calib 51 51 52 % Last Modified by GUIDE v2.5 29-Oct-2013 06:46:1052 % Last Modified by GUIDE v2.5 11-Apr-2014 23:10:57 53 53 54 54 % Begin initialization code - DO NOT edit … … 110 110 set(handles.Extrinsic,'Position',[1 Height-40-4-92-75 418 75])% rank 3 111 111 set(handles.PointLists,'Position',[1 Height-40-6-92-75-117 418 117]) % rank 4 112 set(handles.CheckEnableMouse,'Position',[3 Height-40-8-92-75-117-30 20330])% rank 5112 set(handles.CheckEnableMouse,'Position',[3 Height-40-8-92-75-117-30 180 30])% rank 5 113 113 set(handles.PLOT,'Position',[3 Height-394 120 30])% rank 6 114 114 set(handles.Copy,'Position',[151 Height-394 120 30])% rank 6 115 115 set(handles.CLEAR_PTS,'Position',[297 Height-394 120 30])% rank 6 116 116 set(handles.ClearLine,'Position',[297 Height-364 120 30])% rank 6 117 set(handles.CoordLine,'Position',[177 Height-364 120 30])% rank 6 117 118 set(handles.phys_title,'Position',[38 Height-426 125 20])% rank 7 118 119 set(handles.CoordUnit,'Position',[151 Height-426 120 30])% rank 7 … … 124 125 set(handles.calib_type,'String',{'rescale';'linear';'3D_linear';'3D_quadr';'3D_extrinsic'}) 125 126 if exist('inputfile','var')&& ~isempty(inputfile) 126 struct.XmlInputFile=inputfile;127 % struct.XmlInputFile=inputfile; 127 128 [RootPath,SubDir,RootFile,tild,tild,tild,tild,FileExt]=fileparts_uvmat(inputfile); 128 if ~strcmp(FileExt,'.xml') 129 inputfile=fullfile(RootPath,[SubDir '.xml']);%xml file corresponding to the input file 130 if ~exist(inputfile,'file')% case of civ files , removes the extension for subdir 131 inputfile=fullfile(RootPath,[regexprep(SubDir,'\..+$','') '.xml']); 132 if ~exist(inputfile,'file') 133 inputfile=[fullfile(RootPath,SubDir,RootFile) '.xml'];%old convention 134 if ~exist(inputfile,'file') 135 inputfile=''; 136 end 137 end 138 end 139 end 129 struct.XmlInputFile=find_imadoc(RootPath,SubDir,RootFile,FileExt); 130 % if ~strcmp(FileExt,'.xml') 131 % inputfile=fullfile(RootPath,[SubDir '.xml']);%xml file corresponding to the input file 132 % if ~exist(inputfile,'file')% case of civ files , removes the extension for subdir 133 % inputfile=fullfile(RootPath,[regexprep(SubDir,'\..+$','') '.xml']); 134 % if ~exist(inputfile,'file') 135 % inputfile=[fullfile(RootPath,SubDir,RootFile) '.xml'];%old convention 136 % if ~exist(inputfile,'file') 137 % inputfile=''; 138 % end 139 % end 140 % end 141 % end 140 142 set(handles.ListCoord,'Data',[]) 141 if exist( inputfile,'file')142 Heading=loadfile(handles, inputfile);% load data from the xml file143 if exist(struct.XmlInputFile,'file') 144 Heading=loadfile(handles,struct.XmlInputFile);% load data from the xml file 143 145 if isfield(Heading,'Campaign')&& ischar(Heading.Campaign) 144 146 struct.Campaign=Heading.Campaign; … … 214 216 215 217 %% display image with new calibration in the currently opened uvmat interface 216 hhh=findobj(hhuvmat.PlotAxes,'Tag','calib_marker');% delete calib points and markers 217 if ~isempty(hhh) 218 delete(hhh); 219 end 220 hhh=findobj(hhuvmat.PlotAxes,'Tag','calib_points'); 221 if ~isempty(hhh) 222 delete(hhh); 223 end 224 set(hhuvmat.CheckFixLimits,'Value',0)% put FixedLimits option to 'off' 225 set(hhuvmat.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 218 set(hhuvmat.CheckFixLimits,'Value',0)% put FixedLimits option to 'off' to plot the whole image 226 219 UserData=get(handles.geometry_calib,'UserData'); 227 220 UserData.XmlInputFile=outputfile;%save the current xml file name 228 221 set(handles.geometry_calib,'UserData',UserData) 229 uvmat(' RootPath_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat, show the image in phys coordinates222 uvmat('InputFileREFRESH_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat, show the image in phys coordinates 230 223 PLOT_Callback(hObject, eventdata, handles) 231 Data=get(handles.ListCoord,'Data'); 232 Data(:,6)=zeros(size(Data,1),1); 233 Data(index,6)=-1;% indicate in the list the point with max deviation (possible mistake) 234 set(handles.ListCoord,'Data',Data)% indicate in the list the point with max deviation (possible mistake) 235 figure(handles.geometry_calib) 236 set(handles.APPLY,'BackgroundColor',[1 0 0]) 224 set(handles.CoordLine,'string',num2str(index)) 225 Coord=get(handles.ListCoord,'Data'); 226 update_calib_marker(Coord(index,:)); %indicate the point with max deviations from phys coord to calibration 227 figure(handles.geometry_calib)% put the GUI geometry_calib in front 228 set(handles.APPLY,'BackgroundColor',[1 0 0]) % set APPLY button to red color 237 229 end 238 230 … … 338 330 %% store the calibration data, by default in the xml file of the currently displayed image 339 331 UvData=get(hhuvmat.uvmat,'UserData'); 340 NbSlice_j=1;%default341 ZStart=Z_plane;342 ZEnd=Z_plane;343 volume_scan='n';344 if isfield(UvData,'XmlData')345 if isfield(UvData.XmlData,'TranslationMotor')346 NbSlice_j=UvData.XmlData.TranslationMotor.Nbslice;347 ZStart=UvData.XmlData.TranslationMotor.ZStart/10;348 ZEnd=UvData.XmlData.TranslationMotor.ZEnd/10;349 volume_scan='y';350 end351 end332 % NbSlice_j=1;%default 333 % ZStart=Z_plane; 334 % ZEnd=Z_plane; 335 % volume_scan='n'; 336 % if isfield(UvData,'XmlData') 337 % if isfield(UvData.XmlData,'TranslationMotor') 338 % NbSlice_j=UvData.XmlData.TranslationMotor.Nbslice; 339 % ZStart=UvData.XmlData.TranslationMotor.ZStart/10; 340 % ZEnd=UvData.XmlData.TranslationMotor.ZEnd/10; 341 % volume_scan='y'; 342 % end 343 % end 352 344 353 345 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';... … … 362 354 end 363 355 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration 364 input_key={'Z (first position)','Z (last position)','Z (water surface)', 'refractive index','NbSlice','volume scan (y/n)','tilt angle y axis','tilt angle x axis'}; 365 input_val=[{num2str(ZEnd)} {num2str(ZStart)} {num2str(ZStart)} {'1.333'} num2str(NbSlice_j) {volume_scan} {'0'} {'0'}]; 366 answer=inputdlg(input_key,'slice position(s)',ones(1,8), input_val,'on'); 367 GeometryCalib.NbSlice=str2double(answer{5}); 368 GeometryCalib.VolumeScan=answer{6}; 369 if isempty(answer) 370 Z_plane=0; %default 371 else 372 Z_plane=linspace(str2double(answer{1}),str2double(answer{2}),GeometryCalib.NbSlice); 373 end 374 GeometryCalib.SliceCoord=Z_plane'*[0 0 1]; 375 GeometryCalib.SliceAngle(:,3)=0; 376 GeometryCalib.SliceAngle(:,2)=str2double(answer{7})*ones(GeometryCalib.NbSlice,1);%rotation around y axis (to generalise) 377 GeometryCalib.SliceAngle(:,1)=str2double(answer{8})*ones(GeometryCalib.NbSlice,1);%rotation around x axis (to generalise) 378 GeometryCalib.InterfaceCoord=[0 0 str2double(answer{3})]; 379 GeometryCalib.RefractionIndex=str2double(answer{4}); 380 end 381 382 383 384 %------------------------------------------------------------------------ 385 % determine the parameters for a calibration by an affine function (rescaling and offset, no rotation) 356 msgbox_uvmat('CONFIRMATION',{['The current image series is assumed by default in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be modified by MenuSetSlice in the upper bar menu of uvmat'}) 357 % input_key={'Z (first position)','Z (last position)','Z (water surface)', 'refractive index','NbSlice','volume scan (y/n)','tilt angle y axis','tilt angle x axis'}; 358 % input_val=[{num2str(ZEnd)} {num2str(ZStart)} {num2str(ZStart)} {'1.333'} num2str(NbSlice_j) {volume_scan} {'0'} {'0'}]; 359 % answer=inputdlg(input_key,'slice position(s)',ones(1,8), input_val,'on'); 360 % GeometryCalib.NbSlice=str2double(answer{5}); 361 % GeometryCalib.VolumeScan=answer{6}; 362 % if isempty(answer) 363 % Z_plane=0; %default 364 % else 365 % Z_plane=linspace(str2double(answer{1}),str2double(answer{2}),GeometryCalib.NbSlice); 366 % end 367 GeometryCalib.SliceCoord=Z_plane'*[0 0 1]; 368 % GeometryCalib.SliceAngle(:,3)=0; 369 % GeometryCalib.SliceAngle(:,2)=str2double(answer{7})*ones(GeometryCalib.NbSlice,1);%rotation around y axis (to generalise) 370 % GeometryCalib.SliceAngle(:,1)=str2double(answer{8})*ones(GeometryCalib.NbSlice,1);%rotation around x axis (to generalise) 371 % GeometryCalib.InterfaceCoord=[0 0 str2double(answer{3})]; 372 % GeometryCalib.RefractionIndex=str2double(answer{4}); 373 end 374 375 %------------------------------------------------------------------------ 376 % --- determine the parameters for a calibration by an affine function (rescaling and offset, no rotation) 386 377 function GeometryCalib=calib_rescale(Coord,handles) 387 378 %------------------------------------------------------------------------ … … 401 392 402 393 %------------------------------------------------------------------------ 403 % determine the parameters for a calibration by a linear transform matrix (rescale and rotation) 404 405 394 % --- determine the parameters for a calibration by a linear transform matrix (rescale and rotation) 406 395 function GeometryCalib=calib_linear(Coord,handles) 407 396 %------------------------------------------------------------------------ … … 432 421 433 422 %------------------------------------------------------------------------ 434 % determine the tsai parameters for a view normal to the grid plane423 % --- determine the tsai parameters for a view normal to the grid plane 435 424 % NOT USED 436 425 function GeometryCalib=calib_normal(Coord,handles) … … 498 487 %------------------------------------------------------------------------ 499 488 function GeometryCalib=calib_3D_linear(Coord,handles) 500 %------------------------------------------------------------------ 489 %------------------------------------------------------------------------ 501 490 path_uvmat=which('uvmat');% check the path detected for source file uvmat 502 491 path_UVMAT=fileparts(path_uvmat); %path to UVMAT … … 708 697 % --- determine the rms of calibration error 709 698 function ErrorRms=error_calib(calib_param,Calib,Coord) 699 %------------------------------------------------------------------------ 710 700 %calib_param: vector of free calibration parameters (to optimise) 711 701 %Calib: structure of the given calibration parameters … … 734 724 ErrorRms=mean(ErrorRms); 735 725 736 % %------------------------------------------------------------------------737 % function XImage_Callback(hObject, eventdata, handles)738 % %------------------------------------------------------------------------739 % update_list(hObject, eventdata,handles)740 %741 % %------------------------------------------------------------------------742 % function YImage_Callback(hObject, eventdata, handles)743 % %------------------------------------------------------------------------744 % update_list(hObject, eventdata,handles)745 726 746 727 %------------------------------------------------------------------------ 747 728 % --- Executes on button press in STORE. 748 729 function STORE_Callback(hObject, eventdata, handles) 730 %------------------------------------------------------------------------ 749 731 Coord=get(handles.ListCoord,'Data'); 750 732 %Object=read_geometry_calib(Coord_cell); … … 761 743 RootPath=get(hhuvmat.RootPath,'String'); 762 744 RootFile=get(hhuvmat.RootFile,'String'); 763 filebase= fullfile(RootPath,RootFile);745 filebase=[fullfile(RootPath,RootFile) '~']; 764 746 while exist([filebase '.xml'],'file') 765 747 filebase=[filebase '~']; … … 778 760 set(handles.ListCoordFiles,'string',listfile); 779 761 end 780 set(handles.ListCoord,'Data',[]) 762 CLEAR_PTS_Callback(hObject, eventdata, handles)% clear the current list and point plots 781 763 782 764 % -------------------------------------------------------------------- … … 786 768 set(handles.ListCoord,'Data',[]) 787 769 PLOT_Callback(hObject, eventdata, handles) 788 789 %------------------------------------------------------------------------ 790 % --- Executes on button press in CLEAR. 770 update_calib_marker([]);%remove circle marker 771 set(handles.APPLY,'backgroundColor',[1 0 0])% set APPLY button to red color: no calibration wanted without points 772 set(handles.CheckEnableMouse,'value',1); %activate mouse to pick new points 773 774 %------------------------------------------------------------------------ 775 % --- Executes on button press in CLEAR LIST 791 776 function CLEAR_Callback(hObject, eventdata, handles) 792 777 %------------------------------------------------------------------------ … … 800 785 choice=get(handles.CheckEnableMouse,'Value'); 801 786 if choice 802 set(handles.CheckEnableMouse,'BackgroundColor',[1 1 0])803 787 huvmat=findobj(allchild(0),'tag','uvmat'); 804 788 if ishandle(huvmat) 805 789 hhuvmat=guidata(huvmat); 790 set(hhuvmat.MenuRuler,'checked','off')%desactivate ruler 806 791 if get(hhuvmat.CheckEditObject,'Value') 807 set(hhuvmat.CheckEditObject,'Value',0)808 uvmat('CheckEditObject_Callback',hhuvmat.CheckEditObject,[],hhuvmat)792 set(hhuvmat.CheckEditObject,'Value',0) 793 uvmat('CheckEditObject_Callback',hhuvmat.CheckEditObject,[],hhuvmat) 809 794 end 810 end 811 else 812 set(handles.CheckEnableMouse,'BackgroundColor',[0.7 0.7 0.7]) 795 set(hhuvmat.MenuRuler,'checked','off')%desactivate ruler 796 end 813 797 end 814 798 … … 841 825 set(handles.ListCoord,'Data',Coord) 842 826 set(handles.APPLY,'BackgroundColor',[1 0 1]) 827 set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid spurious points 843 828 844 829 %------------------------------------------------------------------------ … … 858 843 set(handles.ListCoord,'Data',Coord) 859 844 set(handles.APPLY,'BackgroundColor',[1 0 1]) 845 set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid spurious points 860 846 861 847 % ----------------------------------------------------------------------- … … 1002 988 PLOT_Callback(hObject, eventdata, handles) 1003 989 set(handles.APPLY,'BackgroundColor',[1 0 1]) 1004 1005 % figure(10) 1006 % hold off 1007 % imagesc(Amod) 1008 % hold on 1009 % plot(Tmod(:,1),Tmod(:,2),'+') 990 set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid spurious points 1010 991 1011 992 … … 1085 1066 PLOT_Callback(handles.geometry_calib, [], handles) 1086 1067 set(handles.APPLY,'BackgroundColor',[1 0 1]) 1068 set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid modifications by default 1087 1069 1088 1070 % ----------------------------------------------------------------------- … … 1104 1086 loadfile(handles,fileinput) 1105 1087 end 1088 set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid modifications by default 1106 1089 1107 1090 % ----------------------------------------------------------------------- … … 1116 1099 listfile=[listfile;{inputfile}];%update the list of coord files 1117 1100 end 1118 set(handles.ListCoordFiles,' string',listfile);1101 set(handles.ListCoordFiles,'String',listfile); 1119 1102 1120 1103 … … 1243 1226 menu=get(h_menu_coord,'String'); 1244 1227 choice=get(h_menu_coord,'Value'); 1228 option=''; 1245 1229 if iscell(menu) 1246 1230 option=menu{choice}; 1247 else1248 option='px'; %default1249 1231 end 1250 1232 Coord=get(handles.ListCoord,'Data'); … … 1252 1234 if isequal(option,'phys') 1253 1235 Coord_plot=Coord(:,1:3); 1254 elseif ise qual(option,'px')||isequal(option,'')1236 elseif isempty(option);%optionoption,'px')||isequal(option,'') 1255 1237 Coord_plot=Coord(:,4:5); 1256 1238 else 1257 msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be blank , pxor phys ')1239 msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be blank or phys ') 1258 1240 end 1259 1241 end … … 1290 1272 if ~isempty(eventdata.Indices) 1291 1273 iline=eventdata.Indices(1);% selected line number 1292 Data=get(handles.ListCoord,'Data'); 1293 Data(:,6)=zeros(size(Data,1),1); 1294 Data(iline,6)=-1;% mark the selected line 1295 set(handles.ListCoord,'Data',Data) 1296 update_calib_marker(Data(iline,:)) 1274 set(handles.CoordLine,'String',num2str(iline)) 1275 Data=get(handles.ListCoord,'Data'); 1276 update_calib_marker(Data(iline,:)) 1297 1277 end 1298 1278 … … 1316 1296 %------------------------------------------------------------------------ 1317 1297 function ListCoord_KeyPressFcn(hObject, eventdata, handles) 1298 iline=str2num(get(handles.CoordLine,'String')); 1318 1299 xx=double(get(handles.geometry_calib,'CurrentCharacter'));%get the keyboard character 1319 if ismember(xx,[ 30 31 127])% arrow upward, downward, or delete1300 if ismember(xx,[28 29 30 31])% directional arrow 1320 1301 Coord=get(handles.ListCoord,'Data'); 1321 ind=find(Coord(:,6));%find the marker '+' for line selection1322 Coord(:,6)=zeros(size(Coord,1),1);% desactivate the current line mark1323 1302 switch xx 1324 1303 case 30 % arrow upward 1325 Coord(ind-1,6)=1;1304 iline=iline-1; 1326 1305 case 31% arrow downward 1327 Coord(ind+1,6)=1; 1328 case 127% remove line 1329 Coord(ind,:)=[]; 1330 PLOT_Callback(hObject,eventdata,handles) 1331 set(handles.APPLY,'BackgroundColor',[1 0 1]) 1332 otherwise 1333 end 1334 set(handles.ListCoord,'Data',Coord); 1306 iline=iline+1; 1307 end 1308 if iline>=1 && iline<=size(Coord,1) 1309 set(handles.CoordLine,'String',num2str(iline)) 1310 update_calib_marker(Coord(iline,1:5))% show the point corresponding to the selected line 1311 end 1335 1312 else 1336 set(handles.APPLY,'BackgroundColor',[1 0 1]) 1313 set(handles.APPLY,'BackgroundColor',[1 0 1])% paint APPLY in magenta to indicate that the table content has be modified 1337 1314 end 1338 1315 … … 1341 1318 % --- update the plot of calibration points 1342 1319 %------------------------------------------------------------------------ 1320 % draw a circle around the point defined by the input coordinates Coord as given by line in the table Listcoord 1343 1321 function update_calib_marker(Coord) 1344 %% update the plot on uvmat 1322 1323 %% read config on uvmat 1345 1324 huvmat=findobj(allchild(0),'Name','uvmat');%find the current uvmat interface handle 1346 hplot=findobj(huvmat,'Tag','PlotAxes');%main plotting axis of uvmat 1347 hhh=findobj(hplot,'Tag','calib_marker'); 1348 1349 h_menu_coord=findobj(huvmat,'Tag','TransformName'); 1350 menu=get(h_menu_coord,'String'); 1351 choice=get(h_menu_coord,'Value'); 1325 hhuvmat=guidata(huvmat); 1326 hhh=findobj(hhuvmat.PlotAxes,'Tag','calib_marker'); 1327 if numel(Coord)<5 1328 if ~isempty(hhh) 1329 delete(hhh)%delete the circle marker in case of no valid input 1330 end 1331 return 1332 end 1333 menu=get(hhuvmat.TransformName,'String'); 1334 choice=get(hhuvmat.TransformName,'Value'); 1335 option=''; 1352 1336 if iscell(menu) 1353 1337 option=menu{choice}; 1354 e lse1355 option='px'; %default 1356 end1357 if isequal(option,'phys') 1338 end 1339 1340 %% read appropriate coordinates (px or phys) in the table ListCoord 1341 if isequal(option,'phys') % use phys coord 1358 1342 XCoord=Coord(1); 1359 1343 YCoord=Coord(2); 1360 elseif ise qual(option,'px')|| isequal(option,'')1344 elseif isempty(option)% use coord in pixels 1361 1345 XCoord=Coord(4); 1362 1346 YCoord=Coord(5); 1363 1347 else 1364 msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be blank, px or phys ') 1365 end 1366 if isempty(XCoord)||isempty(YCoord) 1367 if ~isempty(hhh) 1368 delete(hhh)%delete the circle marker 1369 end 1348 msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be blank or phys ') 1370 1349 return 1371 1350 end 1372 xlim=get(hplot,'XLim'); 1373 ylim=get(hplot,'YLim'); 1374 ind_range=max(abs(xlim(2)-xlim(1)),abs(ylim(end)-ylim(1)))/20;%defines the size of the circle marker 1351 1352 %% adjust the plot limits if needed 1353 xlim=get(hhuvmat.PlotAxes,'XLim'); 1354 ylim=get(hhuvmat.PlotAxes,'YLim'); 1355 ind_range=max(abs(xlim(2)-xlim(1)),abs(ylim(end)-ylim(1)))/25;%defines the size of the circle marker 1356 check_xlim=0; 1357 if XCoord>xlim(2) 1358 xlim=xlim+XCoord-xlim(2)+ind_range;% translate plot limit 1359 check_xlim=1; 1360 elseif XCoord<xlim(1) 1361 xlim=xlim-XCoord+xlim(1)-ind_range;% translate plot limit 1362 check_xlim=1; 1363 end 1364 if check_xlim 1365 set(hhuvmat.PlotAxes,'XLim',xlim); 1366 set(hhuvmat.num_MaxX,'String',num2str(xlim(2))); 1367 set(hhuvmat.num_MinX,'String',num2str(xlim(1))); 1368 end 1369 check_ylim=0; 1370 if YCoord>ylim(2) 1371 ylim=ylim+YCoord-ylim(2)+ind_range;% translate plot limit 1372 check_ylim=1; 1373 elseif YCoord<ylim(1) 1374 ylim=ylim-YCoord+ylim(1)-ind_range;% translate plot limit 1375 check_ylim=1; 1376 end 1377 if check_ylim 1378 set(hhuvmat.PlotAxes,'YLim',ylim); 1379 set(hhuvmat.num_MaxY,'String',num2str(ylim(2))); 1380 set(hhuvmat.num_MinY,'String',num2str(ylim(1))); 1381 end 1382 1383 %% plot a circle around the selected point 1375 1384 if isempty(hhh) 1376 1385 set(0,'CurrentFig',huvmat) 1377 set(huvmat,'CurrentAxes',h plot)1386 set(huvmat,'CurrentAxes',hhuvmat.PlotAxes) 1378 1387 rectangle('Curvature',[1 1],... 1379 1380 1388 'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range],'EdgeColor','m',... 1389 'LineStyle','-','Tag','calib_marker'); 1381 1390 else 1382 1391 set(hhh,'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range]) … … 1389 1398 1390 1399 Coord=get(handles.ListCoord,'Data'); 1391 i nd=find(Coord(:,6));%find the marker '-' for line selection1392 if isempty(i nd)1400 iline=str2num(get(handles.CoordLine,'String')); 1401 if isempty(iline) 1393 1402 msgbox_uvmat('WARNING','no line suppressed, select a line in the table') 1394 1403 else 1395 answer=msgbox_uvmat('INPUT_Y-N',['suppress line ' num2str(i nd) '?']);1404 answer=msgbox_uvmat('INPUT_Y-N',['suppress line ' num2str(iline) '?']); 1396 1405 if isequal(answer,'Yes') 1397 Coord(:,6)=zeros(size(Coord,1),1);% desactivate the current line mark 1398 Coord(ind,:)=[]; 1399 PLOT_Callback(hObject,eventdata,handles) 1400 set(handles.APPLY,'BackgroundColor',[1 0 1]) 1401 set(handles.ListCoord,'Data',Coord); 1402 end 1403 end 1406 Coord(iline,:)=[]; 1407 set(handles.APPLY,'BackgroundColor',[1 0 1]) 1408 set(handles.ListCoord,'Data',Coord); 1409 set(handles.CoordLine,'String','') 1410 PLOT_Callback(hObject,eventdata,handles) 1411 update_calib_marker([]);%remove circle marker 1412 end 1413 end 1414
Note: See TracChangeset
for help on using the changeset viewer.