Index: /trunk/src/civ_3D.m
===================================================================
--- /trunk/src/civ_3D.m	(revision 71)
+++ /trunk/src/civ_3D.m	(revision 72)
@@ -581,6 +581,6 @@
         first_i=max(field_i+1,1);
             %determine the set of times and possible intervals for CIV_3D
-        dt=(1/1000)*str2num(get(handles.dt,'String'));
-        time=(dt*[0:nb_field-1])';
+%         dt=(1/1000)*str2num(get(handles.dt,'String'));
+        time=(0:nb_field-1)';
 %             set(handles.incr_i,'UserData',dt);%store the time interval
 %             between successive images
@@ -594,5 +594,4 @@
   last_j=1;
 end
-UvData.XmlData=XmlData;
 
 if exist('time','var')
@@ -1548,10 +1547,7 @@
 for ifile=1:nbfield
     i_cmd=0; 
-    cmd='';
-    if sge
        cmd='#!/bin/bash';
        cmd=char({cmd;'#$ -cwd'});
        cmd=char({cmd;'hostname && date'});
-    end
     filename_cmx=cell2mat(filecell_nc1(ifile));%output netcdf file
     filename_cmx([end-1:end])='cm';%name of cmx file
@@ -1579,88 +1575,15 @@
  	 pvalue=num2str((1-ind_answer)*500)
     	save(civAllxml,par_civ1_3d_xml);
-    
-%       if(isunix && sge)
-	 ['echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose 16 -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ]
-	 eval ( ['!echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose 16 -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ])
-%       else
-%  	    '3D mode is NOT supported without sge'
-%       end
-     return
-        % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        %  fichier xml produit
-        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        % A CONTINUER
-        %civAllxml
-        civAllCmd=[];
-        civAllxml=set(civAllxml,1,'name','civ3d3c');
-        namelog=[filename_cmx([1:end-3]) 'log'];
-        %par_civ1.Dt=num2str(time(num2_civ1(ifile),num_b_civ1(j))-time(num1_civ1(ifile),num_a_civ1(1)));
-        %par_civ1.T0=num2str((time(num2_civ1(ifile),num_b_civ1(j))+time(num1_civ1(ifile),num_a_civ1(1)))/2); 
-       % test_mask=get(handles.get_mask_civ1,'Value');
-        i_cmd=i_cmd+1;
-%         if isequal(civAll,0)
-%             cmd=char({cmd;BATCH_CIV1(filename_cmx([1:end-4]),namelog,par_civ1,handles)});
-%         else
-             civAllCmd=[civAllCmd ' civ1 '];
-             str=BATCH_CIV1_Unified(filename_cmx([1:end-4]),namelog,par_civ1,handles);
-            fieldnames=fields(str);
-            [civAllxml,uid_civ1]=add(civAllxml,1,'element','civ1');
-            for ilist=1:length(fieldnames)
-              val=eval(['str.' fieldnames{ilist}]);
-              if ischar(val)
-                [civAllxml,uid_t]=add(civAllxml,uid_civ1,'element',fieldnames{ilist});
-                [civAllxml,uid_t2]=add(civAllxml,uid_t,'chardata',val);
-               end
-            end   
-%         end
-    end         
-    if(isunix)
-	    cmd=char({cmd ; ['cp -f ' filename_cmx '2 ' filename_cmx]; cmd_CIV2});
-    else
-        cmd=char({cmd ; ['copy /Y ' filename_cmx '2 ' filename_cmx]; cmd_CIV2});
-    end
-end
-     
-%  if isequal(civAll,1)
-    save(civAllxml,[filename_cmx([1:end-4]) '.xml']);
-    cmd=char({cmd;[Civ_exe ' -f ' [filename_cmx([1:end-4]) '.xml'] ' ' civAllCmd]});
-
-     %save(civAllxml,'/tmp/test.xml');
-%  end
-
-
-% create the .bat file:
-if sge
-        [Rootbat,Filebat,extbat]=fileparts(filename_cmx);
-        filename_bat=fullfile(Rootbat,['job_' Filebat extbat]);
-else
-    filename_bat=filename_cmx;
-end
-filename_bat(end-2:end)='bat';
-
-%     pbat=fopen(filename_bat,'w'); %create the file filename_bat
-dlmwrite(filename_bat,cmd,'');%write commands in filename_bat
-if sge
-    pvalue=num2str((1-ind_answer)*500);
-    namelog=[filename_bat '.patch.log'];
-    ['!qsub -p ' pvalue ' -q civ_3D.q -e ' filename_cmx(1:end-4) '.errors -o ' filename_cmx(1:end-4) '.log' ' ' filename_bat];
-    eval(  ['!qsub -p ' pvalue ' -q civ_3D.q -e ' filename_cmx(1:end-4) '.errors -o ' filename_cmx(1:end-4) '.log' ' ' filename_bat]);
-else
-    if(isunix)
-      cmdtodo=['. ' filename_bat ];%removed for Mathieu tests %' && rm -f ' filename_bat] ;
-    else
-%      cmdtodo=[filename_bat ' && del /F /Q ' filename_bat];
-       cmdtodo=[filename_bat];%removed for Mathieu tests %' && del /F /Q ' filename_bat' ;
-    end
-    count= fprintf(p1,'%s\n', cmdtodo);
-end
-if ~sge
-    fclose(p1);
-    fclose(p0);
-    delete(name_lock);
-end 
+     nb_processor='8';
+	 ['echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose ' nb_processor ' -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ]
+	 eval ( ['!echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose ' nb_processor ' -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ])
+
+    end           
+end
+
 set(handles.BATCH, 'Enable','On')
 set(handles.BATCH,'BackgroundColor',[1 0 0])
-%save interface state
+
+%save GUI state
 [Path,Name]=fileparts(filebase);
 namefig=fullfile(Path,subdir_civ2,Name);
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 71)
+++ /trunk/src/plot_field.m	(revision 72)
@@ -12,5 +12,5 @@
 %  dimension variables (case of matrices). 
 %
-% function [PlotType,PlotParamOut,haxes]= plot_field(Data,haxes,PlotParam,KeepLim,PosColorbar)
+% function [PlotType,PlotParamOut,haxes]= plot_field(Data,haxes,PlotParam,htext,PosColorbar)
 %
 % OUPUT:
@@ -53,4 +53,6 @@
 %
 %   PlotParam: parameters for plotting, as read on the uvmat interface (by function 'read_plot_param.m')
+%     .FixedLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits
+%     .Auto_xy: =0 (default): kepp 1 to 1 aspect ratio for x and y scales, =1: automatic adjustment of the graph
 %            --scalars--
 %    .Scalar.MaxA: upper bound (saturation color) for the scalar representation, max(field) by default
@@ -79,5 +81,5 @@
 %    .Vectors.MaxC = imposed maximum of the scalar field used for vector color;
 %
-% KeepLim:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits
+% 
 % PosColorbar: if not empty, display a colorbar for B&W images
 %               imposed position of the colorbar (ex [0.821 0.471 0.019 0.445])
@@ -99,9 +101,12 @@
 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
-function [PlotType,PlotParamOut,haxes]= plot_field(Data,haxes,PlotParam,KeepLim,PosColorbar)
-
+function [PlotType,PlotParamOut,haxes]= plot_field(Data,haxes,PlotParam,htext,PosColorbar)
+% TODO:
+% use htext: handles of the text edit box (uicontrol)
+% introduce PlotParam.Hold: 'on' or 'off' (for curves)
+  
 %default output
 if ~exist('PlotParam','var'),PlotParam=[];end;
-if ~exist('KeepLim','var'),KeepLim=0;end;
+if ~exist('htext','var'),htext=[];end;
 if ~exist('PosColorbar','var'),PosColorbar=[];end;
 PlotType='text'; %default
@@ -177,11 +182,7 @@
     [Data.NbDim,imax]=max(NbDim);
 end
-if isequal(Data.NbDim,0) % TODO: chech whether this function is still used, replace by plot_profile ?
-%     if isfield(Data,'Style') & isequal(Data.Style,'points')
-        AxeData=plot_text(Data,haxes);
+if isequal(Data.NbDim,0) 
+        AxeData=plot_text(Data,htext);
         PlotType='text';
-%     else
-%         [AxeData,haxes]=plot_hist(Data,haxes,PlotParam);
-%     end
 elseif isequal(Data.NbDim,1)
     [AxeData,haxes]=plot_profile(Data,CellVarIndex,VarType,haxes,PlotParam);% 
@@ -198,5 +199,5 @@
         return
     end
-    [AxeData,haxes,PlotParamOut,PlotType]=plot_plane(Data,CellVarIndex(ind_select),VarType(ind_select),haxes,PlotParam,KeepLim,PosColorbar);
+    [AxeData,haxes,PlotParamOut,PlotType]=plot_plane(Data,CellVarIndex(ind_select),VarType(ind_select),haxes,PlotParam,htext,PosColorbar);
     if testzoomaxes
         [AxeData,zoomaxes,PlotParamOut]=plot_plane(Data,CellVarIndex(ind_select),VarType(ind_select),zoomaxes,PlotParam,1,PosColorbar);
@@ -235,7 +236,67 @@
 
 
-%----------------------------------------------------------
+%-------------------------------------------------------------------
+function hdisplay=plot_text(FieldData,hdisplay_in)
+%-------------------------------------------------------------------
+if exist('hdisplay_in','var') & ishandle(hdisplay_in) & isequal(get(hdisplay_in,'Type'),'uicontrol')
+    hdisplay=hdisplay_in;
+else
+    figure;%create new figure
+    hdisplay=uicontrol('Style','edit', 'Units','normalized','Position', [0 0 1 1],'Max',2,'FontName','monospaced');
+end
+    
+ff=fields(FieldData);%list of field names
+vv=struct2cell(FieldData);%list of field values
+
+for icell=1:length(vv)
+    Tabcell{icell,1}=ff{icell};
+    ss=vv{icell};
+    sizss=size(ss);
+    if isnumeric(ss)
+        if sizss(1)<=1 & length(ss)<5
+            displ{icell}=num2str(ss);
+        else
+            displ{icell}=[class(ss) ', size ' num2str(size(ss))];
+        end
+    elseif ischar(ss)
+        displ{icell}=ss;
+    elseif iscell(ss)
+        sizcell=size(ss);
+        if sizcell(1)==1 & length(sizcell)==2 %line cell
+           ssline='{''';
+           for icolumn=1:sizcell(2)
+               if isnumeric(ss{icolumn})
+                   if size(ss{icolumn},1)<=1 & length(ss{icolumn})<5
+                      sscolumn=num2str(ss{icolumn});%line vector
+                   else
+                      sscolumn=[class(ss{icolumn}) ', size ' num2str(size(ss{icolumn}))];
+                   end
+               elseif ischar(ss{icolumn})
+                   sscolumn=ss{icolumn};
+               else
+                   sscolumn=class(ss{icolumn});
+               end
+               if icolumn==1
+                   ssline=[ssline sscolumn];
+               else
+                   ssline=[ssline ''',''' sscolumn];
+               end
+           end
+           displ{icell}=[ssline '''}'];
+        else
+           displ{icell}=[class(ss) ', size ' num2str(sizcell)];
+        end
+    else
+        displ{icell}=class(ss);
+    end
+    Tabcell{icell,2}=displ{icell};
+end 
+Tabchar=cell2tab(Tabcell,': '); 
+set(hdisplay,'String', Tabchar)
+
+
+%-------------------------------------------------------------------
 function [AxeData,haxes]=plot_profile(data,CellVarIndex,VarType,haxes,PlotParam)
-%-----------------------------------------------------------
+%-------------------------------------------------------------------
 %axes(haxes)
 hfig=get(haxes,'parent');
@@ -247,5 +308,5 @@
     set(haxes,'NextPlot',PlotParam.NextPlot)
 end
-% adjust the size of the plot to include the whole field, except if KeepLim=1
+% adjust the size of the plot to include the whole field,
 if isfield(PlotParam,'FixedLimits') && isequal(PlotParam.FixedLimits,1)  %adjust the graph limits*
     set(haxes,'XLimMode', 'manual')
@@ -454,8 +515,7 @@
 
 
-%---------------------------------------
-% plot_plane
-%----------------------------------------
-function [AxeData,haxes,PlotParamOut,PlotType]=plot_plane(Data,CellVarIndex,VarTypeCell,haxes,PlotParam,KeepLim,PosColorbar)
+%-------------------------------------------------------------------
+function [AxeData,haxes,PlotParamOut,PlotType]=plot_plane(Data,CellVarIndex,VarTypeCell,haxes,PlotParam,htext,PosColorbar)
+%-------------------------------------------------------------------
 grid(haxes, 'off')
 %default plotting parameters
@@ -854,6 +914,6 @@
     vec_U=reshape(vec_U,1,numel(vec_U));
     vec_V=reshape(vec_V,1,numel(vec_V));
-    MinMaxX=max(vec_X)-min(vec_X);
-    MinMaxY=max(vec_Y)-min(vec_Y);
+    MinMaxX=max(vec_X)-min(vec_X)
+    MinMaxY=max(vec_Y)-min(vec_Y)
     AxeData.Mesh=sqrt((MinMaxX*MinMaxY)/length(vec_X));
     if  ~isfield(PlotParam.Vectors,'AutoVec') || isequal(PlotParam.Vectors.AutoVec,0)|| ~isfield(PlotParam.Vectors,'VecScale')...
@@ -993,6 +1053,7 @@
 end
 
-% adjust the size of the plot to include the whole field, except if KeepLim=1
-if ~(exist('KeepLim','var') && isequal(KeepLim,1))  %adjust the graph limits*
+% adjust the size of the plot to include the whole field, except if PlotParam.FixedLimits=1
+if ~(isfield(PlotParam,'FixedLimits') && PlotParam.FixedLimits)
+    %~(exist('KeepLim','var') && isequal(KeepLim,1))  %adjust the graph limits*
         test_lim=0;
         if test_vec
@@ -1028,7 +1089,7 @@
 set(get(haxes,'XLabel'),'String',[XName x_units]);
 set(get(haxes,'YLabel'),'String',[YName y_units]);
-%---------------------------------------------
-%function for plotting vectors
-%------------------------------------------------
+
+%-------------------------------------------------------------------
+% --- function for plotting vectors
 %INPUT:
 % haxes: handles of the plotting axes
@@ -1038,5 +1099,5 @@
 %col_vec: matlab vector setting the color number #i for each velocity vector
 function quiresetn(haxes,x,y,u,v,scale,colorlist,col_vec)
-
+%-------------------------------------------------------------------
 %define arrows
 theta=0.5 ;%angle arrow
@@ -1118,8 +1179,8 @@
 end
 
-%---------------------------------------
-%determine tick positions for colorbar
-%------------------------------------
+%-------------------------------------------------------------------
+% ---- determine tick positions for colorbar
 function YTick=colbartick(MinA,MaxA)
+%-------------------------------------------------------------------
 %determine tick positions with "simple" values between MinA and MaxA
 YTick=0;%default
Index: unk/src/plot_text.m
===================================================================
--- /trunk/src/plot_text.m	(revision 71)
+++ 	(revision )
@@ -1,86 +1,0 @@
-%'plot_text': function for displaying the content of a Matlab structure in a figure
-%------------------------------------------------------------------------
-% function hdisplay=plot_text(FieldData,hdisplay_in)
-%
-% OUTPUT:
-% hdisplay: handle of the display edit box
-%
-%  INPUT: 
-% FieldData: input Matlab structure
-% hdisplay_in: handles of the display box, if it is not defined create a new figure
-%
-%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-%  Copyright Joel Sommeria, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org.
-%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-%     This file is part of the toolbox UVMAT.
-% 
-%     UVMAT is free software; you can redistribute it and/or modify
-%     it under the terms of the GNU General Public License as published by
-%     the Free Software Foundation; either version 2 of the License, or
-%     (at your option) any later version.
-% 
-%     UVMAT is distributed in the hope that it will be useful,
-%     but WITHOUT ANY WARRANTY; without even the implied warranty of
-%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-%     GNU General Public License (file UVMAT/COPYING.txt) for more details.
-%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-
-function hdisplay=plot_text(FieldData,hdisplay_in)
-
-if exist('hdisplay_in','var') & ishandle(hdisplay_in) & isequal(get(hdisplay_in,'Type'),'uicontrol')
-    hdisplay=hdisplay_in;
-else
-    figure;%create new figure
-    hdisplay=uicontrol('Style','edit', 'Units','normalized','Position', [0 0 1 1],'Max',2,'FontName','monospaced');
-end
-    
-ff=fields(FieldData);%list of field names
-vv=struct2cell(FieldData);%list of field values
-
-for icell=1:length(vv)
-    Tabcell{icell,1}=ff{icell};
-    ss=vv{icell};
-    sizss=size(ss);
-    if isnumeric(ss)
-        if sizss(1)<=1 & length(ss)<5
-            displ{icell}=num2str(ss);
-        else
-            displ{icell}=[class(ss) ', size ' num2str(size(ss))];
-        end
-    elseif ischar(ss)
-        displ{icell}=ss;
-    elseif iscell(ss)
-        sizcell=size(ss);
-        if sizcell(1)==1 & length(sizcell)==2 %line cell
-           ssline='{''';
-           for icolumn=1:sizcell(2)
-               if isnumeric(ss{icolumn})
-                   if size(ss{icolumn},1)<=1 & length(ss{icolumn})<5
-                      sscolumn=num2str(ss{icolumn});%line vector
-                   else
-                      sscolumn=[class(ss{icolumn}) ', size ' num2str(size(ss{icolumn}))];
-                   end
-               elseif ischar(ss{icolumn})
-                   sscolumn=ss{icolumn};
-               else
-                   sscolumn=class(ss{icolumn});
-               end
-               if icolumn==1
-                   ssline=[ssline sscolumn];
-               else
-                   ssline=[ssline ''',''' sscolumn];
-               end
-           end
-           displ{icell}=[ssline '''}'];
-        else
-           displ{icell}=[class(ss) ', size ' num2str(sizcell)];
-        end
-    else
-        displ{icell}=class(ss);
-    end
-    Tabcell{icell,2}=displ{icell};
-end 
-Tabchar=cell2tab(Tabcell,': '); 
-set(hdisplay,'String', Tabchar)
-
-
Index: /trunk/src/proj_field.m
===================================================================
--- /trunk/src/proj_field.m	(revision 71)
+++ /trunk/src/proj_field.m	(revision 72)
@@ -950,6 +950,6 @@
 % test for 3D fields
 test3D=0;
-if isfield(FieldData,'NbDim')
-    test3D=isequal(FieldData.NbDim,3);
+if isfield(FieldData,'nb_dim')
+    test3D=isequal(FieldData.nb_dim,3)
 end
 test3C=test3D; %default 3 vel components
@@ -1046,10 +1046,10 @@
 %case of input fields with unstructured coordinates
     if testX
-        XName=FieldData.ListVarName{ivar_X};
-        YName=FieldData.ListVarName{ivar_Y};
+        XName=FieldData.ListVarName{ivar_X}
+        YName=FieldData.ListVarName{ivar_Y}
         eval(['coord_x=FieldData.' XName ';'])
         eval(['coord_y=FieldData.' YName ';'])
         if length(ivar_Z)==1
-            ZName=FieldData.ListVarName{ivar_X};
+            ZName=FieldData.ListVarName{ivar_Z}
             eval(['coord_z=FieldData.' ZName ';'])
         end
Index: /trunk/src/series/ima2vol.m
===================================================================
--- /trunk/src/series/ima2vol.m	(revision 71)
+++ /trunk/src/series/ima2vol.m	(revision 72)
@@ -20,7 +20,7 @@
 curdir=pwd;
 cd(path);
-mkdir([subdir_ima '_ij']);
+mkdir([subdir_ima '_vol']);
 cd(curdir);
-basename_new=fullfile(path,[subdir_ima '_ij'],namebase);
+basename_new=fullfile(path,[subdir_ima '_vol'],namebase);
 
 % read imadoc
@@ -55,15 +55,4 @@
         t=set(t,uid_value(1),'value',ImageName)%indicate  name of the first image, with ;png extension
     end  
-
-%     %add information about image transform
-%     [t,new_uid]=add(t,1,'element','ImageTransform');
-%     [t,NameFunction_uid]=add(t,new_uid,'element','NameFunction');
-%     [t]=add(t,NameFunction_uid,'chardata','sub_background');      
-%     [t,NbSlice_uid]=add(t,new_uid,'element','NbSlice');
-%     [t]=add(t,new_uid,'chardata',num2str(nbslice_i));
-%     [t,NbSlidingImages_uid]=add(t,new_uid,'element','NbSlidingImages');
-%     [t]=add(t,NbSlidingImages_uid,'chardata',num2str(nbaver));
-%     [t,LuminosityRank_uid]=add(t,new_uid,'element','RankBackground');
-%     [t]=add(t,LuminosityRank_uid,'chardata',num2str(rank));% luminosity rank almong the nbaver sliding images 
     save(t,[basename_new '.xml'])
 end
@@ -83,5 +72,5 @@
     if num_j==nbfield2
          filename_new=name_generator(basename_new,num_i,1,'.vol','_i');
-         imwrite(vol,filename_new,'png')
+         imwrite(vol,filename_new,'png','BitDepth',16)% WRITE IN 16 bits
          vol=[];
     end      
@@ -104,5 +93,5 @@
 Mfiltre=Mfiltre/(sum(sum(Mfiltre)));
 
-C=filter2(ones(windowsize)/windowsize^2,B);
+C=filter2(Mfiltre,B);
 C(:,1:windowsize)=C(:,windowsize)*ones(1,windowsize);
 C(:,end-windowsize+1:end)=C(:,end-windowsize+1)*ones(1,windowsize);
@@ -127,3 +116,3 @@
 cmax=max(c_select);
 C=(C-cmin)/(cmax-cmin)*256;
-C=uint8(C);
+%C=uint8(C);
Index: /trunk/src/set_object.m
===================================================================
--- /trunk/src/set_object.m	(revision 71)
+++ /trunk/src/set_object.m	(revision 72)
@@ -100,4 +100,5 @@
     if isfield(data,'Name')
         set(handles.TITLE,'String',data.Name)
+        set(hObject,'name',data.Name)
     end
     if ~isfield(data,'NbDim')||~isequal(data.NbDim,3)%2D case
@@ -245,5 +246,13 @@
    set(handles.PLOT,'enable','off') 
 end
-
+huvmat=findobj(allchild(0),'tag','uvmat');
+UvData=get(huvmat,'UserData');
+pos_uvmat=get(huvmat,'Position');
+%position the set_object GUI with respect to uvmat
+if isfield(UvData,'SetObjectOrigin')
+    pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);
+    pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);
+    set(hObject,'Position',pos_set_object)
+end
 
 % --- Outputs from this function are returned to the command line.
@@ -745,6 +754,6 @@
 testnew=0;
 if strcmp(ListObject{IndexObj_1},ObjectName)% we are editing the object whose projection is viewed in the uvmat frame
-   ObjectData.HandlesDisplay=handles.axes3;
-    PlotHandles=get_plot_handles(handles);
+   ObjectData.HandlesDisplay=hhuvmat.axes3;
+    PlotHandles=get_plot_handles(hhuvmat);
     IndexObj=IndexObj_1;
 elseif strcmp(ListObject{IndexObj_2},ObjectName)% we are editing the object whose projection is viewed in view_field
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 71)
+++ /trunk/src/uvmat.m	(revision 72)
@@ -1603,5 +1603,8 @@
 
 while get(handles.speed,'Value')~=0 & isequal(get(handles.RunMovie,'BusyAction'),'queue') % enable STOP command
-        runpm(hObject,eventdata,handles,increment)
+        errormsg=runpm(hObject,eventdata,handles,increment);
+        if ~isempty(errormsg)
+            return
+        end
         pause(1.02-get(handles.speed,'Value'))% wait for next image
 end
@@ -1622,5 +1625,5 @@
 
 %------------------------------------------------------------------
-function runpm(hObject,eventdata,handles,increment)
+function errormsg=runpm(hObject,eventdata,handles,increment)
 %------------------------------------------------------------------
 %check for mùovie pair status
@@ -2411,7 +2414,7 @@
         %Zvar=DimVarIndex(DimIndex(1));
          %Zvar=DimVarIndex(1);
-         Zvar=VarType{imax}.coord_3;
-        if Zvar~=0 % z is a dimension variable
-            ZName=UvData.Field.ListVarName{Zvar};
+%          Zvar=VarType{imax}.coord_3;
+        if isfield(VarType{imax},'coord_3')&& ~isequal(VarType{imax}.coord_3,0) % z is a dimension variable
+            ZName=UvData.Field.ListVarName{VarType{imax}.coord_3}
             eval(['UvData.ZMax=max(UvData.Field.' ZName ');'])
             eval(['UvData.ZMin=min(UvData.Field.' ZName ');'])
@@ -2486,4 +2489,6 @@
     ZBounds(1)=UvData.ZMin; %minimum for the Z slider
     ZBounds(2)=UvData.ZMax;%maximum for the Z slider
+    UvData.Object{1}.Name='1-PLANE';
+    UvData.Object{1}.enable_plot=1;
     set_object(UvData.Object{1},PlotHandles,ZBounds);
     set(handles.list_object_1,'Value',1);
@@ -4759,4 +4764,7 @@
 UvData.MouseAction='create_object';
 set(handles.uvmat,'UserData',UvData)
+set(handles.delete_object,'Visible','on')
+set(handles.uvmat_title,'Visible','on')
+set(handles.viw_field_title,'Visible','on')
 
 %------------------------------------------------------------------------
@@ -4803,11 +4811,11 @@
 [hset_object,UvData.sethandles]=set_object(data,PlotHandles);% call the set_object interface
 
-pos_uvmat=get(handles.uvmat,'Position');
-%position the set_object GUI with respect to uvmat
-if isfield(UvData,'SetObjectOrigin')
-    pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);
-    pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);
-    set(hset_object,'Position',pos_set_object)
-end
+% pos_uvmat=get(handles.uvmat,'Position');
+% %position the set_object GUI with respect to uvmat
+% if isfield(UvData,'SetObjectOrigin')
+%     pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2);
+%     pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4);
+%     set(hset_object,'Position',pos_set_object)
+% end
 
 UvData.MouseAction='create_object';
@@ -4815,4 +4823,7 @@
 set(handles.zoom,'Value',0)
 zoom_Callback(handles.uvmat, [], handles)
+set(handles.delete_object,'Visible','on')
+set(handles.uvmat_title,'Visible','on')
+set(handles.viw_field_title,'Visible','on')
 
 %------------------------------------------------------------------------
Index: /trunk/src/write_plot_param.m
===================================================================
--- /trunk/src/write_plot_param.m	(revision 71)
+++ /trunk/src/write_plot_param.m	(revision 72)
@@ -90,5 +90,7 @@
 set(handles.HideFalse,'Visible',state)
 set(handles.HideWarning,'Visible',state)
-set(handles.record,'Visible',state)
+if isfield(handles,'record')
+    set(handles.record,'Visible',state)
+end
 set(handles.colcode1,'Visible',state)
 set(handles.colcode2,'Visible',state)
