Index: /trunk/src/civ.m
===================================================================
--- /trunk/src/civ.m	(revision 378)
+++ /trunk/src/civ.m	(revision 379)
@@ -23,5 +23,5 @@
 %TODO: search range
 
-% Last Modified by GUIDE v2.5 14-Jan-2012 00:46:29
+% Last Modified by GUIDE v2.5 27-Jan-2012 00:32:33
 % Begin initialization code - DO NOT EDIT
 gui_Singleton = 1;
@@ -4416,5 +4416,2 @@
 
 function RootFile_Callback(hObject, eventdata, handles)
-
-
-
Index: /trunk/src/fileparts_uvmat.m
===================================================================
--- /trunk/src/fileparts_uvmat.m	(revision 378)
+++ /trunk/src/fileparts_uvmat.m	(revision 379)
@@ -104,5 +104,5 @@
             end
             NomType=[get_type(num2) delim1 get_type(num1)];
-            RootFile=regexprep(FileName,[num2 delim1 num1],'');
+            RootFile=regexprep(FileName,[num2 delim1 num1 '$'],'');
         end
         NomType=regexprep(NomType,'-1','-2'); %set 1-2 instead of 1-1
Index: /trunk/src/fill_GUI.m
===================================================================
--- /trunk/src/fill_GUI.m	(revision 378)
+++ /trunk/src/fill_GUI.m	(revision 379)
@@ -3,5 +3,4 @@
 function errormsg=fill_GUI(Param,handles)
 %------------------------------------------------------------------------
-
 errormsg='';
 fields=fieldnames(Param);
@@ -19,17 +18,19 @@
         hh=[];
         input_data=Param.(fields{ifield});
+        check_done=0;
         if isfield(handles,fields{ifield})
             hh=handles.(fields{ifield});
             if strcmp(get(hh,'Type'),'uitable')
+                set(hh,'Visible','on')
                 set(hh,'Data',input_data)
-                break
+                check_done=1;
             end
         elseif isnumeric(input_data) && isfield(handles,['num_' fields{ifield}])
             hh=handles.(['num_' fields{ifield}]);
         end
-        if ~isempty(hh)
+        if ~isempty(hh)&& ~check_done
             set(hh,'Visible','on')
 %             input_data
-            switch get(hh,'style')
+            switch get(hh,'Style')
                 case {'checkbox','radiobutton','togglebutton'}
                     if isnumeric(input_data)
Index: /trunk/src/find_file_series.m
===================================================================
--- /trunk/src/find_file_series.m	(revision 378)
+++ /trunk/src/find_file_series.m	(revision 379)
@@ -54,5 +54,5 @@
 if strcmp( FileType,'multimage')||strcmp( FileType,'video')
         NomType='*';
-        i1_series=(1:FileInfo.NbFrame)'
+        i1_series=(1:FileInfo.NbFrame)';
 end
 
Index: /trunk/src/geometry_calib.m
===================================================================
--- /trunk/src/geometry_calib.m	(revision 378)
+++ /trunk/src/geometry_calib.m	(revision 379)
@@ -149,5 +149,20 @@
 function APPLY_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-%read the current calibration points
+%% look for the GUI uvmat and check for an image as input
+huvmat=findobj(allchild(0),'Name','uvmat');
+hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat
+FileExt=get(hhuvmat.FileExt,'String');
+check_input=0;
+if ~isempty(FileExt)
+    if ~isempty(imformats(FileExt(2:end))) ||strcmpi(FileExt,'.avi')
+        check_input=1;
+    end
+end
+if ~check_input
+    msgbox_uvmat('ERROR','open an image with uvmat to perform calibration')
+    return
+end
+
+%% read the current calibration points
 Coord_cell=get(handles.ListCoord,'String');
 Object=read_geometry_calib(Coord_cell);
@@ -200,6 +215,5 @@
 set(handles.Psi,'String',num2str(GeometryCalib.omc(3),4))
 
-% store the calibration data, by default in the xml file of the currently displayed image
-huvmat=findobj(allchild(0),'Name','uvmat');
+%% store the calibration data, by default in the xml file of the currently displayed image
 UvData=get(huvmat,'UserData');
 NbSlice_j=1;%default
@@ -208,5 +222,4 @@
 volume_scan='n';
 if isfield(UvData,'XmlData')
-    UvData.XmlData
     if isfield(UvData.XmlData,'TranslationMotor')
         NbSlice_j=UvData.XmlData.TranslationMotor.Nbslice;
@@ -216,5 +229,4 @@
     end
 end
-hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat
 RootPath='';
 % RootFile='';
Index: /trunk/src/mouse_down.m
===================================================================
--- /trunk/src/mouse_down.m	(revision 378)
+++ /trunk/src/mouse_down.m	(revision 379)
@@ -90,5 +90,4 @@
     if xy_fig(1) >=obj_pos(1) & xy_fig(2) >= obj_pos(2)& xy_fig(1) <=obj_pos(1)+obj_pos(3) & xy_fig(2) <= obj_pos(2)+obj_pos(4);
         htype=get(hchild,'Type');%type of object child of the current figure
-
         switch htype
             %if the mouse is over an axis, look at the data
@@ -169,5 +168,5 @@
 
 %% delete the current zoom rectangle
-if isfield(AxeData,'CurrentRectZoom') & ishandle(AxeData.CurrentRectZoom)
+if isfield(AxeData,'CurrentRectZoom') && ishandle(AxeData.CurrentRectZoom)
     delete(AxeData.CurrentRectZoom)
     AxeData.CurrentRectZoom=[];
@@ -294,10 +293,10 @@
         hset_object=findobj(allchild(0),'tag','set_object');
         if ~isempty(hset_object)
-            sethandles=guidata(hset_object);
-            ObjectData=read_set_object(sethandles); %read object features in the GUI set_object
+            %ObjectData=read_set_object(sethandles); %read object features in the GUI set_object
+            ObjectData=read_GUI(hset_object);
             ObjectData.Coord=[]; %reset previous object coordinates
             ObjectData.Coord(1,1)=xy(1,1);
             ObjectData.Coord(1,2)=xy(1,2);
-            ObjectData.Coord(1,3)=0;
+%             ObjectData.Coord(1,3)=0;
             if isfield(AxeData,'ObjectCoord') & size(AxeData.ObjectCoord,2)==3
                  ObjectData.Coord(1,3)=AxeData.ObjectCoord(1,3); %generaliser au cas avec angle
@@ -314,8 +313,9 @@
             set(hhuvmat.ListObject,'Value',[IndexObj_old(1) IndexObj] );
             UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject;
-            object_name=get(sethandles.TITLE,'String');
-            if isempty(object_name)|| strcmp(object_name,'')
-                list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Style]; 
-                set(sethandles.TITLE,'String',list_str{IndexObj})
+            object_name=ObjectData.Name;
+            sethandles=guidata(hset_object);
+            if isempty(object_name)
+                list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Type]; 
+                set(sethandles.Name,'String',list_str{IndexObj})
             else
                list_str{IndexObj}=object_name;
Index: /trunk/src/mouse_motion.m
===================================================================
--- /trunk/src/mouse_motion.m	(revision 378)
+++ /trunk/src/mouse_motion.m	(revision 379)
@@ -42,5 +42,5 @@
 test_zoom_draw=0; % test for zoom drawing 
 test_ruler=0;%test for active ruler 
-test_piv=0;% test for PIV correlation display
+% test_piv=0;% test for PIV correlation display
 huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle
 if ~isempty(huvmat)
@@ -58,9 +58,4 @@
     test_piv=1;
 end
-% hciv=findobj(allchild(0),'tag','civ');%find the civ interface handle
-% if ~isempty(hciv) && strcmp(get(currentfig,'tag'),'view_field')
-%     hhciv=guidata(hciv);
-%     test_piv =get(hhciv.TestCiv1,'Value');
-% end
 
 %find the current axe 'haxes' and display the current mouse position or uicontrol tag
@@ -327,14 +322,13 @@
         XYData=AxeData.CurrentOrigin;
         if isequal(AxeData.Drawing,'create') && isfield(AxeData,'CurrentOrigin') && ~isempty(AxeData.CurrentOrigin)
-           if strcmp(ObjectData.Style,'line')||strcmp(ObjectData.Style,'polyline')||strcmp(ObjectData.Style,'polygon')||strcmp(ObjectData.Style,'points')
-              xy(1,3)=0;
-              ObjectData.Coord=[ObjectData.Coord ;xy(1,:)];
+           if strcmp(ObjectData.Type,'line')||strcmp(ObjectData.Type,'polyline')||strcmp(ObjectData.Type,'polygon')||strcmp(ObjectData.Type,'points')
+              ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];
              % ObjectData.Coord(end,:)=xy(1,:);
-           elseif strcmp(ObjectData.Style,'rectangle')||strcmp(ObjectData.Style,'ellipse')||strcmp(ObjectData.Style,'volume')
+           elseif strcmp(ObjectData.Type,'rectangle')||strcmp(ObjectData.Type,'ellipse')||strcmp(ObjectData.Type,'volume')
               ObjectData.Coord(1,1)=(xy(1,1)+XYData(1))/2;%origin rectangle, x coordinate
               ObjectData.Coord(1,2)=(xy(1,2)+XYData(2))/2;
               ObjectData.RangeX=abs(xy(1,1)-XYData(1))/2;%rectangle width
               ObjectData.RangeY=abs(xy(1,2)-XYData(2))/2;%rectangle height
-           elseif isequal(ObjectData.Style,'plane') %case of 'plane'
+           elseif isequal(ObjectData.Type,'plane') %case of 'plane'
                 DX=(xy(1,1)-ObjectData.Coord(1,1));
                 DY=(xy(1,2)-ObjectData.Coord(1,2));
Index: /trunk/src/mouse_up.m
===================================================================
--- /trunk/src/mouse_up.m	(revision 378)
+++ /trunk/src/mouse_up.m	(revision 379)
@@ -78,6 +78,6 @@
     %creating object   
     else   
-        if strcmp(ObjectData.Style,'line')||strcmp(ObjectData.Style,'polyline')||...
-                strcmp(ObjectData.Style,'polygon')||strcmp(ObjectData.Style,'points')
+        if strcmp(ObjectData.Type,'line')||strcmp(ObjectData.Type,'polyline')||...
+                strcmp(ObjectData.Type,'polygon')||strcmp(ObjectData.Type,'points')
             if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3
               xy(1,3)=AxeData.ObjectCoord(1,3); % z coordinate of the mouse: to generalise ...
@@ -86,7 +86,7 @@
             end
             if ~isequal(ObjectData.Coord,xy(1,:))
-                ObjectData.Coord=[ObjectData.Coord ;xy(1,:)];% append the coordiantes marked by the mouse to the eobject
-            end
-        elseif isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'ellipse')||isequal(ObjectData.Style,'volume')
+                ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordiantes marked by the mouse to the eobject
+            end
+        elseif isequal(ObjectData.Type,'rectangle')||isequal(ObjectData.Type,'ellipse')||isequal(ObjectData.Type,'volume')
             XYData=AxeData.CurrentOrigin;
             ObjectData.Coord(1,1)=(xy(1,1)+XYData(1))/2;%origin rectangle, x coordinate
@@ -94,5 +94,5 @@
             ObjectData.RangeX=abs(xy(1,1)-XYData(1))/2;%rectangle width
             ObjectData.RangeY=abs(xy(1,2)-XYData(2))/2;%rectangle height
-        elseif isequal(ObjectData.Style,'plane') %case of 'plane'
+        elseif isequal(ObjectData.Type,'plane') %case of 'plane'
             DX=(xy(1,1)-ObjectData.Coord(1,1));
             DY=(xy(1,2)-ObjectData.Coord(1,2));
@@ -106,7 +106,7 @@
         end
     end
-    if strcmp(ObjectData.Style,'rectangle')||strcmp(ObjectData.Style,'ellipse')
+    if strcmp(ObjectData.Type,'rectangle')||strcmp(ObjectData.Type,'ellipse')
         NbDefPoint=1;  
-    elseif strcmp(ObjectData.Style,'line')|| strcmp(ObjectData.Style,'plane');
+    elseif strcmp(ObjectData.Type,'line')|| strcmp(ObjectData.Type,'plane');
         NbDefPoint=2; 
     else
@@ -117,8 +117,9 @@
     h_set_object=findobj(allchild(0),'Tag','set_object');
     hh_set_object=guidata(h_set_object);
-    set(hh_set_object.XObject,'String',num2str(ObjectData.Coord(:,1),4)); 
-    set(hh_set_object.YObject,'String',num2str(ObjectData.Coord(:,2),4)); 
-    set(hh_set_object.ZObject,'String',num2str(ObjectData.Coord(:,3),4));
-    if strcmp(ObjectData.Style,'rectangle')||strcmp(ObjectData.Style,'ellipse')
+    set(hh_set_object.Coord,'Data',ObjectData.Coord);
+%     set(hh_set_object.XObject,'String',num2str(ObjectData.Coord(:,1),4)); 
+%     set(hh_set_object.YObject,'String',num2str(ObjectData.Coord(:,2),4)); 
+%     set(hh_set_object.ZObject,'String',num2str(ObjectData.Coord(:,3),4));
+    if strcmp(ObjectData.Type,'rectangle')||strcmp(ObjectData.Type,'ellipse')
         set(hh_set_object.XMax,'String',num2str(ObjectData.RangeX,4));
         set(hh_set_object.YMax,'String',num2str(ObjectData.RangeY,4));
@@ -127,5 +128,5 @@
               strcmp(AxeData.Drawing,'translate') || strcmp(AxeData.Drawing,'deform');%stop drawing
         AxeData.CurrentOrigin=[]; %suppress the current origin
-       if isequal(ObjectData.Style,'line') && size(ObjectData.Coord,1)<=1
+       if isequal(ObjectData.Type,'line') && size(ObjectData.Coord,1)<=1
            AxeData.Drawing='off';
            set(currentaxes,'UserData',AxeData);
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 378)
+++ /trunk/src/plot_field.m	(revision 379)
@@ -41,13 +41,4 @@
 %                   default=0, no error. Different non zero values can represent different criteria of elimination.
 %
-%
-%         additional elements characterizing the projection object (should not be necessary)--
-%            Data.Style : style of projection object
-%            Data.XObject,.YObject: set of coordinates defining the object position;
-%            Data.ProjMode=type of projection ;
-%            Data.ProjAngle=angle of projection;
-%            Data.DX,.DY,.DZ=increments;
-%            Data.MaxY,MinY: min and max Y
-
 %   haxes: handle of the plotting axes to update with the new plot. If this input is absent or not a valid axes handle, a new figure is created.
 %
Index: /trunk/src/plot_object.m
===================================================================
--- /trunk/src/plot_object.m	(revision 378)
+++ /trunk/src/plot_object.m	(revision 379)
@@ -9,5 +9,5 @@
 %
 % ObjectDataIn: structure representing the object properties:
-%        .Style : style of projection object
+%        .Type : style of projection object
 %        .Coord: set of coordinates defining the object position;
 %        .ProjMode=type of projection ;
@@ -39,20 +39,20 @@
 %% default output
 hh=[];%default output
-if ~isfield(ObjectDataIn,'Style')|| isequal(ProjObject,ObjectDataIn)% object representation does not appear in its own projection plot
+if ~isfield(ObjectDataIn,'Type')|| isequal(ProjObject,ObjectDataIn)% object representation does not appear in its own projection plot
     return
 end
-if ~isfield(ProjObject,'Style') 
+if ~isfield(ProjObject,'Type') 
     ObjectData=ObjectDataIn;
-elseif isequal(ProjObject.Style,'plane')
+elseif isequal(ProjObject.Type,'plane')
     ObjectData=ObjectDataIn;% TODO: modify take into account rotation of axis
 else
     return % object representation only  available in a plane
 end
-if ~isfield(ObjectData,'Style')||isempty(ObjectData.Style)||~ischar(ObjectData.Style)
-    msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m')
+if ~isfield(ObjectData,'Type')||isempty(ObjectData.Type)||~ischar(ObjectData.Type)
+    msgbox_uvmat('ERROR','undefined ObjectData.Type in plot_object.m')
     return
 end
-if ~isfield(ObjectData,'Style')||isempty(ObjectData.Style)||~ischar(ObjectData.Style)
-    msgbox_uvmat('ERROR','undefined ObjectData.Style in plot_object.m')
+if ~isfield(ObjectData,'Type')||isempty(ObjectData.Type)||~ischar(ObjectData.Type)
+    msgbox_uvmat('ERROR','undefined ObjectData.Type in plot_object.m')
     return
 end
@@ -103,61 +103,60 @@
      ObjectData.Coord=[0 0 0];%default
 end
-if ~isfield(ObjectData,'Phi')||isempty(ObjectData.Phi)
-     ObjectData.Phi=0;%default
-end
-if ~isfield(ObjectData,'Range')
-    ObjectData.Range(1,1)=0; %edfault
-end
-if size(ObjectData.Range,2)>=2
-    YMax=ObjectData.Range(1,2);%default
-end
-if size(ObjectData.Range,2)>=2 & size(ObjectData.Range,1)>=2
-    YMin=ObjectData.Range(2,2);
-else
-    YMin=0;
-end
-XMax=ObjectData.Range(1,1);
-if size(ObjectData.Range,1)>=2 
-    XMin=ObjectData.Range(2,1);
-end
-if isfield(ObjectData,'RangeX')
-   XMax=max(ObjectData.RangeX);
-   XMin=min(ObjectData.RangeX);
-end
-if isfield(ObjectData,'RangeY')
-   YMax=max(ObjectData.RangeY);
-   YMin=min(ObjectData.RangeY);
-end
-if isfield(ObjectData,'RangeZ')
-   ZMax=max(ObjectData.RangeZ);
-   ZMin=min(ObjectData.RangeZ);
-end
-if isequal(ObjectData.Style,'points')&isequal(ObjectData.ProjMode,'projection')
-    YMax=max(XMax,YMax);
-    YMax=max(YMax,ZMax);
-elseif isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'ellipse')||isequal(ObjectData.Style,'volume')
-    if  isequal(YMax,0)
-        ylim=get(haxes,'YLim');
-        YMax=(ylim(2)-ylim(1))/100;
-    end
-    if isequal(XMax,0)
-        XMax=YMax;%default
-    end
-elseif isequal(ObjectData.Style,'plane')
-   if  isequal(XMax,0)
-        xlim=get(haxes,'XLim');
-        XMax=xlim(2);
-   end
-   if  isequal(YMax,0)
-        ylim=get(haxes,'YLim');
-        YMax=ylim(2);
-   end
+% if ~isfield(ObjectData,'Phi')||isempty(ObjectData.Phi)
+%      ObjectData.Phi=0;%default
+% end
+% if ~isfield(ObjectData,'Range')
+%     ObjectData.Range(1,1)=0; %edfault
+% end
+% if size(ObjectData.Range,2)>=2
+%     YMax=ObjectData.Range(1,2);%default
+% end
+% if size(ObjectData.Range,2)>=2 & size(ObjectData.Range,1)>=2
+%     YMin=ObjectData.Range(2,2);
+% else
+%     YMin=0;
+% end
+if isfield(ObjectData,'RangeX') && ~isempty(ObjectData.RangeX)
+    XMax=max(ObjectData.RangeX);
+    XMin=min(ObjectData.RangeX);
+end
+if isfield(ObjectData,'RangeY')&&~isempty(ObjectData.RangeY)
+    YMax=max(ObjectData.RangeY);
+    YMin=min(ObjectData.RangeY);
+end
+if isfield(ObjectData,'RangeZ')&&~isempty(ObjectData.RangeZ)
+    ZMax=max(ObjectData.RangeZ);
+    ZMin=min(ObjectData.RangeZ);
+end
+switch ObjectData.Type
+    case 'points'
+        if strcmp(ObjectData.ProjMode,'projection')
+            YMax=max(XMax,YMax);
+            YMax=max(YMax,ZMax);
+        end
+    case {'rectangle','ellipse','volume'}
+        if  isequal(YMax,0)
+            ylim=get(haxes,'YLim');
+            YMax=(ylim(2)-ylim(1))/100;
+        end
+        if isequal(XMax,0)
+            XMax=YMax;%default
+        end
+    case 'plane'
+        if  isequal(XMax,0)
+            xlim=get(haxes,'XLim');
+            XMax=xlim(2);
+        end
+        if  isequal(YMax,0)
+            ylim=get(haxes,'YLim');
+            YMax=ylim(2);
+        end
 end
 sizcoord=size(ObjectData.Coord);
 
 %% determine the coordinates xline, yline,xsup,xinf, yinf,ysup determining the new object plot
-test_line= isequal(ObjectData.Style,'points')|isequal(ObjectData.Style,'line')|isequal(ObjectData.Style,'polyline')|...
-    isequal(ObjectData.Style,'polygon')| isequal(ObjectData.Style,'plane')| isequal(ObjectData.Style,'volume');
-test_patch=isequal(ObjectData.ProjMode,'inside')||isequal(ObjectData.ProjMode,'outside')||isequal(ObjectData.Style,'volume')...
+test_line= isequal(ObjectData.Type,'points')|isequal(ObjectData.Type,'line')|isequal(ObjectData.Type,'polyline')|...
+    isequal(ObjectData.Type,'polygon')| isequal(ObjectData.Type,'plane')| isequal(ObjectData.Type,'volume');
+test_patch=isequal(ObjectData.ProjMode,'inside')||isequal(ObjectData.ProjMode,'outside')||isequal(ObjectData.Type,'volume')...
     ||isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside');
 if test_line
@@ -165,8 +164,8 @@
     yline=ObjectData.Coord(:,2);
     nbpoints=numel(xline);
-    if isequal(ObjectData.Style,'polygon')
+    if isequal(ObjectData.Type,'polygon')
         xline=[xline; ObjectData.Coord(1,1)];%closing the line
         yline=[yline; ObjectData.Coord(1,2)];
-    elseif isequal(ObjectData.Style,'plane')|| isequal(ObjectData.Style,'volume') 
+    elseif isequal(ObjectData.Type,'plane')|| isequal(ObjectData.Type,'volume') 
         phi=ObjectData.Phi*pi/180;%angle in radians
         Xend_x=xline(1)+XMax*cos(phi);
@@ -195,5 +194,5 @@
         end
     end 
-    if isequal(ObjectData.Style,'line')||isequal(ObjectData.Style,'polyline')||isequal(ObjectData.Style,'polygon')
+    if isequal(ObjectData.Type,'line')||isequal(ObjectData.Type,'polyline')||isequal(ObjectData.Type,'polygon')
         if length(xline)<2
             theta=0;
@@ -220,5 +219,5 @@
     npMy=512;  
     flag=zeros(npMy,npMx);
-    if isequal(ObjectData.Style,'ellipse')
+    if isequal(ObjectData.Type,'ellipse')
         XimaMin=ObjectData.Coord(1,1)-XMax;
         XimaMax=ObjectData.Coord(1,1)+XMax;
@@ -237,5 +236,5 @@
         distY=(Yi-ObjectData.Coord(1,2));
         flag=(distX.*distX/X2Max+distY.*distY/Y2Max)<1;
-    elseif isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'volume')
+    elseif isequal(ObjectData.Type,'rectangle')||isequal(ObjectData.Type,'volume')
         XimaMin=ObjectData.Coord(1,1)-XMax;
         XimaMax=ObjectData.Coord(1,1)+XMax;
@@ -252,5 +251,5 @@
         distY=abs(Yi-ObjectData.Coord(1,2));
         flag=distX<XMax & distY< YMax;
-    elseif isequal(ObjectData.Style,'polygon')
+    elseif isequal(ObjectData.Type,'polygon')
         XimaMin=min(ObjectData.Coord(:,1));
         XimaMax=max(ObjectData.Coord(:,1));
@@ -286,10 +285,10 @@
     %modify subobjects
         if isfield(PlotData,'SubObject') 
-           if length(PlotData.SubObject)==2 && ~isequal(ObjectData.Style,'points')&& ~isequal(ObjectData.Style,'plane');
+           if length(PlotData.SubObject)==2 && ~isequal(ObjectData.Type,'points')&& ~isequal(ObjectData.Type,'plane');
                 set(PlotData.SubObject(1),'XData',xinf);
                 set(PlotData.SubObject(1),'YData',yinf);
                 set(PlotData.SubObject(2),'XData',xsup);
                 set(PlotData.SubObject(2),'YData',ysup);
-           elseif isequal(ObjectData.Style,'points')&& ~isequal(YMax,0)
+           elseif isequal(ObjectData.Type,'points')&& ~isequal(YMax,0)
                for ipt=1:min(length(PlotData.SubObject),size(ObjectData.Coord,1))
                     set(PlotData.SubObject(ipt),'Position',[ObjectData.Coord(ipt,1)-YMax ObjectData.Coord(ipt,2)-YMax 2*YMax 2*YMax])
@@ -321,5 +320,5 @@
            end
         end
-    elseif isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'ellipse')
+    elseif isequal(ObjectData.Type,'rectangle')||isequal(ObjectData.Type,'ellipse')
         set(hplot,'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax])          
     end
@@ -358,5 +357,5 @@
     set(hother,'Color','b');
     set(hother,'Selected','off')  
-    if isequal(ObjectData.Style,'points')
+    if isequal(ObjectData.Type,'points')
         hh=line(ObjectData.Coord(:,1),ObjectData.Coord(:,2),'Color',col,'LineStyle','.','Marker','+');
         for ipt=1:length(xline)
@@ -370,8 +369,8 @@
               end
         end
-    elseif  strcmp(ObjectData.Style,'line')||strcmp(ObjectData.Style,'polyline')||...        
-          strcmp(ObjectData.Style,'polygon') ||strcmp(ObjectData.Style,'plane')||strcmp(ObjectData.Style,'volume')%  (isequal(ObjectData.Style,'polygon') & ~test_patch) |isequal(ObjectData.Style,'plane')
+    elseif  strcmp(ObjectData.Type,'line')||strcmp(ObjectData.Type,'polyline')||...        
+          strcmp(ObjectData.Type,'polygon') ||strcmp(ObjectData.Type,'plane')||strcmp(ObjectData.Type,'volume')%  (isequal(ObjectData.Type,'polygon') & ~test_patch) |isequal(ObjectData.Type,'plane')
         hh=line(xline,yline,'Color',col);
-        if ~strcmp(ObjectData.Style,'plane') && ~strcmp(ObjectData.Style,'volume')
+        if ~strcmp(ObjectData.Type,'plane') && ~strcmp(ObjectData.Type,'volume')
             PlotData.SubObject(1)=line(xinf,yinf,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');%draw sub-lines
             PlotData.SubObject(2)=line(xsup,ysup,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');
@@ -382,10 +381,10 @@
         end
     
-    elseif strcmp(ObjectData.Style,'rectangle')
+    elseif strcmp(ObjectData.Type,'rectangle')
         hh=rectangle('Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col);   
-    elseif strcmp(ObjectData.Style,'ellipse')
+    elseif strcmp(ObjectData.Type,'ellipse')
         hh=rectangle('Curvature',[1 1],'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col);
     else
-        msgbox_uvmat('ERROR','unknown ObjectData.Style in plot_object.m')
+        msgbox_uvmat('ERROR','unknown ObjectData.Type in plot_object.m')
         return
     end
Index: /trunk/src/proj_field.m
===================================================================
--- /trunk/src/proj_field.m	(revision 378)
+++ /trunk/src/proj_field.m	(revision 379)
@@ -17,7 +17,7 @@
 %INPUT
 % ObjectData: structure characterizing the projection object
-%    .Style : style of projection object
-%    .ProjMode=type of projection ;
-%    .CoordType: 'px' or 'phys' type of coordinates defining the object position
+%    .Type : type of projection object
+%    .ProjMode=mode of projection ;
+%    .CoordUnit: 'px', 'cm' units for the coordinates defining the object
 %    .Phi  angle of rotation (=0 by default)
 %    .ProjAngle=angle of projection;
@@ -88,11 +88,11 @@
 end
 
-%% in the absence of object Style or projection mode, or object coordinaes, the input field is just tranfered without change
-if ~isfield(ObjectData,'Style')||~isfield(ObjectData,'ProjMode')
+%% in the absence of object Type or projection mode, or object coordinaes, the input field is just tranfered without change
+if ~isfield(ObjectData,'Type')||~isfield(ObjectData,'ProjMode')
     ProjData=FieldData;
     return
 end
 if ~isfield(ObjectData,'Coord')
-    if strcmp(ObjectData.Style,'plane')
+    if strcmp(ObjectData.Type,'plane')
         ObjectData.Coord=[0 0 0];%default
     else
@@ -124,5 +124,5 @@
 
 %% apply projection depending on the object style
-switch ObjectData.Style
+switch ObjectData.Type
     case 'points'
     [ProjData,errormsg]=proj_points(FieldData,ObjectData);
@@ -480,5 +480,5 @@
 %select the indices in the range of action
     testin=[];%default
-    if isequal(ObjectData.Style,'rectangle')
+    if isequal(ObjectData.Type,'rectangle')
 %            if ~isfield(ObjectData,'RangeX')|~isfield(ObjectData,'RangeY')
 %                 errormsg='rectangle half sides RangeX and RangeY needed'
@@ -494,5 +494,5 @@
            testin=distX<widthx & distY<widthy;
        end
-    elseif isequal(ObjectData.Style,'polygon')
+    elseif isequal(ObjectData.Type,'polygon')
         if testX
             testin=inpolygon(coord_x,coord_y,ObjectData.Coord(:,1),ObjectData.Coord(:,2));
@@ -502,5 +502,5 @@
            testin=[]; %A REVOIR
        end
-    elseif isequal(ObjectData.Style,'ellipse')
+    elseif isequal(ObjectData.Type,'ellipse')
        X2Max=widthx*widthx;
        Y2Max=(widthy)*(widthy);
@@ -567,8 +567,8 @@
 ProjMode='projection';%direct projection on the line by default
 if isfield(ObjectData,'ProjMode'),ProjMode=ObjectData.ProjMode; end; 
-ProjAngle=90; %90 degrees projection by default
-if isfield(FieldData,'ProjAngle'),ProjAngle=ObjectData.ProjAngle; end; 
+% ProjAngle=90; %90 degrees projection by default
+% if isfield(FieldData,'ProjAngle'),ProjAngle=ObjectData.ProjAngle; end; 
 width=0;%default width of the projection band
-if isfield(ObjectData,'Range')&size(ObjectData.Range,2)>=2
+if isfield(ObjectData,'Range')&&size(ObjectData.Range,2)>=2
     width=abs(ObjectData.Range(1,2));
 end
@@ -777,6 +777,6 @@
     %case of structured coordinates
     elseif  numel(VarType.coord)>=2 & VarType.coord(1:2) > 0;
-        if ~isequal(ObjectData.Style,'line')% exclude polyline
-            errormsg=['no  projection available on ' ObjectData.Style 'for structured coordinates']; % 
+        if ~isequal(ObjectData.Type,'line')% exclude polyline
+            errormsg=['no  projection available on ' ObjectData.Type 'for structured coordinates']; % 
         else
             test_Amat=1;%image or 2D matrix
@@ -949,29 +949,11 @@
 testangle=~isequal(PlaneAngle,[0 0 0]);% && ~test90y && ~test90x;%=1 for slanted plane 
 
-% Phi=0;%default
-% Theta=0;
-% Psi=0;
-% if isfield(ObjectData,'Phi')&& ~isempty(ObjectData.Phi)
-%     Phi=(pi/180)*ObjectData.Phi;%first Euler angle in radian
-% end
-% if isfield(ObjectData,'Theta')&& ~isempty(ObjectData.Theta)
-%     Theta=(pi/180)*ObjectData.Theta;%second Euler angle in radian
-% end
-% if isfield(ObjectData,'Psi')&& ~isempty(ObjectData.Psi)
-%     Psi=(pi/180)*ObjectData.Psi;%third Euler angle in radian
-% end
-
-%components of the unity vector normal to the projection plane
-% NormVec_X=-sin(Phi)*sin(Theta);
-% NormVec_Y=cos(Phi)*sin(Theta);
-% NormVec_Z=cos(Theta);
-
 %mesh sizes DX and DY
 DX=0;
 DY=0; %default 
-if isfield(ObjectData,'DX')&~isempty(ObjectData.DX)
+if isfield(ObjectData,'DX') && ~isempty(ObjectData.DX)
      DX=abs(ObjectData.DX);%mesh of interpolation points 
 end
-if isfield(ObjectData,'DY')&~isempty(ObjectData.DY)
+if isfield(ObjectData,'DY') && ~isempty(ObjectData.DY)
      DY=abs(ObjectData.DY);%mesh of interpolation points 
 end
@@ -2187,6 +2169,6 @@
 %% transfer coordinate unit
 if isfield(FieldData,'CoordUnit')
-    if isfield(ObjectData,'CoordUnit')&~isequal(FieldData.CoordUnit,ObjectData.CoordUnit)
-        errormsg=[ObjectData.Style ' in ' ObjectData.CoordUnit ' coordinates, while field in ' FieldData.CoordUnit ];
+    if isfield(ObjectData,'CoordUnit') && ~strcmp(FieldData.CoordUnit,ObjectData.CoordUnit)
+        errormsg=[ObjectData.Type ' in ' ObjectData.CoordUnit ' coordinates, while field in ' FieldData.CoordUnit ];
         return
     else
@@ -2196,5 +2178,5 @@
 
 %% store the properties of the projection object
-ListObject={'Style','ProjMode','RangeX','RangeY','RangeZ','Phi','Theta','Psi','Coord'};
+ListObject={'Type','ProjMode','RangeX','RangeY','RangeZ','Phi','Theta','Psi','Coord'};
 for ilist=1:length(ListObject)
     if isfield(ObjectData,ListObject{ilist})
Index: /trunk/src/read_GUI.m
===================================================================
--- /trunk/src/read_GUI.m	(revision 378)
+++ /trunk/src/read_GUI.m	(revision 379)
@@ -5,4 +5,5 @@
 struct=[];%default
 hchild=get(handle,'children');
+hchild=flipdim(hchild,1);% reverse the order to respect the tab order in the GUI
 for ichild=1:numel(hchild)
     if strcmp(get(hchild(ichild),'Visible'),'on')
@@ -15,14 +16,21 @@
                 object_style=get(hchild(ichild),'Style');
                 check_input=1;%default
+                index=0;
                 switch object_style
                     case {'checkbox','radiobutton','togglebutton'}
                         input=get(hchild(ichild),'Value');
                     case 'edit'
-                        separator=regexp(tag,'^num_');
+                        separator=regexp(tag,'^num_','once');%look for the prefix 'num_'
                         if isempty(separator)
                             input=get(hchild(ichild),'String');
-                        else
-                            input=str2double(get(hchild(ichild),'String'));
+                        else  %transform into numeric if the edit box begins by the prefix 'num_'                                            
+                            input=str2double(get(hchild(ichild),'String'));                        
                             tag=regexprep(tag,'^num_','');
+                            % detect tag name ending by an index: then interpret the input as array(index)
+                            r=regexp(tag,'_(?<index>\d+)$','names');% detect tag name ending by an index
+                            if ~isempty(r)
+                                tag=regexprep(tag,['_' r.index '$'],'');
+                                index=str2double(r.index);
+                            end
                             %deal with undefined input: retrieve the default value stored as UserData
                             if isnan(input)
@@ -39,5 +47,5 @@
                             check_input=0;
                         end
-                        separator=regexp(tag,'^num_');
+                        separator=regexp(tag,'^num_','once');
                         if ~isempty(separator)
                             input=str2double(input);% transform to numerical values if the uicontrol tag begins with 'num_'
@@ -48,5 +56,9 @@
                 end
                 if check_input
-                    struct.(tag)=input;
+                    if index==0
+                       struct.(tag)=input;
+                    else
+                       struct.(tag)(index)=input;
+                    end
                 end
             case 'uitable'
Index: /trunk/src/read_civdata.m
===================================================================
--- /trunk/src/read_civdata.m	(revision 378)
+++ /trunk/src/read_civdata.m	(revision 379)
@@ -72,5 +72,5 @@
 end
 if vardetect(1)==0
-     errormsg=[ 'requested field not available in ' filename '/' VelType];
+     errormsg=[ 'requested field not available in ' filename '/' VelType ': need to run patch'];
      return
 end
Index: /trunk/src/read_field.m
===================================================================
--- /trunk/src/read_field.m	(revision 378)
+++ /trunk/src/read_field.m	(revision 379)
@@ -1,2 +1,3 @@
+
 %'read_field': read input fields in different formats
 %--------------------------------------------------------------------------
@@ -61,5 +62,5 @@
                     ParamOut.ColorVar='ima_cor';
                     InputField=[{ParamOut.FieldName} {ParamOut.ColorVar}];
-                    [Field,ParamOut.VelType]=read_civdata(ObjectName,InputField,ParamIn.VelType);
+                    [Field,ParamOut.VelType,errormsg]=read_civdata(ObjectName,InputField,ParamIn.VelType);
                     test_civx=Field.CivStage;
                     %case of old civx conventions
Index: /trunk/src/read_set_object.m
===================================================================
--- /trunk/src/read_set_object.m	(revision 378)
+++ /trunk/src/read_set_object.m	(revision 379)
@@ -15,158 +15,49 @@
 function data=read_set_object(handles)
 %menus 
-if isfield(handles,'ObjectStyle')%case of the set_object interface
-	menu=get(handles.ObjectStyle,'String');
-	value=get(handles.ObjectStyle,'Value');
-	data.Style=menu{value};
-	menu=get(handles.ProjMode,'String');
-	value=get(handles.ProjMode,'Value');
-	data.ProjMode=menu{value};
-	data.CoordUnit=get(handles.CoordUnit,'String');
-    testcalib=0;
-else %default
-    data.Style='points';
-    testcalib=1;
-end
+data=read_GUI(handles);
 
-%Euler angles and projection ranges
-if ~testcalib
-    if isequal(get(handles.Phi,'Visible'),'on')
-        data.Angle(1)=str2double(get(handles.Phi,'String'));
-    end
-    if isequal(get(handles.Theta,'Visible'),'on')
-        data.Angle(2)=str2double(get(handles.Theta,'String'));
-    end
-    if isequal(get(handles.Psi,'Visible'),'on')
-        data.Angle(3)=str2double(get(handles.Psi,'String'));
-    end
-    if isequal(get(handles.DX,'Visible'),'on')
-        data.DX=str2num(get(handles.DX,'String'));
-    end
-    if isequal(get(handles.DY,'Visible'),'on')
-        data.DY=str2num(get(handles.DY,'String'));
-    end
-    if isequal(get(handles.DZ,'Visible'),'on')
-        data.DZ=str2num(get(handles.DZ,'String'));
-    end
-    dimrange=[1 1];%default
-    if isequal(get(handles.ZMin,'Visible'),'on')
-        ZMin=str2num(get(handles.ZMin,'String'));
-        if ~isempty(ZMin)
-            data.RangeZ(1)=ZMin;
-            dimrange=[2 3];
-        end
-    end
-    if isequal(get(handles.ZMax,'Visible'),'on')
-        ZMax=str2double(get(handles.ZMax,'String'));
-        if isnan(ZMax)
-            if dimrange(1)>1
-                data.RangeZ(1)=ZMax;
-            end
-        else
-            data.RangeZ(2)=ZMax;
-            dimrange=[dimrange(1) 3];
-        end
-    end
-    if isequal(get(handles.YMin,'Visible'),'on')
-        YMin=str2double(get(handles.YMin,'String'));
-        if ~isnan(YMin)
-            data.RangeY(2)=YMin;
-            dimrange=[2 max(dimrange(2),2)];
-        end
-    end
-    if isequal(get(handles.YMax,'Visible'),'on')
-        YMax=str2double(get(handles.YMax,'String'));
-        if ~isnan(YMax)
-            data.RangeY(1)=YMax;
-            dimrange=[dimrange(1) max(dimrange(2),2)];
-        end
-    end
-    if isequal(get(handles.XMin,'Visible'),'on')
-        XMin=str2double(get(handles.XMin,'String'));
-        if ~isnan(XMin)
-            data.RangeX(2)=XMin;
-        end
-    end
-    if isequal(get(handles.XMax,'Visible'),'on')
-        XMax=str2double(get(handles.XMax,'String'));
-        if ~isnan(XMax)
-            data.RangeX(1)=XMax;
-        end
-    end
-end
-
-
-%positions x,y,z
-Xcolumn=get(handles.XObject,'String');
-Ycolumn=get(handles.YObject,'String');
-if ischar(Xcolumn)
-    sizchar=size(Xcolumn);
-    for icol=1:sizchar(1)
-        Xcolumn_cell{icol}=Xcolumn(icol,:);
-    end
-    Xcolumn=Xcolumn_cell;
-end
-if ischar(Ycolumn)
-    sizchar=size(Ycolumn);
-    for icol=1:sizchar(1)
-        Ycolumn_cell{icol}=Ycolumn(icol,:);
-    end
-    Ycolumn=Ycolumn_cell;
-end
-Zcolumn={};%default
-if isequal(get(handles.ZObject,'Visible'),'on')
-    data.NbDim=3; %test 3D object
-    Zcolumn=get(handles.ZObject,'String');
-    if ischar(Zcolumn)
-        Zcolumn={Zcolumn};
-    end
-end
-nb_points=min(length(Xcolumn),length(Ycolumn));%number of point positions needed to define the object position
-if isequal (data.Style,'line');
-    nb_defining_points=2;
-elseif isequal(data.Style,'plane')|isequal(data.Style,'rectangle')|isequal(data.Style,'ellipse')
-    nb_defining_points=1;
-else
-    nb_defining_points=nb_points;
-end
-data_XObject=[];
-data_YObject=[];
-data_ZObject=[];
-for i=1:nb_points
-    Xnumber=str2num(Xcolumn{i});
-    Ynumber=str2num(Ycolumn{i});
-    if isempty(Xnumber)|isempty(Ynumber)
-        break
-    else
-        data_XObject=[data_XObject; Xnumber(1)];
-        data_YObject=[data_YObject; Ynumber(1)];
-    end
-    if length(Zcolumn)<i | isempty(str2num(Zcolumn{i}))
-        data_ZObject=[data_ZObject; 0];
-    else
-        data_ZObject=[data_ZObject; str2num(Zcolumn{i})];
-    end
-end
-if nb_defining_points > nb_points
-    for i=nb_points+1:nb_defining_points
-        data_XObject=[0;data_XObject];
-        data_YObject=[0;data_YObject];
-        data_ZObject=[0;data_ZObject];
-    end
-end
-if isempty(data_XObject)
-    data_XObject=0;
-end
-if isempty(data_YObject)
-    data_YObject=0;
-end
-if isempty(data_ZObject)
-    data_ZObject=0;
-end
-data.Coord=[data_XObject data_YObject data_ZObject];
-
-set(handles.XObject,'String',mat2cell(data_XObject,length(data_XObject)))%correct the interface display
-set(handles.YObject,'String',mat2cell(data_YObject,length(data_XObject)))
-set(handles.ZObject,'String',mat2cell(data_ZObject,length(data_XObject)))
-
-
+% %Euler angles and projection ranges
+% if isfield(data,'Angle_x')
+%     data.Angle(1)=data.Angle_x;
+%     data=rmfield(data,'Angle_x');
+% end
+% if isfield(data,'Angle_y')
+%     data.Angle(2)=data.Angle_y;
+%     data=rmfield(data,'Angle_y');
+% end
+% if isfield(data,'Angle_z')
+%     data.Angle(3)=data.Angle_z;
+%     data=rmfield(data,'Angle_z');
+% end
+% % ranges of projection
+% data.RangeZ=[];
+% data.RangeY=[];
+% data.RangeX=[];
+% if isfield(data,'ZMin')&& ~isempty(data.ZMin)
+%     data.RangeZ=data.ZMin;
+%     data=rmfield(data,'ZMin');
+% end
+% if isfield(data,'ZMax')&& ~isempty(data.ZMax)
+%     data.RangeZ=[data.RangeZ data.ZMax];
+%     data=rmfield(data,'ZMax');
+% end
+% if isfield(data,'YMin')&& ~isempty(data.YMin)
+%     data.RangeY=data.YMin;
+%     data=rmfield(data,'YMin');
+% end
+% if isfield(data,'YMax')&& ~isempty(data.YMax)
+%     data.RangeY=[data.RangeY data.YMax];
+%     data=rmfield(data,'YMax');
+% end
+% if isfield(data,'XMin')&& ~isempty(data.XMin)
+%     data.RangeX=data.XMin;
+%     data=rmfield(data,'XMin');
+% end
+% if isfield(data,'XMax')&& ~isempty(data.XMax)
+%     data.RangeX=[data.RangeX data.XMax];
+%     data=rmfield(data,'XMax');
+% end
+% 
+% 
+% 
+% 
Index: /trunk/src/set_object.m
===================================================================
--- /trunk/src/set_object.m	(revision 378)
+++ /trunk/src/set_object.m	(revision 379)
@@ -12,5 +12,5 @@
 %    .ProjMode
 %    .CoordType: 'phys' or 'px'
-%    .DX,.DY,.DZ : mesh along each dirction
+%    .num_DX,.num_DY,.num_DZ : mesh along each dirction
 %    .RangeX, RangeY
 %    .Coord(j,i), i=1, 2, 3,  components x, y, z of j=1...n position(s) characterizing the object components
@@ -36,5 +36,5 @@
 function varargout = set_object(varargin)
 
-% Last Modified by GUIDE v2.5 24-Nov-2008 14:29:06
+% Last Modified by GUIDE v2.5 26-Jan-2012 22:00:47
 
 % Begin initialization code - DO NOT PLOT
@@ -65,6 +65,6 @@
 %        if=0; no associated object (used for series), the button 'PLOT' is  then unvisible
 %'data': read from an existing object selected in the interface
-%      .TITLE : class of object ('POINTS','LINE',....)
-%      .DX,DY,DZ; meshes for regular grids
+%      .Name : class of object ('POINTS','LINE',....)
+%      .num_DX,num_DY,num_DZ; meshes for regular grids
 %      .Coord: object position coordinates
 %      .ParentButton: handle of the uicontrol object calling the interface
@@ -92,89 +92,82 @@
         enable_plot=data.enable_plot;%test to desable button PLOT (display mode)
     end
-    if isfield(data,'Name')
-        set(handles.TITLE,'String',data.Name)
-    end
-    if ~isfield(data,'NbDim')||~isequal(data.NbDim,3)%2D case
-        set(handles.ZObject,'Visible','off')
+    if isfield(data,'Coord') &&size(data.Coord,2)==3
+        set(handles.z_slider,'Visible','on')
+    else
         set(handles.z_slider,'Visible','off')
-    else
-        set(handles.ZObject,'Visible','on')
-        set(handles.z_slider,'Visible','on')
-        if isfield(data,'Coord') && size(data.Coord,2)==3
-            set(handles.ZObject,'String',num2str(data.Coord(1,3),4))
-        end
-    end
-    if isfield(data,'StyleMenu')
-        set(handles.ObjectStyle,'String',data.StyleMenu);
-    end
-    if isfield(data,'Style')
-        menu=get(handles.ObjectStyle,'String');
-        for iline=1:length(menu)
-            if isequal(menu{iline},data.Style)
-                set(handles.ObjectStyle,'Value',iline)
-                break
-            end
-        end
-    end
-    ObjectStyle_Callback(hObject, eventdata, handles)
-    if isfield(data,'ProjMenu')
-        set(handles.ProjMode,'String',data.ProjMenu);%overset the standard menu
-    end
-    if isfield(data,'ProjMode')
-        menu=get(handles.ProjMode,'String');
-        for iline=1:length(menu)
-            if isequal(menu{iline},data.ProjMode)
-                set(handles.ProjMode,'Value',iline)
-                break
-            end
-        end
-    end
-    ProjMode_Callback(hObject, eventdata, handles)
-    if isfield(data,'Coord')
-        if ischar(data.Coord)
-            data.Coord=str2num(data.Coord);
-        elseif iscell(data.Coord)
-            CoordCell=data.Coord;
-            data.Coord=zeros(numel(CoordCell),3);
-            data.Coord(:,3)=zeros(numel(CoordCell),1); % z component set to 0 by default
-            for iline=1:numel(CoordCell)
-                line_vec=str2num(CoordCell{iline});
-                if numel(line_vec)==2
-                    data.Coord(iline,1:2)=str2num(CoordCell{iline});
-                else
-                    data.Coord(iline,:)=str2num(CoordCell{iline});
-                end
-            end
-        end
-        if size(data.Coord,2)>=2
-            sizcoord=size(data.Coord);
-            for i=1:sizcoord(1)
-                XObject{i}=num2str(data.Coord(i,1),4);
-                YObject{i}=num2str(data.Coord(i,2),4);
-            end
-            set(handles.XObject,'String',XObject)
-            set(handles.YObject,'String',YObject)
-            if sizcoord(2)>3
-                for i=1:sizcoord(1)
-                    ZObject{i}=num2str(data.Coord(i,3),4);
-                end
-                set(handles.ZObject,'String',ZObject)
-            end
-        end
-    end
-    if isfield(data,'DX')
-        if ~ischar(handles.DX)
-            data.DX=num2str(data.DX,3);
-        end
-        set(handles.DX,'String',data.DX)
-    end
-    if isfield(data,'DY')
-        if ~ischar(handles.DY)
-            data.DY=num2str(data.DY,3);
-        end
-        set(handles.DY,'String',data.DX)
-    end
+    end
+    errormsg=fill_GUI(data,handles);
+%     if isfield(data,'StyleMenu')
+%         set(handles.Type,'String',data.StyleMenu);
+%     end
+%     if isfield(data,'Type')
+%         menu=get(handles.Type,'String');
+%         for iline=1:length(menu)
+%             if isequal(menu{iline},data.Style)
+%                 set(handles.Type,'Value',iline)
+%                 break
+%             end
+%         end
+%     end
+    Type_Callback(hObject, eventdata, handles)
+%     if isfield(data,'ProjMenu')
+%         set(handles.ProjMode,'String',data.ProjMenu);%overset the standard menu
+%     end
+%     if isfield(data,'ProjMode')
+%         menu=get(handles.ProjMode,'String');
+%         for iline=1:length(menu)
+%             if isequal(menu{iline},data.ProjMode)
+%                 set(handles.ProjMode,'Value',iline)
+%                 break
+%             end
+%         end
+%     end
+%    ProjMode_Callback(hObject, eventdata, handles)
+%     if isfield(data,'Coord')
+%         if ischar(data.Coord)
+%             data.Coord=str2num(data.Coord);
+%         elseif iscell(data.Coord)
+%             CoordCell=data.Coord;
+%             data.Coord=zeros(numel(CoordCell),3);
+%             data.Coord(:,3)=zeros(numel(CoordCell),1); % z component set to 0 by default
+%             for iline=1:numel(CoordCell)
+%                 line_vec=str2num(CoordCell{iline});
+%                 if numel(line_vec)==2
+%                     data.Coord(iline,1:2)=str2num(CoordCell{iline});
+%                 else
+%                     data.Coord(iline,:)=str2num(CoordCell{iline});
+%                 end
+%             end
+%         end
+%         if size(data.Coord,2)>=2
+%             sizcoord=size(data.Coord);
+%             for i=1:sizcoord(1)
+%                 XObject{i}=num2str(data.Coord(i,1),4);
+%                 YObject{i}=num2str(data.Coord(i,2),4);
+%             end
+% %             set(handles.XObject,'String',XObject)
+% %             set(handles.YObject,'String',YObject)
+%             if sizcoord(2)>3
+%                 for i=1:sizcoord(1)
+%                     ZObject{i}=num2str(data.Coord(i,3),4);
+%                 end
+%                 set(handles.ZObject,'String',ZObject)
+%             end
+%         end
+%     end
+%     if isfield(data,'DX')
+%         if ~ischar(handles.num_DX)
+%             data.DX=num2str(data.DX,3);
+%         end
+%         set(handles.num_DX,'String',data.DX)
+%     end
+%     if isfield(data,'DY')
+%         if ~ischar(handles.num_DY)
+%             data.DY=num2str(data.DY,3);
+%         end
+%         set(handles.num_DY,'String',data.DX)
+%     end
     if isfield(data,'RangeZ') && length(ZBounds) >= 2
-        set(handles.ZMax,'String',num2str(max(data.RangeZ),3))
+        set(handles.num_RangeZ_2,'String',num2str(max(data.RangeZ),3))
         DZ=max(data.RangeZ);%slider step
         if ~isnan(ZBounds(1)) && ZBounds(2)~=ZBounds(1)
@@ -192,6 +185,6 @@
             data.RangeX=str2num(data.RangeX);
         end
-        set(handles.XMax,'String',num2str(max(data.RangeX),3))
-        set(handles.XMin,'String',num2str(min(data.RangeX),3))
+        set(handles.num_RangeX_2,'String',num2str(max(data.RangeX),3))
+        set(handles.num_RangeX_1,'String',num2str(min(data.RangeX),3))
     end
     if isfield(data,'RangeY')
@@ -199,6 +192,6 @@
             data.RangeY=str2num(data.RangeY);
         end
-        set(handles.YMax,'String',num2str(max(data.RangeY),3))
-        set(handles.YMin,'String',num2str(min(data.RangeY),3))
+        set(handles.num_RangeY_2,'String',num2str(max(data.RangeY),3))
+        set(handles.num_RangeY_1,'String',num2str(min(data.RangeY),3))
     end
     if isfield(data,'RangeZ')
@@ -206,23 +199,23 @@
             data.RangeZ=str2num(data.RangeZ);
         end
-        set(handles.ZMax,'String',num2str(max(data.RangeZ),3))
+        set(handles.num_RangeZ_2,'String',num2str(max(data.RangeZ),3))
         if numel(data.RangeZ)>=2
-            set(handles.ZMin,'String',num2str(min(data.RangeZ),3))
+            set(handles.num_RangeZ_1,'String',num2str(min(data.RangeZ),3))
         end
     end  
     if isfield(data,'Angle') && isequal(numel(data.Angle),3)
-         set(handles.Phi,'String',num2str(data.Angle(1)))
-         set(handles.Theta,'String',num2str(data.Angle(2)))
-         set(handles.Psi,'String',num2str(data.Angle(3)))
-    end
-    if isfield(data,'DZ')
-        if ~ischar(handles.DZ)
-            data.DY=num2str(data.DZ,3);
-        end
-        set(handles.DZ,'String',data.DZ)
-    end
-    if isfield(data,'CoordUnit')
-        set(handles.CoordUnit,'String',data.CoordUnit)
-    end
+         set(handles.num_Angle_1,'String',num2str(data.Angle(1)))
+         set(handles.num_Angle_2,'String',num2str(data.Angle(2)))
+         set(handles.num_Angle_3,'String',num2str(data.Angle(3)))
+    end
+%     if isfield(data,'DZ')
+%         if ~ischar(handles.num_DZ)
+%             data.DY=num2str(data.DZ,3);
+%         end
+%         set(handles.num_DZ,'String',data.DZ)
+%     end
+%     if isfield(data,'CoordUnit')
+%         set(handles.CoordUnit,'String',data.CoordUnit)
+%     end
 end
 if enable_plot
@@ -241,4 +234,5 @@
 end
 
+
 %------------------------------------------------------------------------
 % --- Outputs from this function are returned to the command line.
@@ -250,60 +244,82 @@
 
 %------------------------------------------------------------------------
-% --- Executes on selection change in ObjectStyle.
-function ObjectStyle_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-style_prev=get(handles.ObjectStyle,'UserData');%previous object style
-str=get(handles.ObjectStyle,'String');
-val=get(handles.ObjectStyle,'Value');
-style=str{val};
+% --- Executes on selection change in Type.
+function Type_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+%style_prev=get(handles.Type,'UserData');%previous object style
+ListType=get(handles.Type,'String');
+Type=ListType{get(handles.Type,'Value')};
 % make correspondance between different object styles
-Xcolumn=get(handles.XObject,'String');
-Ycolumn=get(handles.YObject,'String');
-if ischar(Xcolumn)
-    sizchar=size(Xcolumn);
-    for icol=1:sizchar(1)
-        Xcolumn_cell{icol}=Xcolumn(icol,:);
-    end
-    Xcolumn=Xcolumn_cell;
-end
-if ischar(Ycolumn)
-    sizchar=size(Ycolumn);
-    for icol=1:sizchar(1)
-        Ycolumn_cell{icol}=Ycolumn(icol,:);
-    end
-    Ycolumn=Ycolumn_cell;
-end
-Zcolumn={};%default
-z_new={};
-if isequal(get(handles.ZObject,'Visible'),'on')
-    %data.NbDim=3; %test 3D object
-    Zcolumn=get(handles.ZObject,'String');
-    if ischar(Zcolumn)
-        Zcolumn={Zcolumn};
-    end
-end
-x_new{1}=Xcolumn{1};
-y_new{1}=Ycolumn{1};
-if ~isempty(Zcolumn)
-    z_new{1}=Zcolumn{1};
-end
-if isequal(style,'line')
-    if strcmp(style_prev,'rectangle')||strcmp(style_prev,'ellipse')
-        XMax=get(handles.XMax,'String');
-        YMax=get(handles.YMax,'String');
-        x_new{2}=num2str(XMax,4);
-        y_new{2}=num2str(YMax,4);
-        set(handles.XObject,'String',x_new)
-        set(handles.YObject,'String',y_new)
-        set(handles.ZObject,'String',z_new)
-    end
-elseif isequal(style,'polyline')
-elseif strcmp(style,'rectangle')|| strcmp(style,'ellipse')
-     set(handles.XObject,'String',x_new)
-     set(handles.YObject,'String',y_new)
-     set(handles.ZObject,'String',z_new)
-end
-
-switch style
+Coord=get(handles.Coord,'Data');
+% 
+% Xcolumn=get(handles.XObject,'String');
+% Ycolumn=get(handles.YObject,'String');
+% if ischar(Xcolumn)
+%     sizchar=size(Xcolumn);
+%     for icol=1:sizchar(1)
+%         Xcolumn_cell{icol}=Xcolumn(icol,:);
+%     end
+%     Xcolumn=Xcolumn_cell;
+% end
+% if ischar(Ycolumn)
+%     sizchar=size(Ycolumn);
+%     for icol=1:sizchar(1)
+%         Ycolumn_cell{icol}=Ycolumn(icol,:);
+%     end
+%     Ycolumn=Ycolumn_cell;
+% end
+% Zcolumn={};%default
+% z_new={};
+% if isequal(get(handles.ZObject,'Visible'),'on')
+%     %data.NbDim=3; %test 3D object
+%     Zcolumn=get(handles.ZObject,'String');
+%     if ischar(Zcolumn)
+%         Zcolumn={Zcolumn};
+%     end
+% end
+% x_new{1}=Xcolumn{1};
+% y_new{1}=Ycolumn{1};
+% x_new{1}=Coord(1,1);
+% y_new{1}=Coord(1,2);
+% z_new{1}=Coord(1,3);
+% if ~isempty(Zcolumn)
+%     z_new{1}=Zcolumn{1};
+% end
+% if isequal(style,'line')
+%     if strcmp(style_prev,'rectangle')||strcmp(style_prev,'ellipse')
+%         num_RangeX_2=get(handles.num_RangeX_2,'String');
+%         num_RangeY_2=get(handles.num_RangeY_2,'String');
+%         x_new{2}=num2str(num_RangeX_2,4);
+%         y_new{2}=num2str(num_RangeY_2,4);
+%         set(handles.XObject,'String',x_new)
+%         set(handles.YObject,'String',y_new)
+%         set(handles.ZObject,'String',z_new)
+%     end
+% elseif isequal(style,'polyline')
+% elseif strcmp(style,'rectangle')|| strcmp(style,'ellipse')
+%      set(handles.XObject,'String',x_new)
+%      set(handles.YObject,'String',y_new)
+%      set(handles.ZObject,'String',z_new)
+% end
+
+%% set the number of lines in the Coord table depending on object type
+switch Type
+    case{'line'}
+        if size(Coord,1)<2
+            if isequal(size(Coord,2),3)
+                Coord=[Coord; 0 0 0];%add a line for edition (3D case)
+            else
+                Coord=[Coord; 0 0]; %add a line for edition (2D case)
+            end
+        else
+            Coord=Coord(1:2,:);
+        end
+    case{'rectangle','ellipse','plane','volume'}
+        Coord=Coord(1,:);
+end
+set(handles.Coord,'Data',Coord)
+
+%% set the projection menu and the corresponding options
+switch Type
     case {'points','line','polyline','plane'}
         menu_proj={'projection';'interp';'filter';'none'}; 
@@ -312,4 +328,6 @@
     case 'volume'
         menu_proj={'interp';'none'};
+    otherwise
+        menu_proj={'projection';'interp';'filter';'none'};%default
 end   
 proj_index=get(handles.ProjMode,'Value');
@@ -319,8 +337,9 @@
 set(handles.ProjMode,'String',menu_proj)
 ProjMode_Callback(hObject, eventdata, handles)
+
 %store the current option
-str=get(handles.ObjectStyle,'String');
-val=get(handles.ObjectStyle,'Value');
-set(handles.ObjectStyle,'UserData',style)
+% str=get(handles.Type,'String');
+% val=get(handles.Type,'Value');
+% set(handles.Type,'UserData',style)
 
 %------------------------------------------------------------------------
@@ -341,113 +360,114 @@
 value=get(handles.ProjMode,'Value');
 ProjMode=menu{value};
-menu=get(handles.ObjectStyle,'String');
-value=get(handles.ObjectStyle,'Value');
+menu=get(handles.Type,'String');
+value=get(handles.Type,'Value');
 ObjectStyle=menu{value};
-test3D=isequal(get(handles.ZObject,'Visible'),'on');%3D case
-
+%%%%%%%%% TODO
+test3D=0; %TODO: update  test3D=isequal(get(handles.ZObject,'Visible'),'on');%3D case
+%%%%%%%%%
 %default setting
-set(handles.Phi,'Visible','off')
-set(handles.Theta,'Visible','off')
-set(handles.Psi,'Visible','off')
-set(handles.XMin,'Visible','off')
-set(handles.XMax,'Visible','off')
-set(handles.YMin,'Visible','off')
+set(handles.num_Angle_1,'Visible','off')
+set(handles.num_Angle_2,'Visible','off')
+set(handles.num_Angle_3,'Visible','off')
+set(handles.num_RangeX_1,'Visible','off')
+set(handles.num_RangeX_2,'Visible','off')
+set(handles.num_RangeY_1,'Visible','off')
 if isequal(ProjMode,'interp')
-    set(handles.YMax,'Visible','off')
-else
-    set(handles.YMax,'Visible','on')
+    set(handles.num_RangeY_2,'Visible','off')
+else
+    set(handles.num_RangeY_2,'Visible','on')
 end
 if strcmp(ObjectStyle,'rectangle')||strcmp(ObjectStyle,'ellipse')
-    set(handles.XMax,'Visible','on')
-else
-   set(handles.XMax,'Visible','off')
-end
-set(handles.ZMin,'Visible','off')
-set(handles.ZMax,'Visible','off')
-set(handles.DX,'Visible','off')
-set(handles.DY,'Visible','off')
-set(handles.DZ,'Visible','off')
+    set(handles.num_RangeX_2,'Visible','on')
+else
+   set(handles.num_RangeX_2,'Visible','off')
+end
+set(handles.num_RangeZ_1,'Visible','off')
+set(handles.num_RangeZ_2,'Visible','off')
+set(handles.num_DX,'Visible','off')
+set(handles.num_DY,'Visible','off')
+set(handles.num_DZ,'Visible','off')
 
 switch ObjectStyle
     case 'points'
-        set(handles.YMax,'TooltipString','YMax: range of averaging around each point') 
-        set(handles.XObject,'TooltipString','XObject: set of x coordinates of the points')
-        set(handles.YObject,'TooltipString','YObject: set of y coordinates of the points')
-        set(handles.ZObject,'TooltipString','ZObject: set of z coordinates of the points')
+        set(handles.num_RangeY_2,'TooltipString','num_YMax: range of projection around each point') 
+%         set(handles.XObject,'TooltipString','XObject: set of x coordinates of the points')
+%         set(handles.YObject,'TooltipString','YObject: set of y coordinates of the points')
+%         set(handles.ZObject,'TooltipString','ZObject: set of z coordinates of the points')
     case {'line','polyline','polygon'}
-        set(handles.YMax,'TooltipString','YMax: range of averaging around the line')
-        set(handles.XObject,'TooltipString','XObject: set of x coordinates defining the line')
-        set(handles.YObject,'TooltipString','YObject: set of y coordinates defining the line')
-        set(handles.ZObject,'TooltipString','ZObject: set of z coordinates defining the line')
+        set(handles.num_RangeY_2,'TooltipString','num_YMax: range of projection around the line')
+         set(handles.Coord,'TooltipString','Coord: table of x,y, z coordinates defining the line')
+%         set(handles.YObject,'TooltipString','YObject: set of y coordinates defining the line')
+%         set(handles.ZObject,'TooltipString','ZObject: set of z coordinates defining the line')
         if isequal(ProjMode,'interp')|| isequal(ProjMode,'filter')
-            set(handles.DX,'Visible','on')
-            set(handles.DX,'TooltipString','DX: mesh for the interpolated field along the line')
+            set(handles.num_DX,'Visible','on')
+            set(handles.num_DX,'TooltipString','num_DX: mesh for the interpolated field along the line')
         end       
     case {'rectangle','ellipse'}
-        set(handles.XMax,'TooltipString',['XMax: half length of the ' ObjectStyle])
-        set(handles.YMax,'TooltipString',['YMax: half width of the ' ObjectStyle])
-        set(handles.XObject,'TooltipString',['XObject:  x coordinate of the ' ObjectStyle ' centre'])
-        set(handles.YObject,'TooltipString',['YObject:  y coordinate of the ' ObjectStyle ' centre'])
+        set(handles.num_RangeX_2,'TooltipString',['num_XMax: half length of the ' ObjectStyle])
+        set(handles.num_RangeY_2,'TooltipString',['num_YMax: half width of the ' ObjectStyle])
+%         set(handles.XObject,'TooltipString',['XObject:  x coordinate of the ' Type ' centre'])
+%         set(handles.YObject,'TooltipString',['YObject:  y coordinate of the ' Type ' centre'])
     case {'plane'}  
-        set(handles.Psi,'Visible','on')
-        set(handles.XMin,'Visible','on')
-        set(handles.XMax,'Visible','on')
-        set(handles.YMin,'Visible','on')
-        set(handles.YMax,'Visible','on')
+        set(handles.num_Angle_3,'Visible','on')
+        set(handles.num_RangeX_1,'Visible','on')
+        set(handles.num_RangeX_2,'Visible','on')
+        set(handles.num_RangeY_1,'Visible','on')
+        set(handles.num_RangeY_2,'Visible','on')
+%         set(handles.XObject,'TooltipString',['XObject:  x coordinate of the axis origin for the ' Type])
+%         set(handles.YObject,'TooltipString',['YObject:  y coordinate of the axis origin for the ' Type])
+        set(handles.num_RangeZ_2,'TooltipString','num_ZMax: range of projection normal to the plane')
+        if test3D
+            set(handles.num_Angle_2,'Visible','on')
+            set(handles.num_Angle_1,'Visible','on')
+            set(handles.num_RangeZ_2,'Visible','on')
+        end
+        if isequal(ProjMode,'interp')|| isequal(ProjMode,'filter')
+            set(handles.num_DX,'Visible','on')
+            set(handles.num_DY,'Visible','on')
+        else
+            set(handles.num_DX,'Visible','off')
+            set(handles.num_DY,'Visible','off')
+        end
+        if  isequal(ProjMode,'interp')
+            set(handles.num_DZ,'Visible','on')  
+        end
+     case {'volume'}  
+        set(handles.num_RangeX_1,'Visible','on')
+        set(handles.num_RangeX_2,'Visible','on')
+        set(handles.num_RangeY_1,'Visible','on')
+        set(handles.num_RangeY_2,'Visible','on')
         set(handles.XObject,'TooltipString',['XObject:  x coordinate of the axis origin for the ' ObjectStyle])
         set(handles.YObject,'TooltipString',['YObject:  y coordinate of the axis origin for the ' ObjectStyle])
-        set(handles.ZMax,'TooltipString','ZMax: range of projection normal to the plane')
-        if test3D
-            set(handles.Theta,'Visible','on')
-            set(handles.Phi,'Visible','on')
-            set(handles.ZMax,'Visible','on')
-        end
+        set(handles.num_Angle_1,'Visible','on')
+        set(handles.num_Angle_2,'Visible','on')
+        set(handles.num_Angle_3,'Visible','on')
+        set(handles.num_RangeZ_1,'Visible','on')
+        set(handles.num_RangeZ_2,'Visible','on')
         if isequal(ProjMode,'interp')|| isequal(ProjMode,'filter')
-            set(handles.DX,'Visible','on')
-            set(handles.DY,'Visible','on')
+            set(handles.num_DX,'Visible','on')
+            set(handles.num_DY,'Visible','on')
+            set(handles.num_DZ,'Visible','on')
         else
-            set(handles.DX,'Visible','off')
-            set(handles.DY,'Visible','off')
-        end
-        if  isequal(ProjMode,'interp')
-            set(handles.DZ,'Visible','on')  
-        end
-     case {'volume'}  
-        set(handles.XMin,'Visible','on')
-        set(handles.XMax,'Visible','on')
-        set(handles.YMin,'Visible','on')
-        set(handles.YMax,'Visible','on')
-        set(handles.XObject,'TooltipString',['XObject:  x coordinate of the axis origin for the ' ObjectStyle])
-        set(handles.YObject,'TooltipString',['YObject:  y coordinate of the axis origin for the ' ObjectStyle])
-        set(handles.Phi,'Visible','on')
-        set(handles.Theta,'Visible','on')
-        set(handles.Psi,'Visible','on')
-        set(handles.ZMin,'Visible','on')
-        set(handles.ZMax,'Visible','on')
-        if isequal(ProjMode,'interp')|| isequal(ProjMode,'filter')
-            set(handles.DX,'Visible','on')
-            set(handles.DY,'Visible','on')
-            set(handles.DZ,'Visible','on')
-        else
-            set(handles.DX,'Visible','off')
-            set(handles.DY,'Visible','off')
-            set(handles.DZ,'Visible','off')
-        end
-end
-%------------------------------------------------------------------------
-
-%------------------------------------------------------------------------
-function Phi_Callback(hObject, eventdata, handles)
+            set(handles.num_DX,'Visible','off')
+            set(handles.num_DY,'Visible','off')
+            set(handles.num_DZ,'Visible','off')
+        end
+end
+%------------------------------------------------------------------------
+
+%------------------------------------------------------------------------
+function num_Angle_1_Callback(hObject, eventdata, handles)
 update_slider(hObject, eventdata,handles)
 %------------------------------------------------------------------------
 %------------------------------------------------------------------------
-function Theta_Callback(hObject, eventdata, handles)
+function num_Angle_2_Callback(hObject, eventdata, handles)
 update_slider(hObject, eventdata,handles)
 %------------------------------------------------------------------------
 function update_slider(hObject, eventdata,handles)
 %rotation angles
-PlaneAngle(1)=str2num(get(handles.Phi,'String'));%first  angle in degrees
-PlaneAngle(2)=str2num(get(handles.Theta,'String'));%second  angle in degrees
-PlaneAngle(3)=str2num(get(handles.Psi,'String'));%second  angle in degrees
+PlaneAngle(1)=str2num(get(handles.num_Angle_1,'String'));%first  angle in degrees
+PlaneAngle(2)=str2num(get(handles.num_Angle_2,'String'));%second  angle in degrees
+PlaneAngle(3)=str2num(get(handles.num_Angle_3,'String'));%second  angle in degrees
 om=norm(PlaneAngle);%norm of rotation angle in radians
 OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
@@ -468,182 +488,14 @@
 end
 %------------------------------------------------------------------------
-function DX_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-%------------------------------------------------------------------------
-function DY_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-%------------------------------------------------------------------------
-function DZ_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-
-%------------------------------------------------------------------------
-%-----------------------------------------------------
-% --- Executes on button press in OPEN: DESACTIVATED use uvmat browser
-function OPEN_Callback(hObject, eventdata, handles)
-%get the object file 
-oldfile=' ';
-huvmat=findobj('Tag','uvmat');
-hchild=get(huvmat,'Children');
-hrootpath=findobj(hchild,'Tag','RootPath');
-if ~isempty(hrootpath)
-    oldfile=get(hrootpath,'String');
-    if iscell(oldfile)
-        oldfile=oldfile{1};
-    end
-end
-[FileName, PathName, filterindex] = uigetfile( ...
-       {'*.xml;*.mat', ' (*.xml,*.mat)';
-       '*.xml',  '.xml files '; ...
-        '*.mat',  '.mat matlab files '}, ...
-        'Pick a file',oldfile);
-fileinput=[PathName FileName];%complete file name 
-testblank=findstr(fileinput,' ');%look for blanks
-if ~isempty(testblank)
-    msgbox_uvmat('ERROR','forbidden input file name: contain blanks')
-    return
-end
-sizf=size(fileinput);
-if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end
-
-%read the file
- t=xmltree(fileinput);
- s=convert(t);
- if ~isfield(s,'Style')
-     s.Style='points';
- end
- if ~isfield(s,'ProjMode')
-     s.ProjMode='none';
- end
-teststyle=0;
-
-switch s.Style
-    case {'points','line','polyline','plane'}
-        menu_proj={'projection';'interp';'filter';'none'}; 
-    case {'polygon','rectangle','ellipse'}
-        menu_proj={'inside';'outside';'mask_inside';'mask_outside'};
-    case 'volume'
-        menu_proj={'none'};
-end
-set(handles.ObjectStyle,'String',menu_proj)
-menu=get(handles.ObjectStyle,'String');
-for iline=1:length(menu)
-    if isequal(menu{iline},s.Style)
-        set(handles.ObjectStyle,'Value',iline)
-        teststyle=1;
-        break
-    end
-end
-testmode=0;
-%menu=get(handles.ProjMode,'String');
-for iline=1:length(menu_proj)
-    if isequal(menu_proj{iline},s.ProjMode)
-        set(handles.ProjMode,'Value',iline)
-        testmode=1;
-        break
-    end
-end
-
-ProjMode_Callback(hObject, eventdata, handles);%visualize the appropriate edit boxes
-if isfield(s,'XMax')
-    set(handles.XMax,'String',s.XMax)
-end
-if isfield(s,'XMin')
-    set(handles.XMin,'String',s.XMin)
-end
-if isfield(s,'YMax')
-    set(handles.YMax,'String',s.YMax)
-end
-if isfield(s,'YMin')
-    set(handles.YMin,'String',s.YMin)
-end
-Range=0;
-if isfield(s,'Range')
-    if ischar(s.Range)
-        Range=str2num(s.Range);
-    else
-        Range(1,:)=str2num(s.Range{1});
-        Range(2,:)=str2num(s.Range{2});
-    end
-end
-if size(Range,2)>=3
-    if size(Range,1)>=2
-       set(handles.ZMin,'String',num2str(Range(2,3),3))
-    end
-    if size(Range,1)>=2
-       set(handles.ZMax,'String',num2str(Range(1,3),3))
-    end
-end
-if size(Range,2)>=2
-    if size(Range,1)>=2
-       set(handles.YMin,'String',num2str(Range(2,2),3))
-    end
-    if size(Range,1)>=2
-       set(handles.YMax,'String',num2str(Range(1,2),3))
-    end
-end
-if size(Range,2)>=1
-    if size(Range,1)>=2
-       set(handles.XMin,'String',num2str(Range(2,1),3))
-    end
-    if size(Range,1)>=2
-       set(handles.XMax,'String',num2str(Range(1,1),3))
-    end
-end
-if isfield(s,'RangeX') & ischar(s.RangeX)
-     RangeX=str2num(s.RangeX);
-    set(handles.XMax,'String',num2str(max(RangeX),3))
-    set(handles.XMin,'String',num2str(min(RangeX),3))
-end
-
-if isfield(s,'RangeY')
-    if ischar(s.RangeY)
-        RangeY=str2num(s.RangeY);
-        set(handles.YMax,'String',num2str(max(RangeY),3))
-        set(handles.YMin,'String',num2str(min(RangeY),3))
-    end
-end
-if isfield(s,'RangeZ')
-    if ischar(s.RangeZ)
-        RangeZ=str2num(s.RangeZ);
-        set(handles.ZMax,'String',num2str(max(RangeZ),3))
-        set(handles.ZMin,'String',num2str(min(RangeZ),3))
-    end
-end
-if isfield(s,'Phi')
-    set(handles.Psi,'String',s.Phi)%old definition
-end
-if isfield(s,'Angle')&& isequal(numel(s.Angle),3)
-    set(handles.Phi,'String',s.Angle(1))
-    set(handles.Theta,'String',s.Angle(2))
-    set(handles.Psi,'String',s.Angle(3))
-end
-% if isfield(s,'Psi')
-%     set(handles.Psi,'String',s.Psi)
-% end
-
-if isfield(s,'DX')
-    set(handles.DX,'String',s.DX)
-end
-if isfield(s,'DY')
-    set(handles.DY,'String',s.DY)
-end
-if ~isfield(s,'Coord')
-    XObject='0';%default
-    YObject='0';
-elseif ischar(s.Coord)
-    line=str2num(s.Coord);
-    XObject=num2str(line(1),4);
-    YObject=num2str(line(2),4);
-else
-    for i=1:length(s.Coord)
-        line=str2num(s.Coord{i});
-        XObject{i}=num2str(line(1),4);
-        YObject{i}=num2str(line(2),4);
-    end
-end
-set(handles.XObject,'String',XObject)
-set(handles.YObject,'String',YObject)
-
-%METTRA A JOUR ASPECT DE L'INTERFACE (COMME set_object_Opening
+function num_DX_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+%------------------------------------------------------------------------
+function num_DY_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+%------------------------------------------------------------------------
+function num_DZ_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+
+%------------------------------------------------------------------------
 %------------------------------------------------------------------------
 %----------------------------------------------------
@@ -675,14 +527,15 @@
 
 %% read the object on the GUI set_object
-ObjectData=read_set_object(handles);%read the input parameters defining the object in the GUI set_object
-ObjectName=get(handles.TITLE,'String');%name of the current object defiend in set_object
+%ObjectData=read_set_object(handles.set_object);%read the input parameters defining the object in the GUI set_object
+ObjectData=read_GUI(handles.set_object);%read the input parameters defining the object in the GUI set_object
+%ObjectData.Coord=cell2mat(ObjectData.Coord);
+ObjectName=ObjectData.Name;%name of the current object defiend in set_object
 if isempty(ObjectName)
     if get(hhuvmat.edit_object,'Value')% edit mode
         ObjectName=ListObject{IndexObj(end)};%take the name of the last (second) selected item
     else %new object
-        StyleList=get(handles.ObjectStyle,'String');
-        StyleVal=get(handles.ObjectStyle,'Value');
+        StyleList=get(handles.Type,'String');
+        StyleVal=get(handles.Type,'Value');
         ObjectName=StyleList{StyleVal};
-        %ObjectName=[num2str(numel(ListObject)+1) '-' StyleList{StyleVal}];% take the object style as default name
     end
 end
@@ -705,6 +558,5 @@
     end
     ObjectName=ObjectNameNew;
-%     ObjectName=[num2str(IndexObj(end)) '-' ObjectData.Style];%default name
-    set(handles.TITLE,'String',ObjectName)% display the default name in set_object
+    set(handles.Name,'String',ObjectName)% display the default name in set_object
     IndexObj(2)=numel(ListObject)+1;% append an object to the list in uvmat
     set(hhuvmat.ListObject,'String',[ListObject;{ObjectName}]);%complement the object list
@@ -712,17 +564,7 @@
     UvData.Object{IndexObj(2)}=[];%initiate a new object (empty yet)
 end
-% IndexObj_1=IndexObj(1);
-% % if isequal(get(hhuvmat.list_object_2,'Visible'),'on')
-% %     IndexObj_2=get(hhuvmat.list_object_2,'Value');
-% %     List2=get(hhuvmat.list_object_2,'String');
-% if numel(IndexObj)==2
-%     IndexObj_2=IndexObj(2);
-% else
-%     IndexObj_2=[];
-% end
 testnew=0;
-
 if numel(IndexObj)==1   % if only one object is selected, the projection is in uvmat
-        PlotHandles=hhuvmat;
+ %       PlotHandles=hhuvmat;
     plotaxes=hhuvmat.axes3;%handle of axes3 in view_field
 else  % if a second object is selected, the projection is in view_field, and this second object is selected
@@ -783,12 +625,12 @@
 %------------------------------------------------------------------------
 %----------------------------------------------------
-function YMin_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-
-function ZMin_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-
-function ZMax_Callback(hObject, eventdata, handles)
-DZ=str2num(get(handles.ZMax,'String'));
+function num_RangeY_1_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+
+function num_RangeZ_1_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+
+function num_RangeZ_2_Callback(hObject, eventdata, handles)
+DZ=str2num(get(handles.num_RangeZ_2,'String'));
 ZMin=get(handles.z_slider,'Min');
 ZMax=get(handles.z_slider,'Max');
@@ -799,16 +641,17 @@
 end
 %------------------------------------------------------------------------
-function YMax_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-
-function XMin_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-
-function XMax_Callback(hObject, eventdata, handles)
+function num_RangeY_2_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+
+function num_RangeX_1_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+
+function num_RangeX_2_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
 %------------------------------------------------------------------------
 function SAVE_Callback(hObject, eventdata, handles)
 % ------------------------------------------------------
-Object=read_set_object(handles);
+%Object=read_set_object(handles);
+Object=read_GUI(handles.set_object);
 huvmat=findobj('Tag','uvmat');
 % UvData=get(huvmat,'UserData');
@@ -828,5 +671,5 @@
 title={'object name'};
 dir_save=uigetdir(RootPath);
-ObjectName=get(handles.TITLE,'String');
+ObjectName=get(handles.Name,'String');
 if ~isempty(ObjectName)&&~strcmp(ObjectName,'')
     def={fullfile(dir_save,[ObjectName '.xml'])};
@@ -859,7 +702,7 @@
 sin_om=0;
 
-PlaneAngle(1)=str2double(get(handles.Phi,'String'));%first  angle in degrees
-PlaneAngle(2)=str2double(get(handles.Theta,'String'));%second  angle in degrees
-PlaneAngle(3)=str2double(get(handles.Psi,'String'));%second  angle in degrees
+PlaneAngle(1)=str2double(get(handles.num_Angle_1,'String'));%first  angle in degrees
+PlaneAngle(2)=str2double(get(handles.num_Angle_2,'String'));%second  angle in degrees
+PlaneAngle(3)=str2double(get(handles.num_Angle_3,'String'));%second  angle in degrees
 PlaneAngle=(pi/180)*PlaneAngle;
 om=norm(PlaneAngle);%norm of rotation angle in radians
@@ -878,7 +721,7 @@
 
 %set new plane position and update graph
-set(handles.XObject,'String',num2str(norm_plane(1)*Z_value,4))
-set(handles.YObject,'String',num2str(norm_plane(2)*Z_value,4))
-set(handles.ZObject,'String',num2str(norm_plane(3)*Z_value,4))
+% set(handles.XObject,'String',num2str(norm_plane(1)*Z_value,4))
+% set(handles.YObject,'String',num2str(norm_plane(2)*Z_value,4))
+% set(handles.ZObject,'String',num2str(norm_plane(3)*Z_value,4))
 PLOT_Callback(hObject, eventdata, handles)
 
@@ -897,3 +740,37 @@
 %------------------------------------------------------------------------
 
-
+function Name_Callback(hObject, eventdata, handles)
+% hObject    handle to Name (see GCBO)
+% eventdata  reserved - to be defined in a future version of MATLAB
+% handles    structure with handles and user data (see GUIDATA)
+
+% Hints: get(hObject,'String') returns contents of Name as text
+%        str2double(get(hObject,'String')) returns contents of Name as a double
+
+%------------------------------------------------------------------------
+% --- Executes when entered data in editable cell(s) in Coord.
+function Coord_CellEditCallback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+ListType=get(handles.Type,'String');
+Type=ListType{get(handles.Type,'Value')};
+switch Type
+    % add lines if multi line input needed
+    case{'points','polyline','polygon'}
+        Coord=get(handles.Coord,'Data');
+        if isequal(size(Coord,2),3)
+            Coord=[Coord;{[]} {[]} {[]}];%add a line for edition (3D case)
+        else
+            Coord=[Coord;{[]} {[]}]; %add a line for edition (2D case)
+        end
+        set(handles.Coord,'Data',Coord)
+end
+
+
+
+function num_Angle_3_Callback(hObject, eventdata, handles)
+% hObject    handle to num_Angle_3 (see GCBO)
+% eventdata  reserved - to be defined in a future version of MATLAB
+% handles    structure with handles and user data (see GUIDATA)
+
+% Hints: get(hObject,'String') returns contents of num_Angle_3 as text
+%        str2double(get(hObject,'String')) returns contents of num_Angle_3 as a double
Index: /trunk/src/update_obj.m
===================================================================
--- /trunk/src/update_obj.m	(revision 378)
+++ /trunk/src/update_obj.m	(revision 379)
@@ -30,5 +30,4 @@
     end
     Object_out{iobj}.DisplayHandle_uvmat=plot_object(Object_out{iobj},Object_out{IndexObj_1},hobject,'m');%update the object representation of Object_out{iobj} on Object_out{IndexObj_1}
-    Object_out{iobj}.DisplayHandle_uvmat
 end
 % plot view_field
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 378)
+++ /trunk/src/uvmat.m	(revision 379)
@@ -155,5 +155,5 @@
 % Properties attached to projection objects (create, menuline, menuplane...):
 %    'Tag'='proj_object': for all projection objects
-%    ObjectData.Style=...: style of projection object:
+%    ObjectData.Type=...: style of projection object:
 %              .ProjMode
 %              .Coord: defines the position of the object
@@ -815,6 +815,6 @@
 end
 if ~isempty(XmlData.Time)
-    nbfield=size(XmlData.Time,1);
-    nbfield_j=size(XmlData.Time,2);
+%     nbfield=size(XmlData.Time,1);
+%     nbfield_j=size(XmlData.Time,2);
     %transform .Time to a column vector if it is a line vector the nomenclature uses a single index
     if isequal(nbfield,1) && ~isequal(nbfield_j,1)% .Time is a line vector
@@ -822,6 +822,6 @@
         if numel(NomType)>=2 &&(strcmp(NomType,'_i')||strcmp(NomType(1:2),'%0')||strcmp(NomType(1:2),'_%'))
             XmlData.Time=(XmlData.Time)';
-            nbfield=nbfield_j;
-            nbfield_j=1;
+%             nbfield=nbfield_j;
+%             nbfield_j=1;
         end
     end
@@ -2104,10 +2104,14 @@
     set(handles.FixVelType,'Visible','on')
     menu=set_veltype_display(ParamOut.CivStage);
-    index_menu=strcmp(ParamOut.VelType,menu);
-    set(handles.VelType,'Value',find(index_menu,1))
+    index_menu=strcmp(ParamOut.VelType,menu);%look for VelType in  the menu
+    index_val=find(index_menu,1);
+    if isempty(index_val)
+        index_val=1;
+    end
+    set(handles.VelType,'Value',index_val)
     if ~get(handles.SubField,'value')
-    set(handles.VelType,'String',menu)
-     set(handles.VelType_1,'Value',1)
-     set(handles.VelType_1,'String',[{''};menu])
+        set(handles.VelType,'String',menu)
+        set(handles.VelType_1,'Value',1)
+        set(handles.VelType_1,'String',[{''};menu])
     end
 else
@@ -2332,5 +2336,5 @@
     if test_set_object% reinitiate the GUI set_object
         delete_object(1);% delete the current projection object in the list UvData.Object, delete its graphic representations and update the list displayed in handles.ListObject and 2
-        UvData.Object{1}.Style='plane';%main plotting plane
+        UvData.Object{1}.Type='plane';%main plotting plane
         UvData.Object{1}.ProjMode='projection';%main plotting plane
         UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat
@@ -3154,5 +3158,5 @@
     edit_vect_Callback(hObject, eventdata, handles)
     %initiate set_object GUI
-    data.TITLE='VOLUME';
+    data.Name='VOLUME';
     if isfield(UvData,'CoordType')
         data.CoordType=UvData.CoordType;
@@ -3240,5 +3244,5 @@
             end
             if isfield(ObjectData,'Coord')& isfield(ObjectData,'Style') 
-                if isequal(ObjectData.Style,'polygon') 
+                if isequal(ObjectData.Type,'polygon') 
                     X=ObjectData.Coord(:,1);
                     Y=ObjectData.Coord(:,2);
@@ -3247,5 +3251,5 @@
                     end
                     flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside                  
-                elseif isequal(ObjectData.Style,'ellipse')
+                elseif isequal(ObjectData.Type,'ellipse')
                     if testphys
                         %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
@@ -3258,5 +3262,5 @@
                     distY=(Yi-ObjectData.Coord(1,2));
                     flagobj=(distX.*distX/X2Max+distY.*distY/Y2Max)>1;
-                elseif isequal(ObjectData.Style,'rectangle')
+                elseif isequal(ObjectData.Type,'rectangle')
                     if testphys
                         %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
@@ -4178,5 +4182,5 @@
                 end
                 if isfield(ObjectData,'Coord')&& isfield(ObjectData,'Style')
-                    if isequal(ObjectData.Style,'polygon')
+                    if isequal(ObjectData.Type,'polygon')
                         X=ObjectData.Coord(:,1);
                         Y=ObjectData.Coord(:,2);
@@ -4185,5 +4189,5 @@
                         end
                         flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside
-                    elseif isequal(ObjectData.Style,'ellipse')
+                    elseif isequal(ObjectData.Type,'ellipse')
                         if testphys
                             %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
@@ -4196,5 +4200,5 @@
                         distY=(Yi-ObjectData.Coord(1,2));
                         flagobj=(distX.*distX/X2Max+distY.*distY/Y2Max)>1;
-                    elseif isequal(ObjectData.Style,'rectangle')
+                    elseif isequal(ObjectData.Type,'rectangle')
                         if testphys
                             %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
@@ -4350,5 +4354,5 @@
 function Menupoints_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-data.Style='points';
+data.Type='points';
 data.ProjMode='projection';%default
 create_object(data,handles)
@@ -4357,5 +4361,5 @@
 function Menuline_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-data.Style='line';
+data.Type='line';
 data.ProjMode='projection';%default
 create_object(data,handles)
@@ -4364,5 +4368,5 @@
 function Menupolyline_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-data.Style='polyline';
+data.Type='polyline';
 data.ProjMode='projection';%default
 create_object(data,handles)
@@ -4371,5 +4375,5 @@
 function Menupolygon_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-data.Style='polygon';
+data.Type='polygon';
 data.ProjMode='inside';%default
 create_object(data,handles)
@@ -4378,5 +4382,5 @@
 function Menurectangle_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-data.Style='rectangle';
+data.Type='rectangle';
 data.ProjMode='inside';%default
 create_object(data,handles)
@@ -4385,5 +4389,5 @@
 function Menuellipse_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-data.Style='ellipse';
+data.Type='ellipse';
 data.ProjMode='inside';%default
 create_object(data,handles)
@@ -4392,6 +4396,6 @@
 function MenuMaskObject_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-data.Style='polygon';
-data.StyleMenu={'polygon'};
+data.Type='polygon';
+data.TypeMenu={'polygon'};
 data.ProjMode='mask_inside';%default
 data.ProjMenu={'mask_inside';'mask_outside'};
@@ -4401,5 +4405,5 @@
 function Menuplane_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-data.Style='plane';
+data.Type='plane';
 data.ProjMode='projection';%default
 
@@ -4409,5 +4413,5 @@
 function Menuvolume_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-data.Style='volume';
+data.Type='volume';
 data.ProjMode='interp';%default
 % set(handles.create,'Visible','on')
@@ -4430,6 +4434,7 @@
 
 %read the file
-t=xmltree(fileinput);
-data=convert(t);
+% t=xmltree(fileinput);
+% data=convert(t);
+data=xml2struct(fileinput);
 data.enable_plot=1;
 [pp,data.Name]=fileparts(FileName);
@@ -4466,4 +4471,5 @@
 val=get(handles.transform_fct,'Value');
 %data.CoordType=transform_list{val};
+data.Coord=[0 0]; %default
 if isfield(UvData,'Field')
     Field=UvData.Field;
@@ -4481,6 +4487,6 @@
         data.DX=max(meshx,meshy);
     end
-    if isfield(Field,'NbDim')
-        data.NbDim=Field.NbDim;
+    if isfield(Field,'NbDim')&& isequal(Field.NbDim,3)
+         data.Coord=[0 0 0]; %default
     end
     if isfield(Field,'CoordUnit')
@@ -4488,12 +4494,11 @@
     end
 end
-data.Coord=[0 0 0]; %default
-if isfield(data,'Style') && isequal(data.Style,'line')
-    if isfield(data,'DX')
-        data.Coord=[[0 0 0];[data.DX 0 0]]; %default 
-    else
-        data.Coord=[[0 0 0];[1 0 0]]; %default 
-    end
-end
+% if isfield(data,'Type') && isequal(data.Type,'line')
+%     if isfield(data,'DX')
+%         data.Coord=[[0 0 0];[data.DX 0 0]]; %default 
+%     else
+%         data.Coord=[[0 0 0];[1 0 0]]; %default 
+%     end
+% end
 if ishandle(handles.UVMAT_title)
     delete(handles.UVMAT_title)%delete the initial display of uvmat if no field has been entered
Index: /trunk/src/xml2struct.m
===================================================================
--- /trunk/src/xml2struct.m	(revision 378)
+++ /trunk/src/xml2struct.m	(revision 379)
@@ -23,10 +23,13 @@
             out.(names{k})=convert_string(s.(names{k}));
         end
-    case 'char'
-        
-        if isempty(regexp(s,'^\d+\.*\d*$'))% if the string contains numerical characters and decimal . only
+    case 'char'   
+        if isempty(regexp(s,'^(-*\d+\.*\d*\ *)+$'))% if the string contains a set of numbers (with possible sign and decimal) separated by blanks
             out=s;
         else
             out=str2num(s);
+        end
+    case 'cell'
+        for ilist=1:numel(s)
+            out(ilist,:)=str2num(s{ilist});
         end
     otherwise
