Ignore:
Timestamp:
Apr 14, 2014, 11:41:21 AM (10 years ago)
Author:
sommeria
Message:

various bug resolutions and improvements in particular with geometry_calib. Introduction of a tool set_slices in uvmat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r724 r738  
    5050% Edit the above text to modify the response to help geometry_calib
    5151
    52 % Last Modified by GUIDE v2.5 29-Oct-2013 06:46:10
     52% Last Modified by GUIDE v2.5 11-Apr-2014 23:10:57
    5353
    5454% Begin initialization code - DO NOT edit
     
    110110set(handles.Extrinsic,'Position',[1 Height-40-4-92-75 418 75])%  rank 3
    111111set(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 203 30])%  rank 5
     112set(handles.CheckEnableMouse,'Position',[3 Height-40-8-92-75-117-30 180 30])%  rank 5
    113113set(handles.PLOT,'Position',[3 Height-394 120 30])%  rank 6
    114114set(handles.Copy,'Position',[151 Height-394 120 30])%  rank 6
    115115set(handles.CLEAR_PTS,'Position',[297 Height-394 120 30])%  rank 6
    116116set(handles.ClearLine,'Position',[297 Height-364 120 30])%  rank 6
     117set(handles.CoordLine,'Position',[177 Height-364 120 30])%  rank 6
    117118set(handles.phys_title,'Position',[38 Height-426 125 20])%  rank 7
    118119set(handles.CoordUnit,'Position',[151 Height-426 120 30])%  rank 7
     
    124125set(handles.calib_type,'String',{'rescale';'linear';'3D_linear';'3D_quadr';'3D_extrinsic'})
    125126if exist('inputfile','var')&& ~isempty(inputfile)
    126     struct.XmlInputFile=inputfile;
     127%     struct.XmlInputFile=inputfile;
    127128    [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
    140142    set(handles.ListCoord,'Data',[])
    141     if exist(inputfile,'file')
    142         Heading=loadfile(handles,inputfile);% load data from the xml file
     143    if exist(struct.XmlInputFile,'file')
     144        Heading=loadfile(handles,struct.XmlInputFile);% load data from the xml file
    143145        if isfield(Heading,'Campaign')&& ischar(Heading.Campaign)
    144146            struct.Campaign=Heading.Campaign;
     
    214216   
    215217    %% 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
    226219    UserData=get(handles.geometry_calib,'UserData');
    227220    UserData.XmlInputFile=outputfile;%save the current xml file name
    228221    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 coordinates
     222    uvmat('InputFileREFRESH_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat, show the image in phys coordinates
    230223    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
    237229end
    238230
     
    338330%% store the calibration data, by default in the xml file of the currently displayed image
    339331UvData=get(hhuvmat.uvmat,'UserData');
    340 NbSlice_j=1;%default
    341 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     end
    351 end
     332% 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
    352344
    353345answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';...
     
    362354end
    363355if 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});
     373end
     374
     375%------------------------------------------------------------------------
     376% --- determine the parameters for a calibration by an affine function (rescaling and offset, no rotation)
    386377function GeometryCalib=calib_rescale(Coord,handles)
    387378%------------------------------------------------------------------------
     
    401392
    402393%------------------------------------------------------------------------
    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)
    406395function GeometryCalib=calib_linear(Coord,handles)
    407396%------------------------------------------------------------------------
     
    432421
    433422%------------------------------------------------------------------------
    434 % determine the tsai parameters for a view normal to the grid plane
     423% --- determine the tsai parameters for a view normal to the grid plane
    435424% NOT USED
    436425function GeometryCalib=calib_normal(Coord,handles)
     
    498487%------------------------------------------------------------------------
    499488function GeometryCalib=calib_3D_linear(Coord,handles)
    500 %------------------------------------------------------------------
     489%------------------------------------------------------------------------
    501490path_uvmat=which('uvmat');% check the path detected for source file uvmat
    502491path_UVMAT=fileparts(path_uvmat); %path to UVMAT
     
    708697% --- determine the rms of calibration error
    709698function ErrorRms=error_calib(calib_param,Calib,Coord)
     699%------------------------------------------------------------------------
    710700%calib_param: vector of free calibration parameters (to optimise)
    711701%Calib: structure of the given calibration parameters
     
    734724ErrorRms=mean(ErrorRms);
    735725
    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)
    745726
    746727%------------------------------------------------------------------------
    747728% --- Executes on button press in STORE.
    748729function STORE_Callback(hObject, eventdata, handles)
     730%------------------------------------------------------------------------
    749731Coord=get(handles.ListCoord,'Data');
    750732%Object=read_geometry_calib(Coord_cell);
     
    761743    RootPath=get(hhuvmat.RootPath,'String');
    762744    RootFile=get(hhuvmat.RootFile,'String');
    763     filebase=fullfile(RootPath,RootFile);
     745    filebase=[fullfile(RootPath,RootFile) '~'];
    764746    while exist([filebase '.xml'],'file')
    765747        filebase=[filebase '~'];
     
    778760    set(handles.ListCoordFiles,'string',listfile);
    779761end
    780 set(handles.ListCoord,'Data',[])
     762CLEAR_PTS_Callback(hObject, eventdata, handles)% clear the current list and point plots
    781763
    782764% --------------------------------------------------------------------
     
    786768set(handles.ListCoord,'Data',[])
    787769PLOT_Callback(hObject, eventdata, handles)
    788 
    789 %------------------------------------------------------------------------
    790 % --- Executes on button press in CLEAR.
     770update_calib_marker([]);%remove circle marker
     771set(handles.APPLY,'backgroundColor',[1 0 0])% set APPLY button to red color: no calibration wanted without points
     772set(handles.CheckEnableMouse,'value',1); %activate mouse to pick new points
     773
     774%------------------------------------------------------------------------
     775% --- Executes on button press in CLEAR LIST
    791776function CLEAR_Callback(hObject, eventdata, handles)
    792777%------------------------------------------------------------------------
     
    800785choice=get(handles.CheckEnableMouse,'Value');
    801786if choice
    802     set(handles.CheckEnableMouse,'BackgroundColor',[1 1 0])
    803787    huvmat=findobj(allchild(0),'tag','uvmat');
    804788    if ishandle(huvmat)
    805789        hhuvmat=guidata(huvmat);
     790        set(hhuvmat.MenuRuler,'checked','off')%desactivate ruler
    806791        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)
    809794        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
    813797end
    814798
     
    841825set(handles.ListCoord,'Data',Coord)
    842826set(handles.APPLY,'BackgroundColor',[1 0 1])
     827set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid spurious points
    843828
    844829%------------------------------------------------------------------------
     
    858843set(handles.ListCoord,'Data',Coord)
    859844set(handles.APPLY,'BackgroundColor',[1 0 1])
     845set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid spurious points
    860846
    861847% -----------------------------------------------------------------------
     
    1002988PLOT_Callback(hObject, eventdata, handles)
    1003989set(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),'+')
     990set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid spurious points
    1010991
    1011992
     
    10851066PLOT_Callback(handles.geometry_calib, [], handles)
    10861067set(handles.APPLY,'BackgroundColor',[1 0 1])
     1068set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid modifications by default
    10871069
    10881070% -----------------------------------------------------------------------
     
    11041086    loadfile(handles,fileinput)
    11051087end
     1088set(handles.CheckEnableMouse,'value',0); %desactivate mouse to avoid modifications by default
    11061089
    11071090% -----------------------------------------------------------------------
     
    11161099    listfile=[listfile;{inputfile}];%update the list of coord files
    11171100end
    1118 set(handles.ListCoordFiles,'string',listfile);
     1101set(handles.ListCoordFiles,'String',listfile);
    11191102
    11201103
     
    12431226menu=get(h_menu_coord,'String');
    12441227choice=get(h_menu_coord,'Value');
     1228option='';
    12451229if iscell(menu)
    12461230    option=menu{choice};
    1247 else
    1248     option='px'; %default
    12491231end
    12501232Coord=get(handles.ListCoord,'Data');
     
    12521234    if isequal(option,'phys')
    12531235        Coord_plot=Coord(:,1:3);
    1254     elseif isequal(option,'px')||isequal(option,'')
     1236    elseif isempty(option);%optionoption,'px')||isequal(option,'')
    12551237        Coord_plot=Coord(:,4:5);
    12561238    else
    1257         msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be blank, px or phys ')
     1239        msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be blank or phys ')
    12581240    end
    12591241end
     
    12901272if ~isempty(eventdata.Indices)
    12911273    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,:))
    12971277end
    12981278
     
    13161296%------------------------------------------------------------------------
    13171297function ListCoord_KeyPressFcn(hObject, eventdata, handles)
     1298iline=str2num(get(handles.CoordLine,'String'));
    13181299xx=double(get(handles.geometry_calib,'CurrentCharacter'));%get the keyboard character
    1319 if ismember(xx,[30 31 127])% arrow upward, downward, or delete
     1300if ismember(xx,[28 29 30 31])% directional arrow
    13201301    Coord=get(handles.ListCoord,'Data');
    1321     ind=find(Coord(:,6));%find the marker '+' for line selection
    1322     Coord(:,6)=zeros(size(Coord,1),1);% desactivate the current line mark
    13231302    switch xx
    13241303        case 30 % arrow upward
    1325             Coord(ind-1,6)=1;
     1304            iline=iline-1;
    13261305        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
    13351312else
    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
    13371314end
    13381315
     
    13411318% --- update the plot of calibration points
    13421319%------------------------------------------------------------------------
     1320% draw a circle around the point defined by the input coordinates Coord as given by line in the table Listcoord
    13431321function update_calib_marker(Coord)
    1344 %% update the plot on uvmat
     1322
     1323%% read config on uvmat
    13451324huvmat=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');
     1325hhuvmat=guidata(huvmat);
     1326hhh=findobj(hhuvmat.PlotAxes,'Tag','calib_marker');
     1327if numel(Coord)<5
     1328    if ~isempty(hhh)
     1329        delete(hhh)%delete the circle marker in case of no valid input
     1330    end
     1331    return
     1332end
     1333menu=get(hhuvmat.TransformName,'String');
     1334choice=get(hhuvmat.TransformName,'Value');
     1335option='';
    13521336if iscell(menu)
    13531337    option=menu{choice};
    1354 else
    1355     option='px'; %default
    1356 end
    1357 if isequal(option,'phys')
     1338end
     1339
     1340%% read appropriate coordinates (px or phys) in the table ListCoord
     1341if isequal(option,'phys') % use phys coord
    13581342    XCoord=Coord(1);
    13591343    YCoord=Coord(2);
    1360 elseif isequal(option,'px')|| isequal(option,'')
     1344elseif isempty(option)% use coord in pixels
    13611345    XCoord=Coord(4);
    13621346    YCoord=Coord(5);
    13631347else
    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 ')
    13701349    return
    13711350end
    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
     1353xlim=get(hhuvmat.PlotAxes,'XLim');
     1354ylim=get(hhuvmat.PlotAxes,'YLim');
     1355ind_range=max(abs(xlim(2)-xlim(1)),abs(ylim(end)-ylim(1)))/25;%defines the size of the circle marker
     1356check_xlim=0;
     1357if XCoord>xlim(2)
     1358    xlim=xlim+XCoord-xlim(2)+ind_range;% translate plot limit
     1359    check_xlim=1;
     1360elseif XCoord<xlim(1)
     1361    xlim=xlim-XCoord+xlim(1)-ind_range;% translate plot limit
     1362    check_xlim=1;
     1363end
     1364if 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)));
     1368end
     1369check_ylim=0;
     1370if YCoord>ylim(2)
     1371    ylim=ylim+YCoord-ylim(2)+ind_range;% translate plot limit
     1372    check_ylim=1;
     1373elseif YCoord<ylim(1)
     1374    ylim=ylim-YCoord+ylim(1)-ind_range;% translate plot limit
     1375    check_ylim=1;
     1376end
     1377if 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)));
     1381end
     1382
     1383%% plot a circle around the selected point
    13751384if isempty(hhh)
    13761385    set(0,'CurrentFig',huvmat)
    1377     set(huvmat,'CurrentAxes',hplot)
     1386    set(huvmat,'CurrentAxes',hhuvmat.PlotAxes)
    13781387    rectangle('Curvature',[1 1],...
    1379               'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range],'EdgeColor','m',...
    1380               'LineStyle','-','Tag','calib_marker');
     1388        'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range],'EdgeColor','m',...
     1389        'LineStyle','-','Tag','calib_marker');
    13811390else
    13821391    set(hhh,'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range])
     
    13891398
    13901399Coord=get(handles.ListCoord,'Data');
    1391 ind=find(Coord(:,6));%find the marker '-' for line selection
    1392 if isempty(ind)
     1400iline=str2num(get(handles.CoordLine,'String'));
     1401if isempty(iline)
    13931402    msgbox_uvmat('WARNING','no line suppressed, select a line in the table')
    13941403else
    1395     answer=msgbox_uvmat('INPUT_Y-N',['suppress line ' num2str(ind) '?']);
     1404    answer=msgbox_uvmat('INPUT_Y-N',['suppress line ' num2str(iline) '?']);
    13961405    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
     1413end
     1414
Note: See TracChangeset for help on using the changeset viewer.