Index: /trunk/src/series.m
===================================================================
--- /trunk/src/series.m	(revision 522)
+++ /trunk/src/series.m	(revision 523)
@@ -110,4 +110,10 @@
     end
 end  
+if isfield(param,'incr_i')
+    set(handles.num_incr_i,'String',num2str(param.incr_i))
+end
+if isfield(param,'incr_j')
+    set(handles.num_incr_j,'String',num2str(param.incr_j))
+end
 
 %% fields input initialisation
@@ -132,5 +138,5 @@
 
 %% TRANSFORM menu: loads the information stored in prefdir to initiate  the list of field transform functions
-menu_str={'';'phys';'px';'phys_polar'};
+menu_str={'';'sub_field';'phys';'phys_polar'};
 nb_builtin_transform=numel(menu_str); %number of functions
 [path_uvmat,name,ext]=fileparts(which('uvmat'));
@@ -148,5 +154,5 @@
 rmpath(fullfile(path_uvmat,'transform_field'))
 
-%% read the list of functions stored in the personal file 'uvmat_perso.mat' in prefdir
+%% read the list of transform functions stored in the personal file 'uvmat_perso.mat' in prefdir
 if test_profil_perso
     if isfield(h,'series_fct') && iscell(h.series_fct)
@@ -214,13 +220,4 @@
     set(handles.RunMode,'String',{'local';'background';'cluster'})
 end
-% if isfield(sparam.RunParam,'CivBin')
-%     if ~exist(sparam.RunParam.CivBin,'file')
-%         sparam.RunParam.CivBin=fullfile(path_uvmat,sparam.RunParam.CivBin);
-%     end
-% else
-%     sparam.RunParam.CivBin='';
-% end
-% display the GUI for the default actionname 'check_data_files'
-% ActionName_Callback(hObject, eventdata, handles) 
 
 %------------------------------------------------------------------------
@@ -596,23 +593,4 @@
 MaxIndex_j=max(find(i_max))-1;% max ref index i
 MinIndex_j=min(find(i_max))-1;% min ref index i
-% i2_min=[];
-% if ~isempty(i2_series)
-%     i2_min=i2_series(1,2,2);
-% end
-% j1_min=[];
-% if ~isempty(j1_series)
-%     j1_min=j1_series(1,2,2);
-% end
-% j2_min=[];
-% if ~isempty(j2_series)
-%     j2_min=j2_series(1,2,2);
-% end
-% if isequal(MinIndex_i,1) &&...
-%         exist (fullfile_uvmat(InputTable{iview,1},InputTable{iview,2},InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},0,i2_min, j1_min,j2_min),'file')
-%     MinIndex_i=0;
-% end
-% j_sum=sum(sum(j1_series,1),1);
-% MaxIndex_j=max(find(j_sum>0))-1;
-% MinIndex_j=min(find(j_sum>0))-1;
 MinIndex=get(handles.MinIndex,'Data');%retrieve the min indices in the table MinIndex
 MaxIndex=get(handles.MaxIndex,'Data');%retrieve the max indices in the table MaxIndex
@@ -724,31 +702,31 @@
 %% update time table
 if ~isempty(time)
-TimeTable=get(handles.TimeTable,'Data');
-first_i=str2num(get(handles.num_first_i,'String'));
-last_i=str2num(get(handles.num_last_i,'String'));
-first_j=str2num(get(handles.num_first_j,'String'));
-last_j=str2num(get(handles.num_last_j,'String'));
-MinIndexTable=get(handles.MinIndex,'Data');
-MinIndex_i=MinIndexTable{iview,1};
-MinIndex_j=MinIndexTable{iview,2};
-MaxIndexTable=get(handles.MaxIndex,'Data');
-MaxIndex_i=MaxIndexTable{iview,1};
-MaxIndex_j=MaxIndexTable{iview,2};
-if isempty(MinIndex_j)
-    if MinIndex_i>0
-    TimeTable{iview,1}=time(MinIndex_i);
-    end
-    TimeTable{iview,2}=time(first_i);
-    TimeTable{iview,3}=time(last_i);
-    TimeTable{iview,4}=time(MaxIndex_i);
-elseif ~isempty(time)
-    if MinIndex_i>0
-    TimeTable{iview,1}=time(MinIndex_i,MinIndex_j);
-    end
-    TimeTable{iview,2}=time(first_i,first_j);
-    TimeTable{iview,3}=time(last_i,last_j);
-    TimeTable{iview,4}=time(MaxIndex_i,MaxIndex_j);
-end
-set(handles.TimeTable,'Data',TimeTable)
+    TimeTable=get(handles.TimeTable,'Data');
+    first_i=str2num(get(handles.num_first_i,'String'));
+    last_i=str2num(get(handles.num_last_i,'String'));
+    first_j=str2num(get(handles.num_first_j,'String'));
+    last_j=str2num(get(handles.num_last_j,'String'));
+    MinIndexTable=get(handles.MinIndex,'Data');
+    MinIndex_i=MinIndexTable{iview,1};
+    MinIndex_j=MinIndexTable{iview,2};
+    MaxIndexTable=get(handles.MaxIndex,'Data');
+    MaxIndex_i=MaxIndexTable{iview,1};
+    MaxIndex_j=MaxIndexTable{iview,2};
+    if isempty(MinIndex_j)
+        if MinIndex_i>0
+            TimeTable{iview,1}=time(MinIndex_i);
+        end
+        TimeTable{iview,2}=time(first_i);
+        TimeTable{iview,3}=time(last_i);
+        TimeTable{iview,4}=time(MaxIndex_i);
+    elseif ~isempty(time)
+        if MinIndex_i>0
+            TimeTable{iview,1}=time(MinIndex_i,MinIndex_j);
+        end
+        TimeTable{iview,2}=time(first_i,first_j);
+        TimeTable{iview,3}=time(last_i,last_j);
+        TimeTable{iview,4}=time(MaxIndex_i,MaxIndex_j);
+    end
+    set(handles.TimeTable,'Data',TimeTable)
 end
 
@@ -802,7 +780,9 @@
 xI=0.5:Position(3)-0.5;
 nbview=numel(SeriesData.i1_series);
+pair_max=cell(1,nbview);
 for iview=1:nbview
-    index_min(iview)=min(find(SeriesData.i1_series{iview}(1,2:end,2:end)>0));
-    index_max(iview)=max(find(SeriesData.i1_series{iview}(1,2:end,2:end)>0));
+    pair_max{iview}=squeeze(max(SeriesData.i1_series{iview},[],1)); %max on pair index
+    index_min(iview)=find(pair_max{iview}>0, 1 );
+    index_max(iview)=find(pair_max{iview}>0, 1, 'last' );
 end
 index_min=min(index_min);
@@ -818,5 +798,5 @@
     ind_y=1+(iview-1)*range_y:iview*range_y;
     LineData=zeros(1,range_index);
-    x_index=find(SeriesData.i1_series{iview}(1,2:end,2:end)>0)-index_min+1;
+    x_index=find(pair_max{iview}>0)-index_min+1;
     LineData(x_index)=1;
     LineData=interp1(x,LineData,xI,'nearest');
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 522)
+++ /trunk/src/uvmat.m	(revision 523)
@@ -207,8 +207,9 @@
 transform_menu={'';'sub_field';'phys';'phys_polar'};
 UvData.OpenParam.NbBuiltin=numel(transform_menu); %number of functions
-path_list=(num2cell(blanks(UvData.OpenParam.NbBuiltin)))';%initialize a cell array of nbvar blanks
 transform_path=fullfile(path_uvmat,'transform_field');
 path_list{1}='';
-path_list(2:end)=regexprep(path_list(2:end),' ',transform_path); % set transform_path to the path_list
+for ilist=2:UvData.OpenParam.NbBuiltin
+path_list{ilist}=transform_path; % set transform_path to the path_list
+end
 
 %% load the list of previously browsed files in menus Open, Open_1 and transform_fct
@@ -217,5 +218,5 @@
  if exist(profil_perso,'file')
      h=load (profil_perso);
-     if isfield(h,'MenuFile')
+     if isfield(h,'MenuFile')% load the menu of previously opened files
          for ifile=1:min(length(h.MenuFile),5)
              eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',h.MenuFile{ifile});'])
@@ -223,5 +224,5 @@
          end
      end
-     if isfield(h,'transform_fct') && iscell(h.transform_fct)
+     if isfield(h,'transform_fct') && iscell(h.transform_fct) % load the menu of transform fct set by user
          for ilist=1:length(h.transform_fct);
              if exist(h.transform_fct{ilist},'file')
@@ -233,7 +234,7 @@
      end
  end
-transform_menu=[transform_menu;{'more...'}];
-set(handles.transform_fct,'String',transform_menu)
-set(handles.transform_fct,'UserData',path_list)% store the list of path in UserData of ACTION
+transform_menu=[transform_menu;{'more...'}];%append the option more.. to the menu
+set(handles.transform_fct,'String',transform_menu)% display the menu of transform fcts
+set(handles.transform_fct,'UserData',path_list)% store the corresponding list of path in UserData of uicontrol transform_fct
 set(handles.path_transform,'String','')
 set(handles.path_transform,'UserData',[])
@@ -3604,8 +3605,10 @@
     if exist(profil_perso,'file')
         nb_builtin=UvData.OpenParam.NbBuiltin;% number of 'builtin' (basic) transform fcts in uvmat
+        if nb_builtin<numel(list_path)
         for ilist=nb_builtin+1:numel(list_path)
             transform_fct{ilist-nb_builtin}=[fullfile(list_path{ilist},menu{ilist}) '.m'];
         end
         save (profil_perso,'transform_fct','-append'); %store the root name for future opening of uvmat
+        end
     end
 end
@@ -4683,7 +4686,4 @@
     data.CoordType=UvData.CoordType;
 end
-% pos=get(handles.uvmat,'Position');
-% pos(1)=pos(1)+pos(3)-0.311+0.04; %0.311= width of the geometry_calib interface (units relative to the srcreen)
-% pos(2)=pos(2)-0.02;
 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];
