Index: trunk/src/series/aver_stat.m
===================================================================
--- trunk/src/series/aver_stat.m	(revision 604)
+++ trunk/src/series/aver_stat.m	(revision 605)
@@ -43,14 +43,19 @@
 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName
 if isstruct(Param) && isequal(Param.Action.RUN,0)
-    ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
-    ParamOut.WholeIndexRange='off';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
-    ParamOut.NbSlice='on'; ...%nbre of slices ('off' by default)
-    ParamOut.VelType='two';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
-    ParamOut.FieldName='two';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
-    ParamOut.FieldTransform = 'on';...%can use a transform function
-    ParamOut.ProjObject='on';...%can use projection object(option 'off'/'on',
-    ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
+    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
+    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
+    ParamOut.NbSlice='on'; %nbre of slices ('off' by default)
+    ParamOut.VelType='two';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
+    ParamOut.FieldName='two';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
+    ParamOut.FieldTransform = 'on';%can use a transform function
+    ParamOut.ProjObject='on';%can use projection object(option 'off'/'on',
+    ParamOut.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
     ParamOut.OutputDirExt='.stat';%set the output dir extension
-return
+    ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
+    filecell=get_file_series(Param);%check existence of the first input file
+    if ~exist(filecell{1,1},'file')
+        msgbox_uvmat('WARNING','the first input file does not exist')
+    end
+    return
 end
 
Index: trunk/src/series/civ_series.m
===================================================================
--- trunk/src/series/civ_series.m	(revision 604)
+++ trunk/src/series/civ_series.m	(revision 605)
@@ -59,6 +59,4 @@
 end
 
-%%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
-
 %% read input parameters from an xml file if input is a file name (batch mode)
 checkrun=1;
@@ -67,4 +65,66 @@
     checkrun=0;
 end
+
+%% input files and indexing
+NbField=1;
+if isfield(Param,'InputTable')
+    RootPath=Param.InputTable{1,1};
+    RootFile=Param.InputTable{1,3};
+    SubDir=Param.InputTable{1,2};
+    NomType=Param.InputTable{1,4};
+    FileExt=Param.InputTable{1,5};
+    PairCiv1=Param.ActionInput.PairIndices.ListPairCiv1;
+    PairCiv2='';
+    if isfield(Param.ActionInput.PairIndices,'ListPairCiv2')
+        PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2;
+    end
+    MaxIndex=cell2mat(Param.IndexRange.MaxIndex);
+    MinIndex=cell2mat(Param.IndexRange.MinIndex);
+    [filecell,i_series,tild,j_series]=get_file_series(Param);
+    [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=...
+        find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex,MaxIndex);
+    if ~isempty(PairCiv2)
+        [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds_Civ2]=...
+            find_pair_indices(PairCiv2,i_series{1},j_series{1},MinIndex,MaxIndex);
+        check_bounds=check_bounds | check_bounds_Civ2;
+    end
+    i1_series_Civ1=i1_series_Civ1(~check_bounds);
+    i2_series_Civ1=i2_series_Civ1(~check_bounds);
+    j1_series_Civ1=j1_series_Civ1(~check_bounds);
+    j2_series_Civ1=j2_series_Civ1(~check_bounds);
+    if ~isempty(j1_series_Civ1)
+        FrameIndex_A_Civ1=j1_series_Civ1;
+        FrameIndex_B_Civ1=j2_series_Civ1;
+    else
+        FrameIndex_A_Civ1=i1_series_Civ1;
+        FrameIndex_B_Civ1=i2_series_Civ1;
+    end
+    if ~isempty(PairCiv2)
+        i1_series_Civ2=i1_series_Civ2(~check_bounds);
+        i2_series_Civ2=i2_series_Civ2(~check_bounds);
+        j1_series_Civ2=j1_series_Civ2(~check_bounds);
+        j2_series_Civ2=j2_series_Civ2(~check_bounds);
+        if ~isempty(j1_series_Civ2)
+            FrameIndex_A_Civ2=j1_series_Civ2;
+            FrameIndex_B_Civ2=j2_series_Civ2;
+        else
+            FrameIndex_A_Civ2=i1_series_Civ2;
+            FrameIndex_B_Civ2=i2_series_Civ2;
+        end
+    end
+    
+    NbField=numel(i1_series_Civ1);
+    ImageTypeOptions={'image','multimage','mmreader','video'};
+    [FileType_A,FileInfo,MovieObject_A]=get_file_type(filecell{1,1});
+    FileType_B=FileType_A;
+    MovieObject_B=MovieObject_A;
+    if size(filecell,1)>=2 && ~strcmp(filecell{1,1},filecell{2,1})
+        [FileType_B,FileInfo,MovieObject_B]=get_file_type(filecell{2,1});
+        CheckImage_B=~isempty(find(strcmp(FileType,ImageTypeOptions)));% =1 for images
+    end
+end
+
+
+%% Output directory
 OutputDir=[Param.OutputSubDir Param.OutputDirExt];
 
@@ -81,69 +141,7 @@
 check_patch1=0;%default
 
-% case of input Param set by an xml file (batch mode)
-if ischar(Param)
-    Param=xml2struct(Param); %if Param is the name of an xml file, read this file as a Matlab structure
-end
-
-RootPath=Param.InputTable{1,1};
-RootFile=Param.InputTable{1,3};
-SubDir=Param.InputTable{1,2};
-NomType=Param.InputTable{1,4};
-FileExt=Param.InputTable{1,5};
-PairCiv1=Param.ActionInput.PairIndices.ListPairCiv1;
-PairCiv2='';
-if isfield(Param.ActionInput.PairIndices,'ListPairCiv2')
-    PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2;
-end
-
-% option use with GUI series
-NbField=1;
-MovieObject_A=[];
-if isfield(Param,'InputTable')
-    MaxIndex=cell2mat(Param.IndexRange.MaxIndex);
-    MinIndex=cell2mat(Param.IndexRange.MinIndex);
-    [filecell,i_series,tild,j_series]=get_file_series(Param);
-    [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=...
-        find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex,MaxIndex);
-    if ~isempty(PairCiv2)
-        [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds_Civ2]=...
-            find_pair_indices(PairCiv2,i_series{1},j_series{1},MinIndex,MaxIndex);
-        check_bounds=check_bounds | check_bounds_Civ2;
-    end
-    i1_series_Civ1=i1_series_Civ1(~check_bounds);
-    i2_series_Civ1=i2_series_Civ1(~check_bounds);
-    j1_series_Civ1=j1_series_Civ1(~check_bounds);
-    j2_series_Civ1=j2_series_Civ1(~check_bounds);
-    if ~isempty(j1_series_Civ1)
-        FrameIndex_A_Civ1=j1_series_Civ1;
-        FrameIndex_B_Civ1=j2_series_Civ1;
-    else
-        FrameIndex_A_Civ1=i1_series_Civ1;
-        FrameIndex_B_Civ1=i2_series_Civ1;
-    end
-    if ~isempty(PairCiv2)
-        i1_series_Civ2=i1_series_Civ2(~check_bounds);
-        i2_series_Civ2=i2_series_Civ2(~check_bounds);
-        j1_series_Civ2=j1_series_Civ2(~check_bounds);
-        j2_series_Civ2=j2_series_Civ2(~check_bounds);
-        if ~isempty(j1_series_Civ2)
-            FrameIndex_A_Civ2=j1_series_Civ2;
-            FrameIndex_B_Civ2=j2_series_Civ2;
-        else
-            FrameIndex_A_Civ2=i1_series_Civ2;
-            FrameIndex_B_Civ2=i2_series_Civ2;
-        end
-    end
-    
-    NbField=numel(i1_series_Civ1);
-    ImageTypeOptions={'image','multimage','mmreader','video'};
-    [FileType_A,FileInfo,MovieObject_A]=get_file_type(filecell{1,1});
-    FileType_B=FileType_A;
-    MovieObject_B=MovieObject_A;
-    if size(filecell,1)>=2 && ~strcmp(filecell{1,1},filecell{2,1})
-        [FileType_B,FileInfo,MovieObject_B]=get_file_type(filecell{2,1});
-        CheckImage_B=~isempty(find(strcmp(FileType,ImageTypeOptions)));% =1 for images
-    end
-end
+
+
+
 
 %%%%% MAIN LOOP %%%%%%
Index: trunk/src/series/merge_proj.m
===================================================================
--- trunk/src/series/merge_proj.m	(revision 604)
+++ trunk/src/series/merge_proj.m	(revision 605)
@@ -41,5 +41,5 @@
 function ParamOut=merge_proj(Param)
 
-%% set the input elements needed on the GUI series when the action is selected in the menu ActionName
+%% set the input elements needed on the GUI series when the function is selected in the menu ActionName
 if isstruct(Param) && isequal(Param.Action.RUN,0)
     ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
@@ -52,4 +52,11 @@
     ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
     ParamOut.OutputDirExt='.mproj';%set the output dir extension
+    ParamOut.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
+    filecell=get_file_series(Param);%check existence of the first input file
+    if ~exist(filecell{1,1},'file')
+        msgbox_uvmat('WARNING','the first input file does not exist')
+    elseif isequal(size(Param.InputTable,1),1) && ~isfield(Param,'ProjObject')
+         msgbox_uvmat('WARNING','a projection object of type plane needs to be introduced for merge_proj')
+    end
 return
 end
Index: trunk/src/series/sub_background.m
===================================================================
--- trunk/src/series/sub_background.m	(revision 604)
+++ trunk/src/series/sub_background.m	(revision 605)
@@ -56,23 +56,23 @@
 %% input preparation mode (no RUN)
 if isstruct(Param) && isequal(Param.Action.RUN,0)
-    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='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)
-    ParamOut.FieldTransform = 'off';...%can use a transform function
-    ParamOut.ProjObject='off';...%can use projection object(option 'off'/'on',
-    ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
+    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='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)
+    ParamOut.FieldTransform = 'off';%can use a transform function
+    ParamOut.ProjObject='off';%can use projection object(option 'off'/'on',
+    ParamOut.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
     ParamOut.OutputDirExt='.sback';%set the output dir extension
-    
+    ParamOut.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
+    filecell=get_file_series(Param);%check existence of the first input file
     %%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
     
     %% root input file(s) and type
-%     RootPath=Param.InputTable(:,1);
-%     RootFile=Param.InputTable(:,3);
-%     SubDir=Param.InputTable(:,2);
-%     NomType=Param.InputTable(:,4);
-%     FileExt=Param.InputTable(:,5);
     [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
+    if ~exist(filecell{1,1},'file')
+        msgbox_uvmat('WARNING','the first input file does not exist')
+        return
+    end
     %%%%%%%%%%%%
     % The cell array filecell is the list of input file names, while
Index: trunk/src/series/time_series.m
===================================================================
--- trunk/src/series/time_series.m	(revision 604)
+++ trunk/src/series/time_series.m	(revision 605)
@@ -44,13 +44,20 @@
 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName
 if isstruct(Param) && isequal(Param.Action.RUN,0)
-    ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
-        ParamOut.WholeIndexRange='off';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
-        ParamOut.NbSlice='on'; ...%nbre of slices ('off' by default)
-        ParamOut.VelType='two';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
-        ParamOut.FieldName='two';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
-        ParamOut.FieldTransform = 'on';...%can use a transform function
-        ParamOut.ProjObject='on';...%can use projection object(option 'off'/'on',
-        ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
-        ParamOut.OutputDirExt='.tseries';%set the output dir extension
+    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
+    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
+    ParamOut.NbSlice='on'; %nbre of slices ('off' by default)
+    ParamOut.VelType='two';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
+    ParamOut.FieldName='two';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
+    ParamOut.FieldTransform = 'on';%can use a transform function
+    ParamOut.ProjObject='on';%can use projection object(option 'off'/'on',
+    ParamOut.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
+    ParamOut.OutputDirExt='.tseries';%set the output dir extension
+    ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
+    filecell=get_file_series(Param);%check existence of the first input file
+    if ~exist(filecell{1,1},'file')
+        msgbox_uvmat('WARNING','the first input file does not exist')
+    elseif isequal(size(Param.InputTable,1),1) && ~isfield(Param,'ProjObject')
+        msgbox_uvmat('WARNING','a projection object  needs to be introduced for time_series')
+    end
     return
 end
