Home > . > read_geometry_calib.m

# read_geometry_calib

## PURPOSE

'read_geometry_calib': read data on the GUI geometry_calib

## SYNOPSIS

function data=read_geometry_calib(Coord_cell)

## DESCRIPTION

    'read_geometry_calib': read data on the GUI geometry_calib
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- geometry_calib 'geometry_calib': performs geometric calibration from a set of reference points
- mouse_down 'mouse_down': function activated when the mouse button is pressed on a figure (callback for 'WindowButtonDownFcn'

## SOURCE CODE

    0001 %'read_geometry_calib': read data on the GUI geometry_calib
    0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    0003 function data=read_geometry_calib(Coord_cell)
    0004 data_XIma=[];
    0005 data_YIma=[];
    0006 data_XObject=[];
    0007 data_YObject=[];
    0008 data_ZObject=[];
    0009 %Coord=get(handles.ListCoord,'String');
    0010 % XImage=get(handles.XImage,'String');
    0011 % YImage=get(handles.YImage,'String');
    0012 % XObject=get(handles.XObject,'String');
    0013 % YObject=get(handles.YObject,'String');
    0014 % ZObject=get(handles.ZObject,'String');
    0015 % if ischar(Xcolumn)
    0016 %     Xcolumn={Xcolumn};
    0017 % end
    0018 nb_defining_points=length(Coord_cell);
    0019 iline=0;
    0020 for i=1:nb_defining_points
    0021     coord_str=Coord_cell{i};%character string of line number i
    0022     k=findstr('|',coord_str);%find separators '|'
    0023     if length(k)>=4 % test for separators '|'
    0024         data1=str2num(coord_str(1:k(1)-5));
    0025         data2=str2num(coord_str(k(1)+5:k(2)-5));
    0026         data3=str2num(coord_str(k(2)+5:k(3)-5));
    0027         data4=str2num(coord_str(k(3)+5:k(4)-5));
    0028         data5=str2num(coord_str(k(4)+5:end));
    0029         if ~isempty(data1)|~isempty(data2)|~isempty(data3)|~isempty(data4)|~isempty(data5)
    0030             iline=iline+1;
    0031             if ~isempty(data1)
    0032                 data.Coord(iline,1)=data1;
    0033             end
    0034             if ~isempty(data2)
    0035                 data.Coord(iline,2)=data2;
    0036             end
    0037             if ~isempty(data3)
    0038                 data.Coord(iline,3)=data3;
    0039             end
    0040             if ~isempty(data4)
    0041                 data.Coord(iline,4)=data4;
    0042             end
    0043             if isempty(data5)
    0044                 data.Coord(iline,5)=0;
    0045             else
    0046                 data.Coord(iline,5)=data5;
    0047             end
    0048         end
    0049     end
    0050 end
    0051 data.Style='points';