Index: /trunk/src/civ.m
===================================================================
--- /trunk/src/civ.m	(revision 250)
+++ /trunk/src/civ.m	(revision 251)
@@ -2144,5 +2144,8 @@
                 else
                      fix1.LowerBoundVel=thresh_vel1;
-                end
+                end   
+                if get(handles.get_mask_fix1,'Value')
+                    fix1.MaskName=maskname;
+                end     
                 Param.Fix1=fix1;
             end
Index: /trunk/src/civ_uvmat.m
===================================================================
--- /trunk/src/civ_uvmat.m	(revision 250)
+++ /trunk/src/civ_uvmat.m	(revision 251)
@@ -10,4 +10,5 @@
 mask='';
 maskname='';%default
+test_civx=0;%default
 
 %% Civ1
@@ -74,8 +75,35 @@
     Data.CivStage=1;
 else
-    if isfield(Param,'Fix1')
-        Data=nc2struct(ncfile,ListVarCiv1);%read civ1 data in the existing netcdf file
+    Data=nc2struct(ncfile,'ListGlobalAttribute','absolut_time_T0');
+    
+    % read Civx data
+    if ~isempty(Data.absolut_time_T0')%read civx file
+%         var={'Civ1_X','Civ1_Y','Civ1_U','Civ1_V','Civ1_C','Civ1_F','Civ1_FF';...
+%             'vec_X','vec_Y','vec_U','vec_V','vec_C','vec_F','vec_FixFlag'};
+
+        %var=varcivx_generator('velocity','Civ1');%determine the names of constants and variables to read
+        test_civx=1;
+        [Data,vardetect,ichoice]=nc2struct(ncfile);%read the variables in the netcdf file
+%         Data.ListGlobalAttribute=[{'Conventions','Program','CivStage'} Data.ListGlobalAttribute {'Civ1_Time','Civ1_Dt'}];
+%         Data.Conventions='uvmat/civdata';% states the conventions used for the description of field variables and attributes
+%         Data.Program='civ_uvmat';
+%         Data.Civ1_Time=double(Data.absolut_time_T0);
+%         Data.Civ1_Dt=double(Data.dt);
+%         Data.VarDimName={'nbvec1','nbvec1','nbvec1','nbvec1','nbvec1','nbvec1','nbvec1'};
+%         Data.VarAttribute{1}.Role='coord_x';
+%         Data.VarAttribute{2}.Role='coord_y';
+%         Data.VarAttribute{3}.Role='vector_x';
+%         Data.VarAttribute{4}.Role='vector_y';
+%         Data.VarAttribute{5}.Role='ancillary';
+%         Data.VarAttribute{6}.Role='warnflag';
+%         Data.VarAttribute{7}.Role='errorflag';
+%         Data.CivStage=1;
     else
-        Data=nc2struct(ncfile,ListVarFix1);%read civ1 and fix1 data in the existing netcdf file
+
+        if isfield(Param,'Fix1')
+            Data=nc2struct(ncfile,ListVarCiv1);%read civ1 data in the existing netcdf file
+        else
+            Data=nc2struct(ncfile,ListVarFix1);%read civ1 and fix1 data in the existing netcdf file
+        end
     end
     if isfield(Data,'Txt')
@@ -83,24 +111,4 @@
         return
     end
-    % read Civx data
-    if isfield(Data,'absolut_time_T0')%read civx file
-        var={'Civ1_X','Civ1_Y','Civ1_U','Civ1_V','Civ1_C','Civ1_F','Civ1_FF';'vec_X','vec_Y','vec_U','vec_V','vec_C','vec_F','vec_FixFlag'};
-        %var=varcivx_generator('velocity','Civ1');%determine the names of constants and variables to read
-        [Data,vardetect,ichoice]=nc2struct(ncfile,var);%read the variables in the netcdf file
-        Data.ListGlobalAttribute=[{'Conventions','Program','CivStage'} Data.ListGlobalAttribute {'Civ1_Time','Civ1_Dt'}];
-        Data.Conventions='uvmat/civdata';% states the conventions used for the description of field variables and attributes
-        Data.Program='civ_uvmat';
-        Data.Civ1_Time=double(Data.absolut_time_T0);
-        Data.Civ1_Dt=double(Data.dt);
-        Data.VarDimName={'nbvec1','nbvec1','nbvec1','nbvec1','nbvec1','nbvec1','nbvec1'};
-        Data.VarAttribute{1}.Role='coord_x';
-        Data.VarAttribute{2}.Role='coord_y';
-        Data.VarAttribute{3}.Role='vector_x';
-        Data.VarAttribute{4}.Role='vector_y';
-        Data.VarAttribute{5}.Role='ancillary';
-        Data.VarAttribute{6}.Role='warnflag';
-        Data.VarAttribute{7}.Role='errorflag';
-        Data.CivStage=1;
-    end 
 end
 
@@ -119,10 +127,21 @@
 %     Data.Fix1_ThreshVel=Param.Fix1.ThreshVel;
 %     Data.Fix1_UpperBoundTest=Param.Fix1.UpperBoundTest;
-    Data.ListVarName=[Data.ListVarName {'Civ1_FF'}];
-    Data.VarDimName=[Data.VarDimName {'nbvec1'}];
-    nbvar=length(Data.ListVarName);
-    Data.VarAttribute{nbvar}.Role='errorflag';    
-    Data.Civ1_FF=fix_uvmat(Param.Fix1,Data.Civ1_F,Data.Civ1_C,Data.Civ1_U,Data.Civ1_V);
-    Data.CivStage=2;                               
+
+    if test_civx
+        if ~isfield(Data,'fix')
+            Data.ListGlobalAttribute=[Data.ListGlobalAttribute 'fix'];
+            Data.fix=1;
+            Data.ListVarName=[Data.ListVarName {'vec_FixFlag'}];
+            Data.VarDimName=[Data.VardimName {'nb_vectors'}];
+        end
+        Data.vec_FixFlag=fix_uvmat(Param.Fix1,Data.vec_F,Data.vec_C,Data.vec_U,Data.vec_V,Data.vec_X,Data.vec_Y);
+    else
+        Data.ListVarName=[Data.ListVarName {'Civ1_FF'}];
+        Data.VarDimName=[Data.VarDimName {'nbvec1'}];
+        nbvar=length(Data.ListVarName);
+        Data.VarAttribute{nbvar}.Role='errorflag';    
+        Data.Civ1_FF=fix_uvmat(Param.Fix1,Data.Civ1_F,Data.Civ1_C,Data.Civ1_U,Data.Civ1_V);
+        Data.CivStage=2;    
+    end
 end   
 %% Patch1
@@ -246,6 +265,7 @@
 %fieldref: 'civ1','filter1'...feld used in fileref
 
-function FF=fix_uvmat(Param,F,C,U,V)
+function FF=fix_uvmat(Param,F,C,U,V,X,Y)
 %error=[]; %default
+Param
 FF=zeros(size(F));%default
 
@@ -270,4 +290,36 @@
     FF=FF==1 | (U.*U+V.*V)>thresh;
 end
+if isfield(Param,'MaskName')
+   M=imread(Param.MaskName);
+   nxy=size(M);
+   M=reshape(M,1,[]);
+   rangx0=[0.5 nxy(2)-0.5];
+   rangy0=[0.5 nxy(1)-0.5];
+   vec_x1=X-U/2;%beginning points
+   vec_x2=X+U/2;%end points of vectors
+   vec_y1=Y-V/2;%beginning points
+   vec_y2=Y+V/2;%end points of vectors
+   indx=1+round((nxy(2)-1)*(vec_x1-rangx0(1))/(rangx0(2)-rangx0(1)));% image index x at abcissa vec_x1
+   indy=1+round((nxy(1)-1)*(vec_y1-rangy0(1))/(rangy0(2)-rangy0(1)));% image index y at ordinate vec_y1   
+   test_in=~(indx < 1 |indy < 1 | indx > nxy(2) |indy > nxy(1)); %=0 out of the mask image, 1 inside
+   indx=indx.*test_in+(1-test_in); %replace indx by 1 out of the mask range
+   indy=indy.*test_in+(1-test_in); %replace indy by 1 out of the mask range
+   ICOMB=((indx-1)*nxy(1)+(nxy(1)+1-indy));%determine the indices in the image reshaped in a Matlab vector
+   Mvalues=M(ICOMB);
+   flag7b=((20 < Mvalues) & (Mvalues < 200))| ~test_in';
+   indx=1+round((nxy(2)-1)*(vec_x2-rangx0(1))/(rangx0(2)-rangx0(1)));% image index x at abcissa vec_x2
+   indy=1+round((nxy(1)-1)*(vec_y2-rangy0(1))/(rangy0(2)-rangy0(1)));% image index y at ordinate vec_y2
+   test_in=~(indx < 1 |indy < 1 | indx > nxy(2) |indy > nxy(1)); %=0 out of the mask image, 1 inside
+   indx=indx.*test_in+(1-test_in); %replace indx by 1 out of the mask range
+   indy=indy.*test_in+(1-test_in); %replace indy by 1 out of the mask range
+   ICOMB=((indx-1)*nxy(1)+(nxy(1)+1-indy));%determine the indices in the image reshaped in a Matlab vector
+   Mvalues=M(ICOMB);
+   flag7e=((Mvalues > 20) & (Mvalues < 200))| ~test_in';
+   FF=FF==1 |(flag7b|flag7e)';
+end
+%    flag7=0;
+% end   
+
+
 FF=double(FF);
 % 
@@ -311,34 +363,5 @@
 % 
 %             % flag7 introduce a grey mask, matrix M
-% if isequal (flag_mask,1)
-%    M=imread(maskname);
-%    nxy=size(M);
-%    M=reshape(M,1,nxy(1)*nxy(2));
-%    rangx0=[0.5 nxy(2)-0.5];
-%    rangy0=[0.5 nxy(1)-0.5];
-%    vec_x1=Field.X-Field.U/2;%beginning points
-%    vec_x2=Field.X+Field.U/2;%end points of vectors
-%    vec_y1=Field.Y-Field.V/2;%beginning points
-%    vec_y2=Field.Y+Field.V/2;%end points of vectors
-%    indx=1+round((nxy(2)-1)*(vec_x1-rangx0(1))/(rangx0(2)-rangx0(1)));% image index x at abcissa vec_x
-%    indy=1+round((nxy(1)-1)*(vec_y1-rangy0(1))/(rangy0(2)-rangy0(1)));% image index y at ordinate vec_y   
-%    test_in=~(indx < 1 |indy < 1 | indx > nxy(2) |indy > nxy(1)); %=0 out of the mask image, 1 inside
-%    indx=indx.*test_in+(1-test_in); %replace indx by 1 out of the mask range
-%    indy=indy.*test_in+(1-test_in); %replace indy by 1 out of the mask range
-%    ICOMB=((indx-1)*nxy(1)+(nxy(1)+1-indy));%determine the indices in the image reshaped in a Matlab vector
-%    Mvalues=M(ICOMB);
-%    flag7b=((20 < Mvalues) & (Mvalues < 200))| ~test_in';
-%    indx=1+round((nxy(2)-1)*(vec_x2-rangx0(1))/(rangx0(2)-rangx0(1)));% image index x at abcissa Field.X
-%    indy=1+round((nxy(1)-1)*(vec_y2-rangy0(1))/(rangy0(2)-rangy0(1)));% image index y at ordinate vec_y
-%    test_in=~(indx < 1 |indy < 1 | indx > nxy(2) |indy > nxy(1)); %=0 out of the mask image, 1 inside
-%    indx=indx.*test_in+(1-test_in); %replace indx by 1 out of the mask range
-%    indy=indy.*test_in+(1-test_in); %replace indy by 1 out of the mask range
-%    ICOMB=((indx-1)*nxy(1)+(nxy(1)+1-indy));%determine the indices in the image reshaped in a Matlab vector
-%    Mvalues=M(ICOMB);
-%    flag7e=((Mvalues > 20) & (Mvalues < 200))| ~test_in';
-%    flag7=(flag7b|flag7e)';
-% else
-%    flag7=0;
-% end   
+
 % flagmagenta=flag1|flag2|flag3|flag4|flag5|flag7;
 % fixflag_unit=Field.FF-10*floor(Field.FF/10); %unity term of fix_flag
Index: /trunk/src/mouse_motion.m
===================================================================
--- /trunk/src/mouse_motion.m	(revision 250)
+++ /trunk/src/mouse_motion.m	(revision 251)
@@ -107,69 +107,73 @@
                 if isfield(Field,'ListVarName')
                     [CellVarIndex,NbDim,VarType]=find_field_indices(Field);%analyse the physical fields contained in Field
-%                     if isfield(Field,'Mesh') && ~isempty(Field.Mesh)
-                        text_displ_1='';
-                        text_displ_2='';
-                        text_displ_3='';
-                        text_displ_4='';
-                        for icell=1:numel(CellVarIndex)%look for all physical fields
-                            if NbDim(icell)>=2 % select 2D field
-                                if  isfield(Field,'Mesh') && ~isempty(Field.Mesh)&& ~isempty(VarType{icell}.coord_x) && ~isempty(VarType{icell}.coord_y)%case of unstructured data
-                                    eval(['X=Field.' Field.ListVarName{VarType{icell}.coord_x} ';'])
-                                    eval(['Y=Field.' Field.ListVarName{VarType{icell}.coord_y} ';'])
-                                    flag_vec=(X<(xy(1,1)+Field.Mesh/3) & X>(xy(1,1)-Field.Mesh/3)) & ...%flagx=1 for the vectors with x position selected by the mouse
-                                        (Y<(xy(1,2)+Field.Mesh/3) & Y>(xy(1,2)-Field.Mesh/3));%f
-                                    ivec=find(flag_vec,1);% search the (first) selected vector index ivec                          
-                                    hhh=findobj(haxes,'Tag','vector_marker');
-                                    if ~isempty(ivec)
-                                        % mark the vectors with a circle in the absence of other operations
-                                        if ~test_object && ~test_edit_object && ~test_ruler
-                                            pointershape='arrow'; %mouse indicates  the detection of a vector
-                                            if isempty(hhh)
-                                                set(0,'CurrentFigure',currentfig)
-                                                set(currentfig,'CurrentAxes',haxes)
-                                                rectangle('Curvature',[1 1],...
-                                                    'Position',[X(ivec)-Field.Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh],'EdgeColor','m',...
-                                                    'LineStyle','-','Tag','vector_marker');
-                                            else
-                                                set(hhh,'Visible','on')
-                                                set(hhh,'Position',[X(ivec)-Field.Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh])
-                                            end
+                    %                     if isfield(Field,'Mesh') && ~isempty(Field.Mesh)
+                    text_displ_1='';
+                    text_displ_2='';
+                    text_displ_3='';
+                    text_displ_4='';
+                    ivec=[];
+                    xName='';
+                    z=[];
+                    for icell=1:numel(CellVarIndex)%look for all physical fields
+                        if NbDim(icell)>=2 % select 2D field
+                            if  isfield(Field,'Mesh') && ~isempty(Field.Mesh)&& ~isempty(VarType{icell}.coord_x) && ~isempty(VarType{icell}.coord_y)%case of unstructured data
+                                eval(['X=Field.' Field.ListVarName{VarType{icell}.coord_x} ';'])
+                                eval(['Y=Field.' Field.ListVarName{VarType{icell}.coord_y} ';'])
+                                flag_vec=(X<(xy(1,1)+Field.Mesh/3) & X>(xy(1,1)-Field.Mesh/3)) & ...%flagx=1 for the vectors with x position selected by the mouse
+                                    (Y<(xy(1,2)+Field.Mesh/3) & Y>(xy(1,2)-Field.Mesh/3));%f
+                                ivec=find(flag_vec,1);% search the (first) selected vector index ivec
+                                hhh=findobj(haxes,'Tag','vector_marker');
+                                if ~isempty(ivec)
+                                    % mark the vectors with a circle in the absence of other operations
+                                    if ~test_object && ~test_edit_object && ~test_ruler
+                                        pointershape='arrow'; %mouse indicates  the detection of a vector
+                                        if isempty(hhh)
+                                            set(0,'CurrentFigure',currentfig)
+                                            set(currentfig,'CurrentAxes',haxes)
+                                            rectangle('Curvature',[1 1],...
+                                                'Position',[X(ivec)-Field.Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh],'EdgeColor','m',...
+                                                'LineStyle','-','Tag','vector_marker');
+                                        else
+                                            set(hhh,'Visible','on')
+                                            set(hhh,'Position',[X(ivec)-Field.Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh])
                                         end
-                                        %display the field values
+                                    end
+                                    %display the field values
+                                    for ivar=1:numel(CellVarIndex{icell})
+                                        VarName=Field.ListVarName{CellVarIndex{icell}(ivar)};
+                                        eval(['VarVal=Field.' VarName '(ivec);'])
+                                        var_text=[VarName '=' num2str(VarVal,3) ','];
+                                        if isequal(ivar,VarType{icell}.coord_x)||isequal(ivar,VarType{icell}.coord_y)||isequal(ivar,VarType{icell}.coord_z)
+                                            text_displ_1=[text_displ_1 var_text];
+                                        elseif isequal(ivar,VarType{icell}.vector_x)||isequal(ivar,VarType{icell}.vector_y)||isequal(ivar,VarType{icell}.vector_z)
+                                            text_displ_3=[text_displ_3 var_text];
+                                        else
+                                            text_displ_4=[text_displ_4 var_text];
+                                        end
+                                    end
+                                else
+                                    if ~isempty(hhh)
+                                        set(hhh,'Visible','off')
+                                    end
+                                end
+                            elseif numel(VarType{icell}.coord) >=2 %structured coordinates
+                                yName=Field.ListVarName{VarType{icell}.coord(1)};
+                                xName=Field.ListVarName{VarType{icell}.coord(2)};
+                                 eval(['y=Field.' yName ';'])
+                                 eval(['x=Field.' xName ';'])
+                                VarName=Field.ListVarName{CellVarIndex{icell}(1)};
+                                eval(['nxy=size(Field.' VarName ');']);
+                                MaxAY=max(y(1),y(end)); %#ok<COLND>
+                                MinAY=min(y(1),y(end)); %#ok<COLND>
+                                if (xy(1,1)>x(1))&(xy(1,1)<x(end))&(xy(1,2)<MaxAY)&(xy(1,2)>MinAY) %#ok<COLND>
+                                    indx0=1+round((nxy(2)-1)*(xy(1,1)-x(1))/(x(end)-x(1)));%#ok<COLND> % index x of pixel
+                                    indy0=1+round((nxy(1)-1)*(xy(1,2)-y(1))/(y(end)-y(1)));%#ok<COLND> % index y of pixel
+                                    if indx0>=1 & indx0<=nxy(2) & indy0>=1 & indy0<=nxy(1)
+                                        text_displ_2=['i='  num2str(indx0) ',j=' num2str(indy0) ','];
                                         for ivar=1:numel(CellVarIndex{icell})
                                             VarName=Field.ListVarName{CellVarIndex{icell}(ivar)};
-                                            eval(['VarVal=Field.' VarName '(ivec);'])
-                                            var_text=[VarName '=' num2str(VarVal,3) ','];
-                                            if isequal(ivar,VarType{icell}.coord_x)||isequal(ivar,VarType{icell}.coord_y)||isequal(ivar,VarType{icell}.coord_z)
-                                                text_displ_1=[text_displ_1 var_text];
-                                            elseif isequal(ivar,VarType{icell}.vector_x)||isequal(ivar,VarType{icell}.vector_y)||isequal(ivar,VarType{icell}.vector_z)
-                                                text_displ_3=[text_displ_3 var_text];
-                                            else
-                                                text_displ_4=[text_displ_4 var_text];
-                                            end
-                                        end
-                                    else
-                                        if ~isempty(hhh)
-                                            set(hhh,'Visible','off')
-                                        end
-                                    end
-                                elseif numel(VarType{icell}.coord) >=2 %structured coordinates
-                                    eval(['y=Field.' Field.ListVarName{VarType{icell}.coord(1)} ';'])
-                                    eval(['x=Field.' Field.ListVarName{VarType{icell}.coord(2)} ';'])
-                                    VarName=Field.ListVarName{CellVarIndex{icell}(1)};
-                                    eval(['nxy=size(Field.' VarName ');']);
-                                    MaxAY=max(y(1),y(end)); %#ok<COLND>
-                                    MinAY=min(y(1),y(end)); %#ok<COLND>
-                                    if (xy(1,1)>x(1))&(xy(1,1)<x(end))&(xy(1,2)<MaxAY)&(xy(1,2)>MinAY) %#ok<COLND>
-                                        indx0=1+round((nxy(2)-1)*(xy(1,1)-x(1))/(x(end)-x(1)));%#ok<COLND> % index x of pixel
-                                        indy0=1+round((nxy(1)-1)*(xy(1,2)-y(1))/(y(end)-y(1)));%#ok<COLND> % index y of pixel
-                                        if indx0>=1 & indx0<=nxy(2) & indy0>=1 & indy0<=nxy(1)
-                                            text_displ_2=['i='  num2str(indx0) ',j=' num2str(indy0) ','];
-                                            for ivar=1:numel(CellVarIndex{icell})
-                                                VarName=Field.ListVarName{CellVarIndex{icell}(ivar)};
-                                                eval(['VarVal=Field.' VarName '(indy0,indx0,:);'])
-                                                var_text=[VarName '=' num2str(VarVal) ','];
-                                                text_displ_2=[text_displ_2 var_text];
-                                            end
+                                            eval(['VarVal=Field.' VarName '(indy0,indx0,:);'])
+                                            var_text=[VarName '=' num2str(VarVal) ','];
+                                            text_displ_2=[text_displ_2 var_text];
                                         end
                                     end
@@ -177,15 +181,21 @@
                             end
                         end
-%                     end
-                    if strcmp(text_displ_1,'')
-                        text_displ_1=['x=' num2str(xy(1,1),3) ',y=' num2str(xy(1,2),3) ','];  
-                        z=[];
-                        if isfield(Field,'PlaneCoord') && isfield(Field,'ZIndex')
-                            ZIndex=Field.ZIndex;
-                            if size(Field.PlaneCoord)>=[ZIndex 3]
-                            z=Field.PlaneCoord(ZIndex,3);
+                    end
+              % display the current x,y coordinates in the absence of detected vector
+                    if isempty(ivec)
+                        if isempty(xName)
+                            xName='x';
+                            yName='y';
+                        end
+                        text_displ_1=[xName '=' num2str(xy(1,1),3) ', ' yName '=' num2str(xy(1,2),3) ','];
+                    end
+              %display the z coordinate if defined by the projection plane
+                    if isfield(Field,'PlaneCoord') 
+%                             ZIndex=Field.ZIndex;
+                        if size(Field.PlaneCoord)>=[1 3]
+                            z=Field.PlaneCoord(1,3);
                             if isfield(Field,'PlaneAngle')&&~isequal(Field.PlaneAngle,[0 0 0])
-                                om=norm(Field.PlaneAngle(ZIndex,:));%norm of rotation angle in radians
-                                OmAxis=Field.PlaneAngle(ZIndex,:)/om; %unit vector marking the rotation axis
+                                om=norm(Field.PlaneAngle);%norm of rotation angle in radians
+                                OmAxis=Field.PlaneAngle/om; %unit vector marking the rotation axis
                                 cos_om=cos(pi*om/180);
                                 sin_om=sin(pi*om/180);
@@ -194,39 +204,22 @@
                                 norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
                                 norm_plane(3)=OmAxis(3)*coeff+cos_om;
-                                Z0=norm_plane*Field.PlaneCoord(ZIndex,:)'/norm_plane(3);
+                                Z0=norm_plane*Field.PlaneCoord'/norm_plane(3);
                                 z=Z0-norm_plane(1)*xy(1,1)/norm_plane(3)-norm_plane(2)*xy(1,2)/norm_plane(3);
                             end
-                            end
-                        end
-                        if ~isempty(z)
-                            text_displ_1=[text_displ_1 ' z=' num2str(z,3)]; %TODO: generaliser au cas avec angle
-                        end
+                        end
+                    end
+                    if ~isempty(z)
+                        text_displ_1=[text_displ_1 ' z=' num2str(z,3)];
                     end
                     %coordinate transform if proj_coord differs from menu_coord A REVOIR
-                    if isfield(Field,'CoordUnit')
-                        mouse.CoordUnit=Field.CoordUnit;
-                    end
 %                     if isfield(Field,'CoordUnit')
 %                         mouse.CoordUnit=Field.CoordUnit;
 %                     end
-%                     if isfield(mouse,'CoordType')
-%                         if isequal(mouse.CoordType,'px')
-%                             mouse.CoordUnit='px';
-%                         end
-%                     else
-%                         mouse.CoordUnit='';%default
-%                     end
-                    if test_piv 
-                       par=civ('read_param_civ1',hhciv);
-%                        PointCoord=Field.X;
-                       [dd,ind_pt]=min(abs(Field.X-xy(1,1))+abs(Field.Y-xy(1,2)));
-%                        [dd,ind_y]=min(abs(Field.Y-xy(1,2)));
-                       xround=Field.X(ind_pt);
-                       yround=Field.Y(ind_pt);
-%                             dx=str2double(par.dx);
-%                             dy=str2double(par.dy);
-%                             xround=x(1)+dx*round((xy(1,1)-x(1))/dx);% index x of pixel
-%                             yround=y(1)+dy*round((xy(1,2)-y(1))/dy);% index y of pixel
-%                         end
+             % case of PIV correlation display
+                    if test_piv
+                        par=civ('read_param_civ1',hhciv);
+                        [dd,ind_pt]=min(abs(Field.X-xy(1,1))+abs(Field.Y-xy(1,2)));
+                        xround=Field.X(ind_pt);
+                        yround=Field.Y(ind_pt);
                         % mark the correlation box with a rectangle
                         ibx2=floor((str2double(par.ibx)-1)/2);
@@ -248,26 +241,14 @@
                                 'LineStyle','- -','Tag','PIV_search_marker');
                         else
-%                             set(hhh,'Visible','on')
                             set(hhh,'Position',[xround-ibx2 yround-iby2 2*ibx2 2*iby2])
                             set(hhhh,'Position',[xround-isx2+shiftx yround-isy2+shifty 2*isx2 2*isy2])
                         end
                         [xtable ytable utable vtable ctable typevector result_conv] = pivlab (Field.A,Field.B,ibx2,iby2,isx2,isy2,shiftx,shifty,[xround size(Field.A,1)-yround+1], 1, []);
-%                         Asub=Field.A(yround-iby2:yround+iby2,xround-ibx2:xround+ibx2);%first sub-image
-%                         Asub=reshape(Asub,[],1);%first sub-image reshaped as matlab vector
-                         rangx(1)=-(isx2-ibx2)+shiftx;
-                         rangx(2)=isx2-ibx2+shiftx;
-                         rangy(1)=-(isy2-iby2)-shifty;
-                         rangy(2)=(isy2-iby2)-shifty;
-%                         correl=zeros(rangy(2)-rangy(1)+1,rangx(2)-rangx(1)+1);
-%                         for id=rangx(1):rangx(2)
-%                             for jd=rangy(1):rangy(2)
-%                                 Bsub=Field.B(yround-iby2+jd:yround+iby2+jd,xround-ibx2+id:xround+ibx2+id);
-%                                 Bsub=reshape(Bsub,[],1);
-%                                 correl(jd-rangy(1)+1,id-rangx(1)+1)=corr(double(Asub),double(Bsub));
-%                             end
-%                         end
-                        %correl=uint8(63.5*correl+63.5);
+                        rangx(1)=-(isx2-ibx2)+shiftx;
+                        rangx(2)=isx2-ibx2+shiftx;
+                        rangy(1)=-(isy2-iby2)-shifty;
+                        rangy(2)=(isy2-iby2)-shifty;
                         hcorr=[];
-                        if isfield(AxeData,'CurrentCorrImage')                        
+                        if isfield(AxeData,'CurrentCorrImage')
                             hcorr=AxeData.CurrentCorrImage;
                             if ~ishandle(hcorr)
@@ -287,13 +268,12 @@
                             end
                         else
-                           % set(AxeData.CurrentCorrImage,'CData',correl)
                             set(AxeData.CurrentCorrImage,'CData',result_conv)
                             set(AxeData.CurrentCorrImage,'XData',rangx)
                             set(AxeData.CurrentCorrImage,'YData',-rangy)
                             set(AxeData.CurrentVector,'XData',[0 utable],'YData',[0 -vtable])
-                        end        
+                        end
                     end
                 end
-            end      
+            end
         end
     end
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 250)
+++ /trunk/src/uvmat.m	(revision 251)
@@ -1494,9 +1494,4 @@
             maskname=maskfiles(ilist).name;% take the first mask file in the list
             [rr,ff,x1,x2,xa,xb,xext,Mask_NomType{ilist}]=name2display(maskname);
-% 
-%             if ~strcmp(Mask_NomType{ilist},Mask_NomType{1})
-%                 msgbox_uvmat('ERROR',['inconsistent mask types ' Mask_NomType{1} ' and ' Mask_NomType{ilist } ' coexist in the current image directory'])
-%                 return
-%             end
             [Path2,Name,ext]=fileparts(maskname);
             Namedouble=double(Name);
@@ -1523,5 +1518,5 @@
             num_i1=mod(num_i1-1,nbslice)+1;
             Mask.NomType=regexprep(Mask_NomType{1},'0','');%remove '0' in nom type for masks
-            [maskname,mdetect]=name_generator(Mask.Base,num_i1,num_j1,'.png',Mask.NomType);%
+            maskname=name_generator(Mask.Base,num_i1,num_j1,'.png',Mask.NomType);%
             mdetect=exist(maskname,'file');
             if mdetect
