Index: /trunk/src/civ.m
===================================================================
--- /trunk/src/civ.m	(revision 176)
+++ /trunk/src/civ.m	(revision 177)
@@ -22,5 +22,5 @@
 function varargout = civ(varargin)
 
-% Last Modified by GUIDE v2.5 01-Dec-2010 23:19:15
+% Last Modified by GUIDE v2.5 05-Jan-2011 16:19:30
 % Begin initialization code - DO NOT EDIT
 gui_Singleton = 1;
@@ -335,7 +335,7 @@
 browse.num_j2=num_j2;
 if length(ext)>1 && (~isempty(imformats(ext(2:end)))||strcmpi(ext,'.avi'));%if an image file has been opened by uvmat
-%     set(handles.ImaExt,'String',ext)
     browse.nom_type_ima=nom_type;
     browse.ext_ima=ext;
+    set(handles.ImaExt,'String',ext)
 end
 set(handles.ImaDoc,'String',ext);
@@ -593,14 +593,4 @@
         end
     end
-%     if ~isempty(ext_ima_read) && ~isempty(nom_type_read)
-% %         if isempty(ext_ima)
-% %             ext_ima=ext_ima_read;% define image extension from the xml file if an image has not been opened previously
-% %         else   %keep the image extension
-% %             if  ~strcmp(ext_ima_read,ext_ima)
-% %                 msgbox_uvmat('WARNING',['FirtsImage extension ' ext_ima_read ' announced in the xml file inconsistent with the selected image'])
-% %             end
-% %         end
-%         nom_type_ima=nom_type_read;
-%     end
 elseif strcmp(ext_imadoc,'.civ')% case of .civ image documentation file
     [error,time,TimeUnit,mode,npx,npy]=read_imatext([filebase '.civ']);
@@ -612,4 +602,5 @@
     nom_type_ima='*';
     ext_ima=ext_imadoc;
+    set(handles.mode,'Value',1);
     set(handles.mode,'String',{'series(Di)'})
     dt=0.04;%default
@@ -620,5 +611,4 @@
     end
     time=(dt*(0:nbfield-1))';%list of image times
-    %set(handles.dt,'String',num2str(dt*1000));%store the time interval between successive images
 end
 if isempty(time)
@@ -698,4 +688,5 @@
         field_i=browse.num_i1;
         field_j=browse.num_j2;
+        imagename=name_generator(filebase,field_i,field_j,ext_search,nom_type_search);
         imagename_plus='';
         jdetect=1;
@@ -716,12 +707,7 @@
     time=(0:nbfield-1)';% time=file index -1  by default
     if numel(regexp(nom_type_search,'\D'))>=1%two indices i and j
-%     switch nom_type_search  
-%         case {'_i_j','%01dA','%02dA','%03dA','%04dA'}
-        % time=[0:nb_field-1]'*ones(1,nb_field_j);% time=file index -1  by default
         [x,y]=meshgrid(0:nbfield2-1,0:nbfield-1);
         time=x+y;
-%         time=[0:nb_field-1]'*[0:nb_field_j-1];% time=file index -1  by default
-    end
-%     set(handles.mode,'String',{'series(Di)'})
+    end
 end
 
@@ -750,11 +736,11 @@
 
 %%%%%%%%%%%  set the menus of image pairs and default selection for civ   %%%%%%%%%%%%%%%%%%%
-test_ima_i=numel(nom_type_ima)>1 && isempty(regexp(nom_type_ima(2:end),'\D'));%images with single indexing
+test_ima_i=numel(nom_type_ima)>1 && isempty(regexp(nom_type_ima(2:end),'\D','once'));%images with single indexing
 if test_ima_i || isequal(nom_type_nc,'_i1-i2')||~(exist('nbfield2','var')&&(nbfield2~=1))
-    set(handles.mode,'String',{'series(Di)'})
     set(handles.mode,'Value',1)
+    set(handles.mode,'String',{'series(Di)'})   
 elseif (nbfield==1)% simple series in j
+    set(handles.mode,'Value',1)
     set(handles.mode,'String',{'series(Dj)'})
-    set(handles.mode,'Value',1)
 else
     set(handles.mode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice
@@ -788,5 +774,5 @@
 mode_Callback(hObject, eventdata, handles)
 
-%%%%%% initialize waitbars and RUN button
+%% desable status and RUN button
 % set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001])
 % set(handles.waitbar_patch1,'Position',[0.946 0.439 0.03 0.001])
@@ -797,6 +783,8 @@
 set(handles.BATCH,'Enable','On')
 set(handles.BATCH,'BackgroundColor',[1 0 0])
-
-%%%%% store the root input filename for future opening
+set(handles.status,'Value',0);%suppress status display
+status_Callback(hObject, eventdata, handles)
+
+%% store the root input filename for future opening
 dir_perso=prefdir;
 profil_perso=fullfile(prefdir,'uvmat_perso.mat');
@@ -814,6 +802,4 @@
     end
 end
-% save(profil_perso, 'filebase'); %store the root name for future opening of uvmat
-set(gcf,'Pointer','arrow')
 
 %------------------------------------------------------------------------
@@ -1565,7 +1551,8 @@
 end
 
+%------------------------------------------------------------------------
+% --- Executes on button press in RUN: processing on local computer
 function RUN_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-% global civ1_exe civ2_exe patch_exe patch_new_exe sge
 set(handles.RUN, 'Enable','Off')
 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784])
@@ -1575,9 +1562,12 @@
 set(handles.RUN,'BackgroundColor',[1 0 0])
 
+% start status callback to visualise results
+set(handles.status,'Value',1);%suppress status display
+status_Callback(hObject, eventdata, handles)
+
 %------------------------------------------------------------------------
 % --- Executes on button press in BATCH: remote processing
 function BATCH_Callback(hObject, eventdata, handles)
-%% -----------------------------------------------------------------------
-%global civ1_exe civ2_exe patch_exe patch_new_exe fix_exe todo_path sge Civ_exe % probabely to remove
+% -----------------------------------------------------------------------
 set(handles.BATCH, 'Enable','Off')
 set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])
@@ -1587,4 +1577,7 @@
 set(handles.BATCH,'BackgroundColor',[1 0 0])
 
+% start status callback to visualise results
+set(handles.status,'Value',1);%suppress status display
+status_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
 % --- Lauch command called by RUN and BATCH: remote processing
@@ -1613,5 +1606,5 @@
 end
 
-%check mask if selecetd
+%% check mask if selecetd
 if isequal(get(handles.get_mask_civ1,'Value'),1)
     maskname=get(handles.mask_civ1,'String');
@@ -1639,10 +1632,7 @@
 end
 
-%% initialize the waitbars: TO suppress, waitbar not used
-% set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001])
-% set(handles.waitbar_patch1,'Position',[0.946 0.439 0.03 0.001])
-% set(handles.waitbar_civ2,'Position',[0.946 0.219 0.03 0.001])
-% set(handles.waitbar_patch2,'Position',[0.946 0.0 0.03 0.001])
-% drawnow
+%% reinitialise status callback 
+set(handles.status,'Value',0);%suppress status display
+status_Callback(hObject, eventdata, handles)
 
 %% set the list of files and check them
@@ -1651,4 +1641,5 @@
 [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc]=...
     set_civ_filenames(handles,box_test);
+set(handles.civ,'UserData',filecell);%store for futur use of status callback
 if isempty(filecell)% (error message displayed in fct set_civ_filenames)
     return
@@ -1879,4 +1870,5 @@
         %filename_cur=filecell.nc.civ1{ifile,j};%output netcdf file
         [Rootbat,Filebat]=fileparts(filecell.nc.civ1{ifile,j});%output netcdf file (without extention)
+        flname=fullfile(Rootbat,Filebat);
         %filename_cmx(end-1:end+6)='civ1.cmx';%name of cmx file
         if batch
@@ -1884,5 +1876,5 @@
             filename_bat=fullfile(Rootbat,['job_' Filebat]);
          else
-            filename_bat=fullfile(Rootbat,Filebat);
+            filename_bat=flname;
         end
         filename_bat=[filename_bat '.bat'];
@@ -1892,5 +1884,5 @@
             par_civ1.filename_ima_a=filecell.ima1.civ1{ifile,j};
             par_civ1.filename_ima_b=filecell.ima2.civ1{ifile,j};
-            namelog=[fullfile(Rootbat,Filebat) '.civ1.log'];
+            %namelog=[fullfile(Rootbat,Filebat) '.civ1.log'];
             par_civ1.Dt=num2str(time(num2_civ1(ifile),num_b_civ1(j))-time(num1_civ1(ifile),num_a_civ1(j)));
             par_civ1.T0=num2str((time(num2_civ1(ifile),num_b_civ1(j))+time(num1_civ1(ifile),num_a_civ1(j)))/2);
@@ -2065,5 +2057,5 @@
             %par_civ2.filename_ima_b([end-3:end])=[];%remove .png extension
             [Rootbat,Filebat]=fileparts(filecell.nc.civ2{ifile,j});%output netcdf file (without extention)
-            namelog=[fullfile(Rootbat,Filebat) '.civ2.log'];
+            %namelog=[fullfile(Rootbat,Filebat) '.civ2.log'];
             par_civ2.Dt=num2str(time(num2_civ2(ifile),num_b_civ2(j))-time(num1_civ2(ifile),num_a_civ2(j)));
             par_civ2.T0=num2str((time(num2_civ1(ifile),num_b_civ2(j))+time(num1_civ2(ifile),num_a_civ2(j)))/2);
@@ -2119,7 +2111,7 @@
             %endTESTgrid
             i_cmd=i_cmd+1;
-            cmd_CIV2=CIV2_CMD(fullfile(Rootbat,Filebat),[],par_civ2,sparam);%creates the cmx file [fullfile(Rootbat,Filebat) '.civ2.cmx]
+            flname=fullfile(Rootbat,Filebat);
+            cmd_CIV2=CIV2_CMD(flname,[],par_civ2,sparam);%creates the cmx file [fullfile(Rootbat,Filebat) '.civ2.cmx]
             if isequal(civAll,0)
-                flname=fullfile(Rootbat,Filebat);
                 if(isunix)
                      cmd=[cmd 'cp -f ' flname '.civ2.cmx ' flname '.cmx\n' cmd_CIV2 '\n'];
@@ -2253,6 +2245,6 @@
                     pvalue=num2str((1-ind_answer)*500);
                     %namelog=[filename_bat '.patch.log'];
-                    display(['!qsub -p ' pvalue ' -q civ.q -e ' filename_cmx(1:end-4) '.errors -o ' filename_cmx(1:end-4) '.log' ' ' filename_bat]);
-                    eval(  ['!qsub -p ' pvalue ' -q civ.q -e ' filename_cmx(1:end-4) '.errors -o ' filename_cmx(1:end-4) '.log' ' ' filename_bat]);
+                    display(['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]);
+                    eval(  ['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]);
             end
         else
@@ -2305,4 +2297,5 @@
 end
 saveas(gcbf,namefigfull);%save the interface with name namefigfull (A CHANGER EN FICHIER  .xml)
+
 
 
@@ -4417,4 +4410,5 @@
     set(handles.RootName_1,'String',[]);
     mode_store=get(handles.compare,'UserData');
+    set(handles.mode,'Value',1)
     set(handles.mode,'String',mode_store)
     set(handles.test_stereo1,'Value',0)
@@ -4603,7 +4597,127 @@
 end
 
-
-
-
-
-
+%-------------------------------------------------------------------
+% --- Executes on button press in status.
+function status_Callback(hObject, eventdata, handles)
+%-------------------------------------------------------------------
+val=get(handles.status,'Value');
+if val==0
+    hfig=findobj(allchild(0),'name','civ_status');
+    if ~isempty(hfig)
+        delete(hfig)
+    end
+    return
+end
+listtype={'civ1','fix1','patch1','civ2','fix2','patch2'};
+box_test(1)=get(handles.CIV1,'Value');
+box_test(2)=get(handles.FIX1,'Value');
+box_test(3)=get(handles.PATCH1,'Value');
+box_test(4)=get(handles.CIV2,'Value');
+box_test(5)=get(handles.FIX2,'Value');
+box_test(6)=get(handles.PATCH2,'Value');
+option=listtype{max(box_test(find(box_test)))};
+filecell=get(handles.civ,'UserData');
+if ~isfield(filecell,'nc')
+    filecell=set_civ_filenames(handles,box_test);%determine the list of output files expected from the GUI status
+end
+
+if ~isequal(box_test(4:6),[0 0 0])
+    civ_files=filecell.nc.civ2;
+else
+    civ_files=filecell.nc.civ1;
+end
+[root,filename,ext]=fileparts(civ_files{1});
+[rootroot,subdir,extdir]=fileparts(root);
+hfig=findobj(allchild(0),'name','civ_status');
+if isempty(hfig)
+    hfig=figure;
+    set(hfig,'name','civ_status')
+    hlist=uicontrol('Style','listbox','Units','normalized', 'Position',[0.05 0.05 0.9 0.75], 'Callback', @open_view_field,'tag','list');
+    uicontrol('Style','listbox','Units','normalized', 'Position', [0.05 0.87 0.9 0.1],'tag','msgbox');
+    uicontrol('Style','frame','Units','normalized', 'Position', [0.05 0.81 0.9 0.05]);
+    BarPosition=[0.05 0.81 0.01 0.05];
+    hwaitbar=uicontrol('Style','frame','Units','normalized', 'Position',BarPosition ,'BackgroundColor',[1 0 0],'tag','waitbar');
+end
+datnum=[];
+Tabchar={};
+nbfiles=numel(civ_files);
+count=0;
+while count<nbfiles
+    count=0;
+    for ifile=1:nbfiles
+        detect=exist(civ_files{ifile},'file'); % check the existence of the file
+        if detect==0
+            lastfield='not created';
+        else
+            datfile=dir(civ_files{ifile});
+            datnum(ifile)=datenum(datfile.date);
+            filefound(ifile)={datfile.name};
+            lastfield='';
+            % check the content  netcdf file
+            Data=nc2struct(civ_files{ifile},'ListGlobalAttribute','patch2','fix2','civ2','patch','fix');
+            if ~isempty(Data.patch2) && isequal(Data.patch2,1)
+                lastfield='patch2';
+            elseif ~isempty(Data.fix2) && isequal(Data.fix2,1)
+                lastfield='fix2';
+            elseif ~isempty(Data.civ2) && isequal(Data.civ2,1);
+                lastfield='civ2';
+            elseif ~isempty(Data.patch) && isequal(Data.patch,1);
+                lastfield='patch1';
+            elseif ~isempty(Data.fix) && isequal(Data.fix,1);
+                lastfield='fix1';
+            else
+                lastfield='civ1';
+            end
+        end
+        if strcmp(lastfield,option)
+            count=count+1;
+        end
+        [rr,filename,ext]=fileparts(civ_files{ifile});
+        Tabchar{ifile,1}=[fullfile([subdir extdir],filename) ext  '...' lastfield];
+    end
+    if isempty(datnum)
+         message='no civ result created yet';
+    else
+        datnum=datnum(find(datnum));%keep the non zero values corresponding to existing files
+        [first,ind]=min(datnum);
+        [last,indlast]=max(datnum);
+        message={[num2str(count) ' file(s) done over ' num2str(nbfiles)] ;['oldest modification:  ' cell2mat(filefound(ind)) ' : ' datestr(first)];...
+            ['latest modification:  ' cell2mat(filefound(indlast)) ' : ' datestr(last)]};
+    end
+    hfig=findobj(allchild(0),'name','civ_status');
+    if isempty(hfig)
+        set(handles.status,'Value',0)%stop program if the figure has been suppressed
+        return
+    else
+        hlist=findobj(hfig,'tag','list');
+        hmsgbox=findobj(hfig,'tag','msgbox');
+        hwaitbar=findobj(hfig,'tag','waitbar');
+        set(hlist,'String',Tabchar)
+        set(hmsgbox,'String', message)
+        if count>0
+            BarPosition(3)=0.9*count/nbfiles;
+            set(hwaitbar,'Position',BarPosition)
+        end
+    end
+    set(hlist,'UserData',rootroot)
+    pause(5)% wait 5 seconds for next check
+end
+
+    
+%-------------------------------------------------------------------   
+% call 'view_field.fig' to display the selected field
+function open_view_field(hObject, eventdata)
+%-------------------------------------------------------------------
+     list=get(gcbo,'String');
+     index=get(gcbo,'Value');
+     rootroot=get(gcbo,'UserData');
+     filename=list{index};
+     ind_dot=findstr(filename,'...');
+     filename=filename(1:ind_dot-1);
+      filename=fullfile(rootroot,filename);
+      if exist(filename,'file')%visualise the vel field if it exists
+        [Field,VelTypeOut]=read_civxdata(filename);
+        view_field(Field)
+      end
+
+
Index: /trunk/src/geometry_calib.m
===================================================================
--- /trunk/src/geometry_calib.m	(revision 176)
+++ /trunk/src/geometry_calib.m	(revision 177)
@@ -974,4 +974,10 @@
 if choice
     set(handles.edit_append,'BackgroundColor',[1 1 0])
+    huvmat=findobj(allchild(0),'tag','uvmat');
+    if ishandle(huvmat)
+        hhuvmat=guidata(huvmat);
+        set(hhuvmat.edit_object,'Value',0)
+        set(hhuvmat.edit_object,'BackgroundColor',[0.7 0.7 0.7])
+    end
 else
     set(handles.edit_append,'BackgroundColor',[0.7 0.7 0.7]) 
Index: /trunk/src/mouse_down.m
===================================================================
--- /trunk/src/mouse_down.m	(revision 176)
+++ /trunk/src/mouse_down.m	(revision 177)
@@ -24,5 +24,4 @@
 function xy=mouse_down(hObject,eventdata)
 
-%MouseAction='none'; %default
 huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle which controls theoption of  mouse action
 if isempty(huvmat)
@@ -31,19 +30,9 @@
 hhuvmat=guidata(huvmat);%handles of elements in uvmat
 UvData=get(huvmat,'UserData');
-%MouseAction='none'; %default
 currentfig=hObject;
 hhcurrentfig=guidata(currentfig);
 test_zoom=get(hhcurrentfig.zoom,'Value');%test for zoom action, first priority
-% if isfield(UvData,'MouseAction')
-%     MouseAction=UvData.MouseAction;% get the mouse action from the uvmat GUI: options:
-% end
-
-%test_cal=get(handles.cal,'Value');
-% test_cal=strcmp(MouseAction,'calib');
-test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler  action, second priority
-%test_ruler=strcmp(MouseAction,'ruler');
-%test_edit=strcmp(MouseAction,'edit_object');
+test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler  action, second priority;
 test_edit=get(hhuvmat.edit_object,'Value');%test for object editing, third priority
-%test_edit_vect=strcmp(MouseAction,'edit_vect');%test for vector editing,  priority 4
 test_edit_vect=get(hhuvmat.edit_vect,'Value');%test for vector editing,  priority 4
 test_create=isequal(get(hhuvmat.MenuObject,'checked'),'on');% test for object creation,  priority 5
@@ -63,14 +52,13 @@
     end
 end
-%test_create=~test_zoom && strcmp(MouseAction,'create_object')&&~test_edit && ~test_edit_vect ;% || isequal(MouseAction,'create_mask'));
 xdisplay=[];%default
 ydisplay=[];%default
 AxeData=[];%default
 
-%% edit an existing point or line if found
+%% determine the currently selected items
 hcurrentobject=gco;% current object handle (selected by the mouse)
 hcurrentfig=hObject;% current figure handle
 fig_tag=get(hcurrentfig,'Tag');
-tag_obj=get(gco,'Tag');
+tag_obj=get(gco,'Tag');%tag of the currently selected object
 xy=[];%default
 xy_fig=get(hcurrentfig,'CurrentPoint');% current point of the current figure (gcbo)
@@ -367,5 +355,5 @@
     end
     if isequal(Field.FF(ivec),0)
-        Field.FF(ivec)=100 %mark vector #ivec as false
+        Field.FF(ivec)=100; %mark vector #ivec as false
     else
         Field.FF(ivec)=0;
Index: /trunk/src/plot_object.m
===================================================================
--- /trunk/src/plot_object.m	(revision 176)
+++ /trunk/src/plot_object.m	(revision 177)
@@ -92,11 +92,11 @@
 
 %% default input parameters
-if ~isfield(ObjectData,'ProjMode')|isempty(ObjectData.ProjMode)
+if ~isfield(ObjectData,'ProjMode')||isempty(ObjectData.ProjMode)
      ObjectData.ProjMode='projection';%default
 end
-if ~isfield(ObjectData,'Coord')|isempty(ObjectData.Coord)
+if ~isfield(ObjectData,'Coord')||isempty(ObjectData.Coord)
      ObjectData.Coord=[0 0 0];%default
 end
-if ~isfield(ObjectData,'Phi')|isempty(ObjectData.Phi)
+if ~isfield(ObjectData,'Phi')||isempty(ObjectData.Phi)
      ObjectData.Phi=0;%default
 end
@@ -131,5 +131,5 @@
     YMax=max(XMax,YMax);
     YMax=max(YMax,ZMax);
-elseif isequal(ObjectData.Style,'rectangle')|isequal(ObjectData.Style,'ellipse')|isequal(ObjectData.Style,'volume')
+elseif isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'ellipse')||isequal(ObjectData.Style,'volume')
     if  isequal(YMax,0)
         ylim=get(haxes,'YLim');
@@ -159,8 +159,9 @@
     xline=ObjectData.Coord(:,1);
     yline=ObjectData.Coord(:,2);
+    nbpoints=numel(xline);
     if isequal(ObjectData.Style,'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.Style,'plane')|| isequal(ObjectData.Style,'volume') 
         phi=ObjectData.Phi*pi/180;%angle in radians
         Xend_x=xline(1)+XMax*cos(phi);
@@ -180,8 +181,8 @@
             SubLineStyle='--'; %range of projection marked by dash
             if isfield (ObjectData,'DX')
-               rmfield(ObjectData,'DX');
+               ObjectData=rmfield(ObjectData,'DX');
             end
             if isfield (ObjectData,'DY')
-               rmfield(ObjectData,'DY');
+               ObjectData=rmfield(ObjectData,'DY');
             end
         elseif isequal(ObjectData.ProjMode,'filter')
@@ -189,5 +190,5 @@
         end
     end 
-    if isequal(ObjectData.Style,'line')|isequal(ObjectData.Style,'polyline')|isequal(ObjectData.Style,'polygon')
+    if isequal(ObjectData.Style,'line')||isequal(ObjectData.Style,'polyline')||isequal(ObjectData.Style,'polygon')
         if length(xline)<2
             theta=0;
@@ -223,6 +224,6 @@
         scale_x=2*1.4*XMax/npMx;
         scale_y=2*1.4*YMax/npMy;
-        xi=[0.5:npMx-0.5]*scale_x+xlim(1);
-        yi=[0.5:npMy-0.5]*scale_y+ylim(1);
+        xi=(0.5:npMx-0.5)*scale_x+xlim(1);
+        yi=(0.5:npMy-0.5)*scale_y+ylim(1);
         [Xi,Yi]=meshgrid(xi,yi);
         X2Max=XMax*XMax;
@@ -231,5 +232,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.Style,'rectangle')||isequal(ObjectData.Style,'volume')
         XimaMin=ObjectData.Coord(1,1)-XMax;
         XimaMax=ObjectData.Coord(1,1)+XMax;
@@ -240,6 +241,6 @@
         scale_x=2*1.4*XMax/npMx;
         scale_y=2*1.4*YMax/npMy;
-        xi=[0.5:npMx-0.5]*scale_x+xlim(1);
-        yi=[0.5:npMy-0.5]*scale_y+ylim(1);
+        xi=(0.5:npMx-0.5)*scale_x+xlim(1);
+        yi=(0.5:npMy-0.5)*scale_y+ylim(1);
         [Xi,Yi]=meshgrid(xi,yi);
         distX=abs(Xi-ObjectData.Coord(1,1));
@@ -270,4 +271,5 @@
 
 PlotData=[];%default
+
 %% MODIFY AN EXISTING OBJECT PLOT
 if test_newobj==0;
@@ -301,11 +303,11 @@
            for ipt=1:length(PlotData.DeformPoint)
                if ishandle(PlotData.DeformPoint(ipt))
-                   if length(xline)>=ipt &   length(yline)>=ipt    
+                   if nbpoints>=ipt  
                         set(PlotData.DeformPoint(ipt),'XData',xline(ipt),'YData',yline(ipt));
                     end
                end
            end
-           if length(xline)>length(PlotData.DeformPoint)
-               for ipt=length(PlotData.DeformPoint)+1:length(xline)
+           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);
@@ -314,5 +316,5 @@
            end
         end
-    elseif isequal(ObjectData.Style,'rectangle')|isequal(ObjectData.Style,'ellipse')
+    elseif isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'ellipse')
         set(hplot,'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax])          
     end
@@ -334,5 +336,5 @@
     hother=findobj('Tag','proj_object');%find all the proj objects
     for iobj=1:length(hother)
-        if isequal(get(hother(iobj),'Type'),'rectangle')|isequal(get(hother(iobj),'Type'),'patch')
+        if strcmp(get(hother(iobj),'Type'),'rectangle')|| strcmp(get(hother(iobj),'Type'),'patch')
             set(hother(iobj),'EdgeColor','b')
             if isequal(get(hother(iobj),'FaceColor'),'m')
@@ -363,19 +365,19 @@
               end
         end
-    elseif  isequal(ObjectData.Style,'line')|isequal(ObjectData.Style,'polyline')|...        
-          isequal(ObjectData.Style,'polygon') |isequal(ObjectData.Style,'plane')|isequal(ObjectData.Style,'volume')%  (isequal(ObjectData.Style,'polygon') & ~test_patch) |isequal(ObjectData.Style,'plane')
+    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')
         hh=line(xline,yline,'Color',col);
-        if ~isequal(ObjectData.Style,'plane')& ~isequal(ObjectData.Style,'volume')
+        if ~strcmp(ObjectData.Style,'plane') && ~strcmp(ObjectData.Style,'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');
             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);
             end
-            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');
         end
     
-    elseif isequal(ObjectData.Style,'rectangle')
+    elseif strcmp(ObjectData.Style,'rectangle')
         hh=rectangle('Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col);   
-    elseif isequal(ObjectData.Style,'ellipse')
+    elseif strcmp(ObjectData.Style,'ellipse')
         hh=rectangle('Curvature',[1 1],'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col);
     else
@@ -387,5 +389,5 @@
         hold on
         hhh=image([xlim(1)+dx/2 xlim(2)-dx/2],[ylim(1)+dy/2 ylim(2)-dy/2],imflag,'Tag','proj_object','HitTest','off');
-        set(hhh,'AlphaData',(flag)*0.2)
+        set(hhh,'AlphaData',(flag)*0.2)% set partial transparency to the filling color
         PlotData.SubObject=hhh;    
     end
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 176)
+++ /trunk/src/uvmat.m	(revision 177)
@@ -264,17 +264,17 @@
           set(handles.MenuFile_1_1,'Label',h.MenuFile_1);
       end
-      if isfield(h,'MenuFile_1')
+      if isfield(h,'MenuFile_2')
           set(handles.MenuFile_2,'Label',h.MenuFile_2);
           set(handles.MenuFile_2_1,'Label',h.MenuFile_2);
       end
-      if isfield(h,'MenuFile_1')
+      if isfield(h,'MenuFile_3')
           set(handles.MenuFile_3,'Label',h.MenuFile_3);
           set(handles.MenuFile_3_1,'Label',h.MenuFile_3);
       end
-      if isfield(h,'MenuFile_1')
+      if isfield(h,'MenuFile_4')
           set(handles.MenuFile_4,'Label',h.MenuFile_4);
           set(handles.MenuFile_4_1,'Label',h.MenuFile_4);
       end
-      if isfield(h,'MenuFile_1')
+      if isfield(h,'MenuFile_5')
           set(handles.MenuFile_5,'Label',h.MenuFile_5);
           set(handles.MenuFile_5_1,'Label',h.MenuFile_5);
@@ -282,15 +282,17 @@
       if isfield(h,'transform_fct') && iscell(h.transform_fct)
          for ilist=1:length(h.transform_fct);
-             [path,file]=fileparts(h.transform_fct{ilist});
-             addpath(path)
-             if exist(file,'file')
+             if exist(h.transform_fct{ilist},'file')
+                [path,file]=fileparts(h.transform_fct{ilist});
+                addpath(path)
+%              if exist(file,'file')
                 h_func=str2func(file);
+                rmpath(path)
                 testexist=[testexist 1]; 
              else
+                file='';
                 h_func=[];
                 testexist=[testexist 0]; 
              end
              fct_handle=[fct_handle; {h_func}]; %concatene the list of paths
-             rmpath(path)
              menu_str=[menu_str; {file}]; 
          end
@@ -4413,4 +4415,10 @@
     set(handles.zoom,'Value',0)
     zoom_Callback(hObject, eventdata, handles)
+    hgeometry_calib=findobj(allchild(0),'tag','geometry_calib');
+    if ishandle(hgeometry_calib)
+        hhgeometry_calib=guidata(hgeometry_calib);
+        set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib
+        set(hhgeometry_calib.edit_append,'BackgroundColor',[0.7 0.7 0.7])
+    end
 else 
     UvData.MouseAction='none';
@@ -5075,4 +5083,10 @@
     delete(hset_object)% delete existing version of set_object
 end
+hgeometry_calib=findobj(allchild(0),'tag','geometry_calib');
+if ishandle(hgeometry_calib)
+    hhgeometry_calib=guidata(hgeometry_calib);
+    set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib
+    set(hhgeometry_calib.edit_append,'BackgroundColor',[0.7 0.7 0.7])
+end
 UvData=get(handles.uvmat,'UserData');
 set(handles.edit_object,'Value',0); %suppress the object edit mode
