Index: /trunk/src/find_field_cells.m
===================================================================
--- /trunk/src/find_field_cells.m	(revision 1097)
+++ /trunk/src/find_field_cells.m	(revision 1098)
@@ -429,5 +429,5 @@
                 NbDim(icell)=size(Data.(Data.ListVarName{ivar}),2);
             else
-                DimIndex=find(strcmp(Data.VarDimName{ivar},Data.ListDimName));
+                DimIndex=find(strcmp(Data.VarDimName{ivar}{2},Data.ListDimName));
                 NbDim(icell)= Data.DimValue(DimIndex);
             end
@@ -497,5 +497,6 @@
         for ivar=ind_discrete
             DimCell=Data.VarDimName{ivar};
-            if  numel(DimCell)==1 && strcmp(DimCell_x{1},DimCell{1})
+            %if  numel(DimCell)==1 && strcmp(DimCell_x{1},DimCell{1})
+            if  strcmp(DimCell_x{1},DimCell{1})
                 y_nbre(icell)=y_nbre(icell)+1;
                 Cell1DPlot{icell}.YIndex_discrete(y_nbre(icell))=ivar;
Index: /trunk/src/get_field.m
===================================================================
--- /trunk/src/get_field.m	(revision 1097)
+++ /trunk/src/get_field.m	(revision 1098)
@@ -822,5 +822,5 @@
         end
     else
-        coord_val=[0 0 0];
+        coord_val=[0 0];
         for ilist=1:numel(var_component)
             ivar=var_component(ilist);
Index: /trunk/src/mouse_down.m
===================================================================
--- /trunk/src/mouse_down.m	(revision 1097)
+++ /trunk/src/mouse_down.m	(revision 1098)
@@ -115,5 +115,5 @@
             AxeData.CurrentOrigin=xy(1,1:2);% The current point set by the mouse becomes the current origin
             
-            if test_edit_vect 
+            if test_edit_vect
                 ivec=[];
                 FigData=get(hCurrentGUI,'UserData');
@@ -123,16 +123,16 @@
                     [CellInfo,NbDim,errormsg]=find_field_cells(Field);%analyse the physical fields contained in Field
                     if isempty(errormsg)
-                    for icell=1:numel(CellInfo)%look for all physical fields
-                        if NbDim(icell)==2 % select 2D field
-                            if  isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&&...
-                                    ~isempty(CellInfo{icell}.VarIndex_coord_x) && ~isempty(CellInfo{icell}.VarIndex_coord_y)%case of unstructured data
-                                X=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_x});
-                                Y=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_y});
-                                flag_vec=(X<(xy(1,1)+Field.CoordMesh/4) & X>(xy(1,1)-Field.CoordMesh/4)) & ...%flagx=1 for the vectors with x position selected by the mouse
-                                    (Y<(xy(1,2)+Field.CoordMesh/4) & Y>(xy(1,2)-Field.CoordMesh/4));%f
-                                ivec=find(flag_vec,1);% search the (first) selected vector index ivec
+                        for icell=1:numel(CellInfo)%look for all physical fields
+                            if NbDim(icell)==2 % select 2D field
+                                if  isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&&...
+                                        ~isempty(CellInfo{icell}.VarIndex_coord_x) && ~isempty(CellInfo{icell}.VarIndex_coord_y)%case of unstructured data
+                                    X=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_x});
+                                    Y=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_y});
+                                    flag_vec=(X<(xy(1,1)+Field.CoordMesh/4) & X>(xy(1,1)-Field.CoordMesh/4)) & ...%flagx=1 for the vectors with x position selected by the mouse
+                                        (Y<(xy(1,2)+Field.CoordMesh/4) & Y>(xy(1,2)-Field.CoordMesh/4));%f
+                                    ivec=find(flag_vec,1);% search the (first) selected vector index ivec
+                                end
                             end
                         end
-                    end
                     end
                 end
Index: /trunk/src/mouse_motion.m
===================================================================
--- /trunk/src/mouse_motion.m	(revision 1097)
+++ /trunk/src/mouse_motion.m	(revision 1098)
@@ -339,8 +339,6 @@
         text_displ(ind_blank)=[];
     end
-    %set(handles.text_display,'String',text_displ)
     set(htext_display,'String',text_displ)
 else
-   %set(handles.text_display,'String',get(handles.text_display,'UserData'))
    set(htext_display,'String',get(handles.text_display,'UserData'))
 end
Index: /trunk/src/mouse_up.m
===================================================================
--- /trunk/src/mouse_up.m	(revision 1097)
+++ /trunk/src/mouse_up.m	(revision 1098)
@@ -172,5 +172,8 @@
             if ~isempty(errormsg)
                 msgbox_uvmat('ERROR',errormsg)
-                return
+%                 AxeData.Drawing='off';%exit the ruler drawing mode
+%                 set(hcurrentaxes,'UserData',AxeData);
+%                 set(gcf,'Pointer','arrow')
+%                 return
             end
             set(hhuvmat.CheckViewField,'Value',1);%
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 1097)
+++ /trunk/src/plot_field.m	(revision 1098)
@@ -114,17 +114,17 @@
 
 %% check input structure
-    [CellInfo,NbDimArray,errormsg]=find_field_cells(Data);
-    if ~isempty(errormsg)
-        msgbox_uvmat('ERROR',['input of plot_field/find_field_cells: ' errormsg]);
-        return
-    end
-    index_0D=find(NbDimArray==0);
-    index_1D=find(NbDimArray==1);
-    index_2D=find(NbDimArray==2);%find 2D fields
-    index_3D=find(NbDimArray>2,1);
-    if ~isempty(index_3D)
-        msgbox_uvmat('ERROR','volume plot not implemented yet');
-        return
-    end
+[CellInfo,NbDimArray,errormsg]=find_field_cells(Data);
+if ~isempty(errormsg)
+    msgbox_uvmat('ERROR',['input of plot_field/find_field_cells: ' errormsg]);
+    return
+end
+index_0D=find(NbDimArray==0);
+index_1D=find(NbDimArray==1);
+index_2D=find(NbDimArray==2);%find 2D fields
+index_3D=find(NbDimArray>2,1);
+if ~isempty(index_3D)
+    msgbox_uvmat('ERROR','volume plot not implemented yet');
+    return
+end
 
 %% test axes and figure
Index: /trunk/src/plot_object.m
===================================================================
--- /trunk/src/plot_object.m	(revision 1097)
+++ /trunk/src/plot_object.m	(revision 1098)
@@ -136,8 +136,4 @@
 
 %% determine the coordinates xline, yline,xsup,xinf, yinf,ysup determining the new object plot
-%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');
 test_line=ismember(ObjectData.Type,{'points','line','polyline','polygon','plane','plane_z','volume'});
 test_patch=ismember(ObjectData.ProjMode,{'inside','outside','mask_inside','mask_outside'});
@@ -346,5 +342,5 @@
                     %complement missing points
                     if length(PlotData.SubObject)>nbpoints% fpoints in excess on the graph
-                        for ii=nbpoints+1: length(PlotData.SubObject);
+                        for ii=nbpoints+1: length(PlotData.SubObject)
                             if ishandle(PlotData.SubObject(ii))
                                 delete(PlotData.SubObject(ii))
@@ -352,6 +348,4 @@
                         end
                     end
-                    %                NbDeformPoint=nbpoints;
-                    
                     if nbpoints>length(PlotData.SubObject)
                         for ipt=length(PlotData.SubObject)+1:nbpoints
@@ -374,5 +368,6 @@
         if isfield(PlotData,'DeformPoint')
             NbDeformPoint=length(PlotData.DeformPoint);
-            if NbDeformPoint>nbpoints% fpoints in excess on the graph
+            % delete deformpoints in excess on the graph
+            if NbDeformPoint>nbpoints
                 for ii=nbpoints+1:NbDeformPoint
                     if ishandle(PlotData.DeformPoint(ii))
@@ -382,4 +377,5 @@
                 NbDeformPoint=nbpoints;
             end
+            % update the position of the existing deformpoints
             for ipt=1:NbDeformPoint
                 if ishandle(PlotData.DeformPoint(ipt))
@@ -389,8 +385,9 @@
                 end
             end
+            % add neww deform points if requested
             if nbpoints>length(PlotData.DeformPoint)
                 for ipt=length(PlotData.DeformPoint)+1:nbpoints
                     PlotData.DeformPoint(ipt)=line(xline(ipt),yline(ipt),'Color',col,'LineStyle','-','Tag','DeformPoint',...
-                        'SelectionHighlight','off','UserData',hplot);
+                        'Marker','.','MarkerSize',12,'SelectionHighlight','off','UserData',hplot);
                 end
                 set(hplot,'UserData',PlotData)
@@ -431,5 +428,4 @@
 %% create the object
 if test_newobj
-%     axes(haxes)
     hother=findobj('Tag','proj_object');%find all the proj objects
     for iobj=1:length(hother)
@@ -456,5 +452,5 @@
             for ipt=1:length(xline)
                 PlotData.DeformPoint(ipt)=line(ObjectData.Coord(ipt,1),ObjectData.Coord(ipt,2),'Color',...
-                    col,'LineStyle','none','SelectionHighlight','off','UserData',hh,'Tag','DeformPoint');
+                    col,'LineStyle','none','Marker','.','MarkerSize',12,'SelectionHighlight','off','UserData',hh,'Tag','DeformPoint');
                 %create circle around each point
                 if ~isequal(YMax,0)
@@ -470,5 +466,5 @@
                 for ipt=1:sizcoord(1)
                     PlotData.DeformPoint(ipt)=line(ObjectData.Coord(ipt,1),ObjectData.Coord(ipt,2),'Color',...
-                        col,'LineStyle','none','Marker','.','Tag','DeformPoint','SelectionHighlight','off','UserData',hh);
+                        col,'LineStyle','none','Marker','.','MarkerSize',12,'Tag','DeformPoint','SelectionHighlight','off','UserData',hh);
                 end
         case {'plane','volume'}
Index: /trunk/src/proj_field.m
===================================================================
--- /trunk/src/proj_field.m	(revision 1097)
+++ /trunk/src/proj_field.m	(revision 1098)
@@ -817,5 +817,5 @@
                     ObjectData.Coord(1,3)=0;
                 end
-                dline=ObjectData.Coord(2,:)-ObjectData.Coord(1,:); 
+                dline=ObjectData.Coord(2,:)-ObjectData.Coord(1,:);
                 linelength=norm(dline);
                 if isfield(FieldData,'RangeX')
@@ -825,5 +825,5 @@
                 end
                 ProjData.(AXName)=XMin:ObjectData.DX:XMin+linelength;%abscissa of the projected data along the line
-               
+                
                 XI_proj=ObjectData.Coord(1,1)*ones(size(ProjData.(AXName)));
                 YI_proj=ObjectData.Coord(1,2)*ones(size(ProjData.(AXName)));
@@ -839,5 +839,5 @@
                 end
                 for ivar=VarIndex
-                                      VarName=FieldData.ListVarName{ivar};
+                    VarName=FieldData.ListVarName{ivar};
                     %                         ListVarName=[ListVarName VarName];
                     %                         VarDimName=[VarDimName {{'coord_y','coord_x'}}];
@@ -852,6 +852,6 @@
                     ProjData.(VarName)=interp3(Coord{3},Coord{2},Coord{1},double(FieldData.(VarName)),XI_proj,YI_proj,ZI_proj,'*linear');
                     ProjData.(VarName)=squeeze(ProjData.(VarName));
-                end            
-            
+                end
+                
             else
                 AYName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)};
@@ -895,5 +895,5 @@
                 dliny=ObjectData.Coord(2,2)-ObjectData.Coord(1,2);
                 linelength=sqrt(dlinx*dlinx+dliny*dliny);
-                theta=angle(dlinx+i*dliny);%angle of the line
+                theta=angle(dlinx+1i*dliny);%angle of the line
                 if isfield(FieldData,'RangeX')
                     XMin=min(FieldData.RangeX);%shift of the origin on the line
@@ -923,5 +923,4 @@
                 else
                     errormsg='multicomponent field not projected';
-                    display(errormsg)
                     return
                 end
@@ -931,5 +930,4 @@
                 ProjData.VarAttribute{nbvar}.Role='coord_x';
                 for ivar=VarIndex
-                    %VarName{ivar}=FieldData.ListVarName{ivar};
                     if test_interp2% interpolate on new grid
                         FieldData.(FieldData.ListVarName{ivar})=interp2(FieldData.(AXName),FieldData.(AYName),FieldData.(FieldData.ListVarName{ivar}),AXI,AYI');
@@ -969,13 +967,13 @@
                     ProjData.VarDimName{end}={AXName,'rgb'};
                 end
-    end
-    
-end
-% for vector fields, take the components longitudinal and tranverse to the projection line
-if ~isempty(ivar_U) && ~isempty(ivar_V)
-    vector_x =ProjData.(ProjData.ListVarName{ivar_U});
-    ProjData.(ProjData.ListVarName{ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{ivar_V});
-    ProjData.(ProjData.ListVarName{ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{ivar_V});
-end
+            end
+            
+    end
+    % for vector fields, take the components longitudinal and tranverse to the projection line
+    if ~isempty(ivar_U) && ~isempty(ivar_V)
+        vector_x =ProjData.(ProjData.ListVarName{ivar_U});
+        ProjData.(ProjData.ListVarName{ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{ivar_V});
+        ProjData.(ProjData.ListVarName{ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{ivar_V});
+    end
 end
 
Index: /trunk/src/series/civ_input.m
===================================================================
--- /trunk/src/series/civ_input.m	(revision 1097)
+++ /trunk/src/series/civ_input.m	(revision 1098)
@@ -1795,86 +1795,110 @@
 
 if get(handles.TestPatch1,'Value')% if TestPatch1 is activated
-     set(handles.TestPatch1,'BackgroundColor',[1 1 0])%paint TestPatch1 button in yellow to indicate activation
-     set(handles.Civ1,'BackgroundColor',[1 1 0])% indicate civ1 calculation is performed
-     hseries=findobj(allchild(0),'Tag','series');
-     Param=read_GUI(hseries);
-     Param.Action.RUN=1;
-     Param.ActionInput=read_GUI(handles.civ_input);
-     if isfield(Param.ActionInput,'Civ2')%remove options that may be selected beyond Patch1
-         Param.ActionInput=rmfield(Param.ActionInput,'Civ2');
-     end
-     if isfield(Param.ActionInput,'Fix2')
-         Param.ActionInput=rmfield(Param.ActionInput,'Fix2');
-     end
-     if isfield(Param.ActionInput,'Patch2')
-         Param.ActionInput=rmfield(Param.ActionInput,'Patch2');
-     end
-     if isfield(Param,'OutputSubDir')
-         Param=rmfield(Param,'OutputSubDir'); %remove output file option from civ_series
-     end
-     ParamPatch1=Param.ActionInput.Patch1; %store the patch1 parameters
-     Param.ActionInput=rmfield(Param.ActionInput,'Patch1');% does not execute Patch
-     Param.IndexRange.first_i=str2num(get(handles.ref_i,'String'));
-     Param.IndexRange.last_i=Param.IndexRange.first_i;
-     if strcmp(get(handles.ref_j,'Visible'),'on')
-         Param.IndexRange.first_j=str2num(get(handles.ref_j,'String'));
-         Param.IndexRange.last_j=Param.IndexRange.first_j;
-     else
-         Param.IndexRange.first_j=1;
-         Param.IndexRange.last_j=1;
-     end
-     [Data,errormsg]=civ_series(Param);% get the civ1+fix1 results
-     bckcolor=get(handles.civ_input,'Color');
-     set(handles.Civ1,'BackgroundColor',bckcolor)% indicate civ1 calculation is finished
-     
-     %% prepare Param for iterative Patch processing without input file reading
-     Param.Civ1_X=Data.Civ1_X;
-     Param.Civ1_Y=Data.Civ1_Y;
-     Param.Civ1_U=Data.Civ1_U;
-     Param.Civ1_V=Data.Civ1_V;
-     Param.Civ1_FF=Data.Civ1_FF;
-     Param=rmfield(Param,'InputTable');%desactivate input file reading
-    if isfield(Param.ActionInput,'Civ1')
-        Param.ActionInput=rmfield(Param.ActionInput,'Civ1');%desactivate civ1: remove civ1 input param if relevant
-    end
-    if isfield(Param.ActionInput,'Fix1')
-        Param.ActionInput=rmfield(Param.ActionInput,'Fix1');%desactivate fix1:remove fix1 input param if relevant
-    end
-    SmoothingParam=(ParamPatch1.FieldSmooth/10)*2.^(1:7);%scan the smoothing param from 1/10 to 12.8 current value
-    NbGood=numel(find(Data.Civ1_FF==0));
-    NbExclude=zeros(1,7);% initialize the set of smoothing parameters
-    DiffVel=zeros(1,7);% initialize the rms difference between patch and civ
-    Param.ActionInput.Patch1=ParamPatch1;% retrieve Patch1 parameters
-    for irho=1:7
-        Param.ActionInput.Patch1.FieldSmooth=SmoothingParam(irho);
-        [Data,errormsg]= civ_series(Param);%apply the processing fct
-        if ~isempty(errormsg)
-            msgbox_uvmat('ERROR',errormsg)
-            return
-        end
-        ind_good=find(Data.Civ1_FF==0);
-        Civ1_U_Diff=Data.Civ1_U(ind_good)-Data.Civ1_U_smooth(ind_good);
-        Civ1_V_Diff=Data.Civ1_V(ind_good)-Data.Civ1_V_smooth(ind_good);
-        DiffVel(irho)=sqrt(mean(Civ1_U_Diff.*Civ1_U_Diff+Civ1_V_Diff.*Civ1_V_Diff));
-        NbExclude(irho)=(NbGood-numel(ind_good))/NbGood;
-    end
-    figure(1)
-    semilogx(SmoothingParam,DiffVel,'b',SmoothingParam,NbExclude,'r',SmoothingParam,0.2*ones(size(SmoothingParam)),'m')
-    grid on
-    legend('rms velocity diff. Patch1-Civ1 (pixels)','proportion of excluded vectors (between 0 to 1)','recommended diff Patch1-Civ1')
-    xlabel('smoothing parameter')
-    ylabel('smoothing effect')
-    set(handles.TestPatch1,'BackgroundColor',[0 1 0])
-else
-    corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display
-    if ~isempty(corrfig)
-        delete(corrfig)
-    end
-    hview_field=findobj(allchild(0),'tag','view_field');% look for view_field
-    if ~isempty(hview_field)
-        delete(hview_field)
-    end
-end
-
+    hseries=findobj(allchild(0),'Tag','series');
+    Param=read_GUI(hseries);
+    CivDir=fullfile(Param.OutputPath,Param.Experiment,Param.Device,[Param.OutputSubDir Param.OutputDirExt]);
+    % ListXml=dir(CivXmlDir);
+    if exist(CivDir,'dir')
+        CivFile=uigetfile_uvmat('pick .nc file with civ1-fix1 data',CivDir,'.nc');
+        [Field,VelTypeOut,errormsg]=read_civdata(CivFile)
+        for ilist=1:numel(Field.ListGlobalAttribute)
+            r=regexp(Field.ListGlobalAttribute{ilist},'Civ1_(?<field>.+)','names');% \D = not a digit, \d =digi
+            if ~isempty(r)
+                ParamTest.Civ1.(r.field)=(Field.(['Civ1_' r.field]));
+            end
+            r=regexp(Field.ListGlobalAttribute{ilist},'Fix1_(?<field>.+)','names');% \D = not a digit, \d =digi
+            if ~isempty(r)
+                ParamTest.Fix1.(r.field)=(Field.(['Fix1_' r.field]));
+            end
+        end
+        fill_GUI(ParamTest,handles.civ_input)% fill the elements of the GUI series with the input parameters
+        drawnow
+        update_CivOptions(handles,0)
+        
+        set(handles.TestPatch1,'BackgroundColor',[1 1 0])%paint TestPatch1 button in yellow to indicate activation
+%         set(handles.Civ1,'BackgroundColor',[1 1 0])% indicate civ1 calculation is performed
+        Param.Action.RUN=1;
+         Param.ActionInput=read_GUI(handles.civ_input);
+         Param.ActionInput.CheckCiv1=0;% do not repeat Civ1 computation        
+        if isfield(Param.ActionInput,'Civ2')%remove options that may be selected beyond Patch1
+            Param.ActionInput=rmfield(Param.ActionInput,'Civ2');
+        end
+        if isfield(Param.ActionInput,'Fix2')
+            Param.ActionInput=rmfield(Param.ActionInput,'Fix2');
+        end
+        if isfield(Param.ActionInput,'Patch2')
+            Param.ActionInput=rmfield(Param.ActionInput,'Patch2');
+        end
+        if isfield(Param,'OutputSubDir')
+            Param=rmfield(Param,'OutputSubDir'); %remove output file option from civ_series
+        end
+        ParamPatch1=Param.ActionInput.Patch1; %store the patch1 parameters
+        Param.ActionInput=rmfield(Param.ActionInput,'Patch1');% does not execute Patch
+        Param.IndexRange.first_i=str2num(get(handles.ref_i,'String'));
+        Param.IndexRange.last_i=Param.IndexRange.first_i;
+        if strcmp(get(handles.ref_j,'Visible'),'on')
+            Param.IndexRange.first_j=str2num(get(handles.ref_j,'String'));
+            Param.IndexRange.last_j=Param.IndexRange.first_j;
+        else
+            Param.IndexRange.first_j=1;
+            Param.IndexRange.last_j=1;
+        end
+        [Data,errormsg]=civ_series(Param);% get the civ1+fix1 results
+        bckcolor=get(handles.civ_input,'Color');
+        set(handles.Civ1,'BackgroundColor',bckcolor)% indicate civ1 calculation is finished
+        
+        %% prepare Param for iterative Patch processing without input file reading
+        Param.Civ1_X=Data.Civ1_X;
+        Param.Civ1_Y=Data.Civ1_Y;
+        Param.Civ1_U=Data.Civ1_U;
+        Param.Civ1_V=Data.Civ1_V;
+        Param.Civ1_FF=Data.Civ1_FF;
+        Param=rmfield(Param,'InputTable');%desactivate input file reading
+        if isfield(Param.ActionInput,'Civ1')
+            Param.ActionInput=rmfield(Param.ActionInput,'Civ1');%desactivate civ1: remove civ1 input param if relevant
+        end
+        if isfield(Param.ActionInput,'Fix1')
+            Param.ActionInput=rmfield(Param.ActionInput,'Fix1');%desactivate fix1:remove fix1 input param if relevant
+        end
+        SmoothingParam=(ParamPatch1.FieldSmooth/10)*2.^(1:7);%scan the smoothing param from 1/10 to 12.8 current value
+        NbGood=numel(find(Data.Civ1_FF==0));
+        NbExclude=zeros(1,7);% initialize the set of smoothing parameters
+        DiffVel=zeros(1,7);% initialize the rms difference between patch and civ
+        Param.ActionInput.Patch1=ParamPatch1;% retrieve Patch1 parameters
+        for irho=1:7
+            Param.ActionInput.Patch1.FieldSmooth=SmoothingParam(irho);
+            [Data,errormsg]= civ_series(Param);%apply the processing fct
+            if ~isempty(errormsg)
+                msgbox_uvmat('ERROR',errormsg)
+                return
+            end
+            ind_good=find(Data.Civ1_FF==0);
+            Civ1_U_Diff=Data.Civ1_U(ind_good)-Data.Civ1_U_smooth(ind_good);
+            Civ1_V_Diff=Data.Civ1_V(ind_good)-Data.Civ1_V_smooth(ind_good);
+            DiffVel(irho)=sqrt(mean(Civ1_U_Diff.*Civ1_U_Diff+Civ1_V_Diff.*Civ1_V_Diff));
+            NbExclude(irho)=(NbGood-numel(ind_good))/NbGood;
+        end
+        figure(1)
+        semilogx(SmoothingParam,DiffVel,'b',SmoothingParam,NbExclude,'r',SmoothingParam,0.2*ones(size(SmoothingParam)),'m')
+        grid on
+        legend('rms velocity diff. Patch1-Civ1 (pixels)','proportion of excluded vectors (between 0 to 1)','recommended diff Patch1-Civ1')
+        xlabel('smoothing parameter')
+        ylabel('smoothing effect')
+        set(handles.TestPatch1,'BackgroundColor',[0 1 0])
+    else
+        corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display
+        if ~isempty(corrfig)
+            delete(corrfig)
+        end
+        hview_field=findobj(allchild(0),'tag','view_field');% look for view_field
+        if ~isempty(hview_field)
+            delete(hview_field)
+        end
+    end
+else
+    msgbox_uvmat('ERROR','no output file: first perform a civ1-fix1 computation')
+    return
+end
+  
 %------------------------------------------------------------------------
 % --- Executes on button press in TestCiv2.
Index: /trunk/src/series/sub_background_special.m
===================================================================
--- /trunk/src/series/sub_background_special.m	(revision 1097)
+++ /trunk/src/series/sub_background_special.m	(revision 1098)
@@ -50,5 +50,5 @@
 %     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,
+%     by the Free Software Foundation; either version 2 of the license,series
 %     or (at your option) any later version.
 %
@@ -66,5 +66,5 @@
     ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     ParamOut.WholeIndexRange='on';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
-    ParamOut.NbSlice='off'; %nbre of slices ('off' by default)
+    ParamOut.NbSlice='on'; %nbre of slices ('off' by default)
     ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
@@ -93,12 +93,18 @@
 end
 %% estimate the position of bottom and mask for each Z Index
-BottomIndex=[1900 1800 1700 1650 1650 1600 1600 1600 1600 1600 1600];
+NbSlice=Param.IndexRange.NbSlice;
+switch NbSlice
+    case 11
+        BottomIndex=[1900 1800 1700 1650 1650 1600 1600 1600 1600 1600 1600];
+    case 4
+        BottomIndex=[1950 1850 1740 1700];
+end
 MaxIndex=BottomIndex+100;
 MinIndex=BottomIndex-100;
+
 maskindex=[665 1080];% range of x index perturbed by shadows 
-NbSlice=11;
 Bfilter=ones(1,20)/20;
 %% root input file names and nomenclature type (cell arrays with one element)
-OutputDir=[Param.OutputSubDir Param.OutputDirExt];
+OutputDir=[Param.OutputSubDir Param.OutputDirExt];4
 nbj=numel(Param.IndexRange.first_i:Param.IndexRange.last_i);
 for i_ind=Param.IndexRange.first_i:Param.IndexRange.last_i
Index: /trunk/src/set_object.m
===================================================================
--- /trunk/src/set_object.m	(revision 1097)
+++ /trunk/src/set_object.m	(revision 1098)
@@ -596,5 +596,5 @@
 
 %% update the object refresh 
-hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat;
+%hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat;
 % if we are editing the object used for projection in uvmat
 if isequal(IndexObj_1,IndexObj)
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 1097)
+++ /trunk/src/uvmat.m	(revision 1098)
@@ -5279,34 +5279,34 @@
 
 %% delete drawn objects if the output CooordUnit is different from the previous one
-if  ~strcmp(CoordUnit,CoordUnitPrev)
-    set(handles.CheckFixLimits,'Value',0)
-    hother=findobj('Tag','proj_object');%find all the proj objects
-    for iobj=1:length(hother)
-        delete(hother(iobj))
-    end
-    hother=findobj('Tag','DeformPoint');%find all the proj objects
-    for iobj=1:length(hother)
-        delete(hother(iobj))
-    end
-    hh=findobj('Tag','calib_points');
-    if ~isempty(hh)
-        delete(hh)
-    end
-    hhh=findobj('Tag','calib_marker');
-    if ~isempty(hhh)
-        delete(hhh)
-    end
-    set(handles.ListObject,'Value',1)
-    set(handles.ListObject,'String',{''})
-    set(handles.ListObject_1,'Value',1)
-    set(handles.ListObject_1,'String',{''})
-    set(handles.CheckViewObject,'value',0)
-    CheckViewObject_Callback(hObject, eventdata, handles)
-    set(handles.CheckViewField,'value',0)
-    CheckViewField_Callback(hObject, eventdata, handles)
-    set(handles.CheckEditObject,'Value',0)
-    CheckEditObject_Callback(hObject, eventdata, handles)
-    UvData.ProjObject={[]};
-end
+% if  ~strcmp(CoordUnit,CoordUnitPrev)
+%     set(handles.CheckFixLimits,'Value',0)
+%     hother=findobj('Tag','proj_object');%find all the proj objects
+%     for iobj=1:length(hother)
+%         delete(hother(iobj))
+%     end
+%     hother=findobj('Tag','DeformPoint');%find all the proj objects
+%     for iobj=1:length(hother)
+%         delete(hother(iobj))
+%     end
+%     hh=findobj('Tag','calib_points');
+%     if ~isempty(hh)
+%         delete(hh)
+%     end
+%     hhh=findobj('Tag','calib_marker');
+%     if ~isempty(hhh)
+%         delete(hhh)
+%     end
+%     set(handles.ListObject,'Value',1)
+%     set(handles.ListObject,'String',{''})
+%     set(handles.ListObject_1,'Value',1)
+%     set(handles.ListObject_1,'String',{''})
+%     set(handles.CheckViewObject,'value',0)
+%     CheckViewObject_Callback(hObject, eventdata, handles)
+%     set(handles.CheckViewField,'value',0)
+%     CheckViewField_Callback(hObject, eventdata, handles)
+%     set(handles.CheckEditObject,'Value',0)
+%     CheckEditObject_Callback(hObject, eventdata, handles)
+%     UvData.ProjObject={[]};
+% end
 set(handles.uvmat,'UserData',UvData)
 set(handles.TransformName,'backgroundColor',[1 1 1])% indicate desactivation  of the menu
