Index: /trunk/src/check_files.m
===================================================================
--- /trunk/src/check_files.m	(revision 622)
+++ /trunk/src/check_files.m	(revision 623)
@@ -47,5 +47,4 @@
     'create_grid';...% called by the GUI geometry_calib to create a physical grid
     'create_grid.fig';...% GUI corresponding to create_grid.m
-    'delete_object';...%delete a projection object, defined by its index in the Uvmat list or by its graphic handle
     'displ_uvmat';...
     'editxml';...%display and edit xml files using a xls schema
Index: /trunk/src/civ.m
===================================================================
--- /trunk/src/civ.m	(revision 622)
+++ /trunk/src/civ.m	(revision 623)
@@ -1730,5 +1730,5 @@
 [tild,message]=fileattrib(RootPath);
 if ~isempty(message) && ~isequal(message.UserWrite,1)
-    errormsg=['No writting access to ' RootPath];
+    errormsg=['No writing access to ' RootPath];
     return
 end
@@ -2001,5 +2001,5 @@
                     errormsg=['cannot create ' subdir_civ1_new ': ' msg1];
                     return
-                else
+                elseif isunix
                     [xx,msg2] = fileattrib(fullfile(RootPath,subdir_civ1_new),'+w','g'); %yield writing access (+w) to user group (g)
                     if ~strcmp(msg2,'')
@@ -2116,8 +2116,10 @@
         if ~exist(fullfile(RootPath,subdir_civ2_new),'dir')
             [xx,m2]=mkdir(fullfile(RootPath,subdir_civ2_new));
+            if isunix
             [xx,msg2] = fileattrib(fullfile(RootPath,subdir_civ2_new),'+w','g'); %yield writing access (+w) to user group (g)
             if ~isequal(m2,'')
                 errormsg=['cannot create ' fullfile(RootPath,subdir_civ2_new) ': ' m2];
                 return
+            end
             end
         end
@@ -2148,8 +2150,10 @@
             if ~exist(fullfile(RootPath,subdir_civ2_new),'dir')
                 [xx,m2]=mkdir(subdir_civ2_new);
+                if isunix
                  [xx,msg2] = fileattrib(fullfile(RootPath,subdir_civ2_new),'+w','g'); %yield writing access (+w) to user group (g)
                 if ~isequal(m2,'')
                     errormsg= ['cannot create ' fullfile(RootPath,subdir_civ2_new) ': ' m2];%error message for directory creation
                     return
+                end
                 end
             end
@@ -4128,5 +4132,7 @@
     case {'civ_matlab','civ_matlab.sh'}
         filename=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml');
+        if isunix
         fileattrib(fileparts(filename),'+w +x','o g');% set writting access
+        end
         save(struct2xml(Param),filename);
 end
Index: /trunk/src/displ_uvmat.m
===================================================================
--- /trunk/src/displ_uvmat.m	(revision 622)
+++ /trunk/src/displ_uvmat.m	(revision 623)
@@ -5,5 +5,5 @@
 function displ_uvmat(title,display_str,Position)
 if isequal(Position,0)
-    display([title ': ' display_str])
+    disp([title ': ' display_str])
 else
     msgbox_uvmat(title,display_str,'',Position)
Index: /trunk/src/mouse_down.m
===================================================================
--- /trunk/src/mouse_down.m	(revision 622)
+++ /trunk/src/mouse_down.m	(revision 623)
@@ -200,5 +200,5 @@
 
 %% creation of a zoom subfig
-if get(hhcurrentfig.CheckZoomFig,'Value')
+if isfield(hhcurrentfig,'CheckZoomFig') && get(hhcurrentfig.CheckZoomFig,'Value')
     AxeData.Drawing='zoom'; %initiate drawing mode
     AxeData.CurrentObject=[];%unselect objects
Index: /trunk/src/mouse_up.m
===================================================================
--- /trunk/src/mouse_up.m	(revision 622)
+++ /trunk/src/mouse_up.m	(revision 623)
@@ -171,6 +171,6 @@
         end
     else
-        test_drawing=1;%allow continuation of drawing object
-         AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the next current origin
+%         test_drawing=1;%allow continuation of drawing object
+%          AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the next current origin
     end
     UvData.ProjObject{IndexObj}=ObjectData;
Index: /trunk/src/series.m
===================================================================
--- /trunk/src/series.m	(revision 622)
+++ /trunk/src/series.m	(revision 623)
@@ -606,11 +606,11 @@
     MinIndex_j=1;% index j set to 1 by default
     MaxIndex_j=1;
-    MinIndex_i=find(i1_series(:,2,:), 1 )-1;
-    MaxIndex_i=find(i1_series(:,2,:), 1, 'last' )-1;
+    MinIndex_i=find(i1_series(:,2,:), 1 )-1;% min ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index) 
+    MaxIndex_i=find(i1_series(:,2,:), 1, 'last' )-1;%max ref index i detected in the series (corresponding to the last non-zero value of i1_series) 
 else
     pair_max=squeeze(max(i1_series,[],1)); %max on pair index
     j_max=max(pair_max,[],1);
-    MaxIndex_i=find(j_max, 1, 'last' )-1;% max ref index i
-    MinIndex_i=find(j_max, 1 )-1;% min ref index i
+    MinIndex_i=find(j_max, 1 )-1;% min ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index)
+    MaxIndex_i=find(j_max, 1, 'last' )-1;% max ref index i detected in the series (corresponding to the first non-zero value of i1_series, except for zero index) 
     diff_i_max=diff(j_max);
     if ~isempty(diff_i_max) && isequal (diff_i_max,diff_i_max(1)*ones(size(diff_i_max)))
@@ -618,6 +618,6 @@
     end
     i_max=max(pair_max,[],2);
-    MaxIndex_j=max(find(i_max))-1;% max ref index i
-    MinIndex_j=min(find(i_max))-1;% min ref index i
+    MinIndex_j=min(find(i_max))-1;% min ref index j
+    MaxIndex_j=max(find(i_max))-1;% max ref index j
     diff_j_max=diff(i_max);
     if isequal (diff_j_max,diff_j_max(1)*ones(size(diff_j_max)))
@@ -832,18 +832,18 @@
 update_mode(handles,i1_series,i2_series,j1_series,j2_series,Time)
 
-%% enable j index visibilitycellfun(@isempty,regexp(PairString,'^j'))
-check_jindex=~cellfun(@isempty,SeriesData.j1_series); %look for non empty j indices
-if isempty(find(check_jindex))
-    enable_j(handles,'off') % no j index needed
-else
-    PairString=get(handles.PairString,'Data');
-    % ~cellfun(@isempty,regexp(PairString,'^j'): gives 1 when the pair string begins by 'j' (burst case)
-    % cellfun(@isempty,PairString): gives 1 when the pair string is empty
-    if isempty(find(~cellfun(@isempty,regexp(PairString,'^j'))&cellfun(@isempty,PairString)))% if all pair string begins by j (burst) or empty
-        enable_j(handles,'off') % no j index needed
-    else
-        enable_j(handles,'on')
-    end
-end
+%% enable j index visibility
+%check_jindex=~isempty(find(~cellfun(@isempty,SeriesData.j1_series))); %look for non empty j indices
+status_j='on';%default
+if isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)); % case of empty j indices
+    status_j='off'; % no j index needed
+elseif strcmp(get(handles.PairString,'Visible'),'on')
+        PairString=get(handles.PairString,'Data');       
+        check_burst=cellfun(@isempty,regexp(PairString,'^j'));%=0 for burst case, 1 otherwise
+ %   check_nopair=cellfun(@isempty,PairString);
+    if isempty(find(check_burst))% if all pair string begins by j (burst) 
+        status_j='off'; % no j index needed for bust case
+    end
+end
+enable_j(handles,status_j) % no j index needed
 
 %% display the set of existing files as an image
@@ -1470,6 +1470,6 @@
 %% direct processing on the current Matlab session
 if strcmp (RunMode,'local')
-    Series.RUNHandle=handles.RUN;
-    Series.WaitbarHandle=handles.Waitbar;
+%     Series.RUNHandle=handles.RUN;
+%     Series.WaitbarHandle=handles.Waitbar;
     for iprocess=1:NbProcess
         if isempty(Series.IndexRange.NbSlice)
Index: /trunk/src/update_waitbar.m
===================================================================
--- /trunk/src/update_waitbar.m	(revision 622)
+++ /trunk/src/update_waitbar.m	(revision 623)
@@ -6,5 +6,5 @@
 
 function update_waitbar(hwaitbar,advance_ratio)
-
+if ishandle(hwaitbar)
 set(hwaitbar,'Units','pixels')
 pos=get(hwaitbar,'Position');%read waitbar position in pixels
@@ -15,2 +15,3 @@
 set(hwaitbar,'CData',CData)
 drawnow
+end
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 622)
+++ /trunk/src/uvmat.m	(revision 623)
@@ -3470,9 +3470,9 @@
 if isequal(get(handles.VOLUME,'Value'),1)
     set(handles.CheckZoom,'Value',0)
-    set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
+%     set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
     set(handles.edit_vect,'Value',0)
     edit_vect_Callback(hObject, eventdata, handles)
     set(handles.edit_object,'Value',0)
-    set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
+%     set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
 %     set(handles.cal,'Value',0)
 %     set(handles.cal,'BackgroundColor',[0 1 0])
@@ -3522,6 +3522,6 @@
     set(handles.edit_object,'Value',0)
     set(handles.CheckZoom,'Value',0)
-    set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
-    set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
+%     set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])
+%     set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
     set(gcf,'Pointer','arrow')
 else
@@ -4160,5 +4160,5 @@
 %  desactivate the edit object mode
 set(handles.edit_object,'Value',0) 
-set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
+% set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
 
 %------------------------------------------------------------------------
@@ -4186,5 +4186,5 @@
 %%  desactivate the edit object mode
 set(handles.edit_object,'Value',0) 
-set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
+% set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
 
 %% update the  plot on view_field if view_field is already openened
@@ -4275,5 +4275,5 @@
 hset_object=findobj(allchild(0),'Tag','set_object');
 if get(handles.edit_object,'Value')
-    set(handles.edit_object,'BackgroundColor',[1,1,0])  
+%     set(handles.edit_object,'BackgroundColor',[1,1,0])  
     %suppress the other options 
     set(handles.CheckZoom,'Value',0)
@@ -4288,5 +4288,5 @@
     ViewObject_Callback(hObject, eventdata, handles)
 else % desctivate object edit mode
-    set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])  
+%     set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])  
     if ~isempty(hset_object)% open the 
         hhset_object=guidata(hset_object);
@@ -4862,5 +4862,5 @@
 set(get(hset_object,'children'),'enable','on')% enable edit action on elements on GUI set_object
 set(handles.edit_object,'Value',0); %suppress the object edit mode
-set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])  
+% set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7])  
 set(handles.delete_object,'Visible','on')
 
@@ -5167,5 +5167,5 @@
 set(handles.edit_vect,'Value',0)
 edit_vect_Callback(hObject, eventdata, handles)
-set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
+% set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7])
 set(handles.ListObject,'Value',1)      
 
