Index: trunk/src/geometry_calib.m
===================================================================
--- trunk/src/geometry_calib.m	(revision 657)
+++ trunk/src/geometry_calib.m	(revision 660)
@@ -50,5 +50,5 @@
 % Edit the above text to modify the response to help geometry_calib
 
-% Last Modified by GUIDE v2.5 03-Jul-2013 09:23:35
+% Last Modified by GUIDE v2.5 05-Jul-2013 08:29:07
 
 % Begin initialization code - DO NOT edit
@@ -480,5 +480,5 @@
 huvmat=findobj(allchild(0),'Tag','uvmat');
 hhuvmat=guidata(huvmat);
-coord_files=get(handles.coord_files,'String');
+coord_files=get(handles.ListCoordFiles,'String');
 if ischar(coord_files)
     coord_files={coord_files};
@@ -487,5 +487,5 @@
     coord_files={};
 end
-%retrieve the calibration points stored in the files listed in the popup list coord_files
+%retrieve the calibration points stored in the files listed in the popup list ListCoordFiles
 x_1=Coord(:,4:5)';%px coordinates of the ref points
 nx=str2num(get(hhuvmat.num_Npx,'String'));
@@ -551,5 +551,5 @@
 hhuvmat=guidata(huvmat);
 % check_cond=0;
-coord_files=get(handles.coord_files,'String');
+coord_files=get(handles.ListCoordFiles,'String');
 if ischar(coord_files)
     coord_files={coord_files};
@@ -559,5 +559,5 @@
 end
 
-%retrieve the calibration points stored in the files listed in the popup list coord_files
+%retrieve the calibration points stored in the files listed in the popup list ListCoordFiles
 x_1=Coord(:,4:5)';%px coordinates of the ref points
 nx=str2num(get(hhuvmat.num_Npx,'String'));
@@ -737,5 +737,5 @@
         msgbox_uvmat('ERROR',errormsg);
     end
-    listfile=get(handles.coord_files,'string');
+    listfile=get(handles.ListCoordFiles,'string');
     if isequal(listfile,{''})
         listfile={outputfile};
@@ -743,5 +743,5 @@
         listfile=[listfile;{outputfile}];%update the list of coord files
     end
-    set(handles.coord_files,'string',listfile);
+    set(handles.ListCoordFiles,'string',listfile);
 end
 % set(handles.ListCoord,'Value',1)% refresh the display of coordinates
@@ -762,6 +762,6 @@
 function CLEAR_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-set(handles.coord_files,'Value',1)
-set(handles.coord_files,'String',{''})
+set(handles.ListCoordFiles,'Value',1)
+set(handles.ListCoordFiles,'String',{''})
 
 %------------------------------------------------------------------------
@@ -811,10 +811,10 @@
 
 %------------------------------------------------------------------------
-% --- Executes on selection change in edit_append.
-function edit_append_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-choice=get(handles.edit_append,'Value');
+% --- Executes on selection change in CheckEnableMouse.
+function CheckEnableMouse_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+choice=get(handles.CheckEnableMouse,'Value');
 if choice
-    set(handles.edit_append,'BackgroundColor',[1 1 0])
+    set(handles.CheckEnableMouse,'BackgroundColor',[1 1 0])
     huvmat=findobj(allchild(0),'tag','uvmat');
     if ishandle(huvmat)
@@ -826,5 +826,5 @@
     end
 else
-    set(handles.edit_append,'BackgroundColor',[0.7 0.7 0.7]) 
+    set(handles.CheckEnableMouse,'BackgroundColor',[0.7 0.7 0.7]) 
 end
     
@@ -918,26 +918,13 @@
 
 %grid in phys space
-Coord=get(handles.ListCoord,'String');
-val=get(handles.ListCoord,'Value');
-data=read_geometry_calib(Coord);
-%nbpoints=size(data.Coord,1); %nbre of calibration points
-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
-% for i=1:nbpoints
-%    for j=1:5
+Coord=get(handles.ListCoord,'Data');
+Coord(1:size(T,1),1:3)=T;%update the existing list of phys coordinates from the GUI create_grid
+
+% for i=1:size(data.Coord,1)
+%     for j=1:5
 %           Coord{i,j}=num2str(data.Coord(i,j),4);%display coordiantes with 4 digits
-%    end
+%     end
 % end
-%update the phys coordinates starting from the selected point (down in the
-Coord(end,:)=[]; %remove last string '.....'
-for i=1:size(data.Coord,1)
-    for j=1:5
-          Coord{i,j}=num2str(data.Coord(i,j),4);%display coordiantes with 4 digits
-    end
-end
-
-%size(data.Coord,1)
-Tabchar=cell2tab(Coord,' | ');
-Tabchar=[Tabchar ;{'......'}];
-set(handles.ListCoord,'String',Tabchar)
+set(handles.ListCoord,'Data',Coord)
 
 % -----------------------------------------------------------------------
@@ -946,13 +933,12 @@
 %------------------------------------------------------------------------
 %% read the four last point coordinates in pixels
-Coord_cell=get(handles.ListCoord,'String');%read list of coordinates on geometry_calib
-data=read_geometry_calib(Coord_cell);
-nbpoints=size(data.Coord,1); %nbre of calibration points
+Coord=get(handles.ListCoord,'Data');%read list of coordinates on geometry_calib
+nbpoints=size(Coord,1); %nbre of calibration points
 if nbpoints~=4
     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')
     return
 end
-corners_X=(data.Coord(end:-1:end-3,4)); %pixel absissa of the four corners
-corners_Y=(data.Coord(end:-1:end-3,5)); 
+corners_X=(Coord(end:-1:end-3,4)); %pixel absissa of the four corners
+corners_Y=(Coord(end:-1:end-3,5)); 
 
 %reorder the last two points (the two first in the list) if needed
@@ -1064,15 +1050,17 @@
 Tmod=T(:,(1:2))+Delta;
 [Xpx,Ypx]=px_XYZ(GeometryCalib,Tmod(:,1),Tmod(:,2));
-for ipoint=1:nbpoints
-     Coord{ipoint,1}=num2str(T(ipoint,1),4);%display coordiantes with 4 digits
-     Coord{ipoint,2}=num2str(T(ipoint,2),4);%display coordiantes with 4 digits
-     Coord{ipoint,3}=num2str(T(ipoint,3),4);%display coordiantes with 4 digits;
-     Coord{ipoint,4}=num2str(Xpx(ipoint),4);%display coordiantes with 4 digits
-     Coord{ipoint,5}=num2str(Ypx(ipoint),4);%display coordiantes with 4 digits
-end
-Tabchar=cell2tab(Coord(end:-1:1,:),' | ');
-Tabchar=[Tabchar ;{'......'}];
-set(handles.ListCoord,'Value',1)
-set(handles.ListCoord,'String',Tabchar)
+% for ipoint=1:nbpoints
+%      Coord{ipoint,1}=num2str(T(ipoint,1),4);%display coordiantes with 4 digits
+%      Coord{ipoint,2}=num2str(T(ipoint,2),4);%display coordiantes with 4 digits
+%      Coord{ipoint,3}=num2str(T(ipoint,3),4);%display coordiantes with 4 digits;
+%      Coord{ipoint,4}=num2str(Xpx(ipoint),4);%display coordiantes with 4 digits
+%      Coord{ipoint,5}=num2str(Ypx(ipoint),4);%display coordiantes with 4 digits
+% end
+Coord=[T Xpx Ypx zeros(size(T,1),1)];
+set(handles.ListCoord,'Data',Coord)
+% Tabchar=cell2tab(Coord(end:-1:1,:),' | ');
+% Tabchar=[Tabchar ;{'......'}];
+% set(handles.ListCoord,'Value',1)
+% set(handles.ListCoord,'String',Tabchar)
 PLOT_Callback(hObject, eventdata, handles)
 
@@ -1197,5 +1185,5 @@
 % -----------------------------------------------------------------------
 inputfile=browse_xml(hObject, eventdata, handles);
-listfile=get(handles.coord_files,'string');
+listfile=get(handles.ListCoordFiles,'string');
 if isequal(listfile,{''})
     listfile={inputfile};
@@ -1203,5 +1191,5 @@
     listfile=[listfile;{inputfile}];%update the list of coord files
 end
-set(handles.coord_files,'string',listfile);
+set(handles.ListCoordFiles,'string',listfile);
 
 %------------------------------------------------------------------------
@@ -1308,9 +1296,9 @@
 
 if isempty(CoordCell)% allow mouse action by default in the absence of input points
-    set(handles.edit_append,'Value',1)
-    set(handles.edit_append,'BackgroundColor',[1 1 0])
+    set(handles.CheckEnableMouse,'Value',1)
+    set(handles.CheckEnableMouse,'BackgroundColor',[1 1 0])
 else % does not allow mouse action by default in the presence of input points
-    set(handles.edit_append,'Value',0)
-    set(handles.edit_append,'BackgroundColor',[0.7 0.7 0.7])
+    set(handles.CheckEnableMouse,'Value',0)
+    set(handles.CheckEnableMouse,'BackgroundColor',[0.7 0.7 0.7])
 end
 
@@ -1478,2 +1466,9 @@
     set(hhh,'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range])
 end
+
+
+% --- Executes on button press in Copy.
+function Copy_Callback(hObject, eventdata, handles)
+% hObject    handle to Copy (see GCBO)
+% eventdata  reserved - to be defined in a future version of MATLAB
+% handles    structure with handles and user data (see GUIDATA)
