Index: /trunk/src/phys_XYZ.m
===================================================================
--- /trunk/src/phys_XYZ.m	(revision 1109)
+++ /trunk/src/phys_XYZ.m	(revision 1110)
@@ -77,4 +77,5 @@
     R=(Calib.R)';
     c=Z0virt;
+    cvirt=Z0virt;
     if testangle
         % equation of the illumination plane: z=ax+by+c
@@ -90,4 +91,5 @@
         cvirt=Z0virt-avirt*Calib.SliceCoord(Zindex,1)-bvirt*Calib.SliceCoord(Zindex,2);% Z0 = (virtual) z coordinate on the rotation axis (assumed horizontal)
                                % c=z coordinate at (x,y)=(0,0)
+        c=Z0virt-a*Calib.SliceCoord(Zindex,1)-b*Calib.SliceCoord(Zindex,2);
         R(1)=R(1)+avirt*R(3);
         R(2)=R(2)+bvirt*R(3);
Index: /trunk/src/proj_field.m
===================================================================
--- /trunk/src/proj_field.m	(revision 1109)
+++ /trunk/src/proj_field.m	(revision 1110)
@@ -1086,5 +1086,5 @@
         end
     else % the z coordinate is set only by the field plane (by calibration)
-        ProjData.ProjObjectCoord(3)=FieldData.PlaneCoord(3);
+        ProjData.ProjObjectCoord=FieldData.PlaneCoord;
     end
     if isfield(FieldData,'PlaneAngle')
Index: /trunk/src/series/extract_rdvision.m
===================================================================
--- /trunk/src/series/extract_rdvision.m	(revision 1109)
+++ /trunk/src/series/extract_rdvision.m	(revision 1110)
@@ -209,4 +209,7 @@
                 if check_xml
                     [success,errormsg] = copyfile(filexml,[fullfile(RootPath,logdir,Param.InputTable{iview,3}) '.xml']); %copy the original xml file in the upper folder
+                else
+                    errormsg=[filexml ' missing'];
+                    return
                 end
             end
Index: /trunk/src/series/time_series.m
===================================================================
--- /trunk/src/series/time_series.m	(revision 1109)
+++ /trunk/src/series/time_series.m	(revision 1110)
@@ -508,4 +508,5 @@
     
     % record the time:
+    if isempty(errormsg)
     if isempty(time)% time not set by xml filer(s)
         if isfield(Data{1},'Time')
@@ -516,4 +517,5 @@
     else % time from ImaDoc prevails  TODO: correct
         DataOut.Time(index,1)=time(index);%
+    end
     end
     index
Index: /trunk/src/toolbox_calib/go_calib_optim_iter.m
===================================================================
--- /trunk/src/toolbox_calib/go_calib_optim_iter.m	(revision 1109)
+++ /trunk/src/toolbox_calib/go_calib_optim_iter.m	(revision 1110)
@@ -30,36 +30,34 @@
 %For now, if using a 3D calibration rig, quick_init is set to 1 for an easy initialization of the focal length
 
-if ~exist('desactivated_images'),
+if ~exist('desactivated_images','var')
     desactivated_images = [];
-end;
-
-
-
-if ~exist('est_aspect_ratio'),
+end
+
+if ~exist('est_aspect_ratio','var')
     est_aspect_ratio = 1;
-end;
-
-if ~exist('est_fc');
+end
+
+if ~exist('est_fc','var')
     est_fc = [1;1]; % Set to zero if you do not want to estimate the focal length (it may be useful! believe it or not!)
-end;
-
-if ~exist('recompute_extrinsic'),
+end
+
+if ~exist('recompute_extrinsic','var')
     recompute_extrinsic = 1; % Set this variable to 0 in case you do not want to recompute the extrinsic parameters
     % at each iterstion.
-end;
-
-if ~exist('MaxIter'),
+end
+
+if ~exist('MaxIter','var')
     MaxIter = 30; % Maximum number of iterations in the gradient descent
 end;
 
-if ~exist('check_cond'),
+if ~exist('check_cond','var'),
     check_cond = 1; % Set this variable to 0 in case you don't want to extract view dynamically
 end;
 
-if ~exist('center_optim'),
+if ~exist('center_optim','var'),
     center_optim = 1; %%% Set this variable to 0 if your do not want to estimate the principal point
 end;
 
-if exist('est_dist'),
+if exist('est_dist','var'),
     if length(est_dist) == 4,
         est_dist = [est_dist ; 0];
@@ -67,9 +65,9 @@
 end;
 
-if ~exist('est_dist'),
+if ~exist('est_dist','var'),
     est_dist = [1;1;1;1;0];
 end;
 
-if ~exist('est_alpha'),
+if ~exist('est_alpha','var'),
     est_alpha = 0; % by default, do not estimate skew
 end;
@@ -87,5 +85,5 @@
 fprintf(1,'\n');
 
-if ~exist('nx')&~exist('ny'),
+if ~exist('nx','var')&~exist('ny','var'),
     fprintf(1,'WARNING: No image size (nx,ny) available. Setting nx=640 and ny=480. If these are not the right values, change values manually.\n');
     nx = 640;
@@ -116,5 +114,5 @@
 end;
 
-if ~exist('dont_ask'),
+if ~exist('dont_ask','var'),
     dont_ask = 0;
 end;
@@ -161,5 +159,5 @@
 if ~center_optim, % In the case where the principal point is not estimated, keep it at the center of the image
     fprintf(1,'Principal point not optimized (center_optim=0). ');
-    if ~exist('cc'),
+    if ~exist('cc','var'),
         fprintf(1,'It is kept at the center of the image.\n');
         cc = [(nx-1)/2;(ny-1)/2];
@@ -228,25 +226,25 @@
 % Initialization of the intrinsic parameters (if necessary)
 
-if ~exist('cc'),
+if ~exist('cc','var')
     fprintf(1,'Initialization of the principal point at the center of the image.\n');
     cc = [(nx-1)/2;(ny-1)/2];
     alpha_smooth = 0.1; % slow convergence
-end;
-
-
-if exist('kc'),
-    if length(kc) == 4;
+end
+
+
+if exist('kc','var')
+    if length(kc) == 4
         fprintf(1,'Adding a new distortion coefficient to kc -> radial distortion model up to the 6th degree');
         kc = [kc;0];
-    end;
-end;
-
-if ~exist('alpha_c'),
+    end
+end
+
+if ~exist('alpha_c','var')
     fprintf(1,'Initialization of the image skew to zero.\n');
     alpha_c = 0;
     alpha_smooth = 0.1; % slow convergence
-end;
-
-if ~exist('fc') && quick_init,
+end
+
+if ~exist('fc','var') && quick_init
     FOV_angle = 35; % Initial camera field of view in degrees
     fprintf(1,['Initialization of the focal length to a FOV of ' num2str(FOV_angle) ' degrees.\n']);
@@ -254,8 +252,8 @@
     est_fc = [1;1];
     alpha_smooth = 0.1; % slow 
-end;
-
-
-if ~exist('fc'),
+end
+
+
+if ~exist('fc','var')
     % Initialization of the intrinsic parameters:
     fprintf(1,'Initialization of the intrinsic parameters using the vanishing points of planar patterns.\n')
@@ -263,5 +261,5 @@
     alpha_smooth = 0.1; % slow convergence
     est_fc = [1;1];
-end;
+end
 
 
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 1109)
+++ /trunk/src/uvmat.m	(revision 1110)
@@ -3419,4 +3419,5 @@
     if ~isempty(errormsg)
         msgbox_uvmat('ERROR',errormsg);
+        return
     end
     pause(1.02-get(handles.speed,'Value'));% wait for next image
@@ -3494,5 +3495,5 @@
 end
 UvData=get(handles.uvmat,'UserData');
-if ishandle(handles.UVMAT_title) %remove title panel on uvmat
+if ishandle(handles.UVMAT_title) %remove title panel on uvmat (which appears at the first openning of the GUI)
     delete(handles.UVMAT_title)
 end
@@ -3998,5 +3999,5 @@
      set(handles.Objects,'Visible','on')
     %if no projection object exists, create a default one
-    if isempty(UvData.ProjObject{1})
+    if isempty(UvData.ProjObject{1})% if no projection object is specified
         set(handles.ListObject,'Value',1)
         set(handles.ListObject,'String',{'plane'})
@@ -4015,5 +4016,6 @@
                 UvData.ProjObject{1}.CoordUnit=UvData.Field.CoordUnit;
             end
-        elseif isfield(UvData,'Z')
+        %elseif isfield(UvData,'Z')
+        else
             %multilevel case (single menuplane in a 3D space)
             if isfield(UvData,'CoordType')&& isequal(UvData.CoordType,'phys') && isfield(UvData,'XmlData')
