Index: /trunk/src/series.m
===================================================================
--- /trunk/src/series.m	(revision 1202)
+++ /trunk/src/series.m	(revision 1203)
@@ -756,5 +756,5 @@
 XmlData=[];
 if ~isempty(XmlFileName)
-    XmlData=read_imadoct(XmlFileName);%read the imadoc file through the local fct read_imadoc
+    XmlData=read_imadoc(XmlFileName);%read the imadoc file through the local fct read_imadoc
     if isfield(XmlData,'FileSeries') && Rank==0
         set(handles.Relabel,'Visible','on')
Index: /trunk/src/series/civ_series.m
===================================================================
--- /trunk/src/series/civ_series.m	(revision 1202)
+++ /trunk/src/series/civ_series.m	(revision 1203)
@@ -390,48 +390,4 @@
             [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B);
             
-        
-        % case of background image to subtract
-        if par_civ1.CheckBackground &&~isempty(par_civ1.Background)
-            [RootPath_background,SubDir_background,RootFile_background,~,~,~,~,Ext_background]=fileparts_uvmat(Param.ActionInput.Civ1.Background);
-            if strcmp(NomTypeNc,'_1-2_1')% case of volume,backgrounds act on different j levels
-                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',j1_series_Civ1(ifield));
-            elseif isfield(par_civ1,'NbSlice')
-                i1_background=mod(i1-1,par_civ1.NbSlice)+1;
-                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',i1_background);
-                if strcmp(Param.ActionInput.PairIndices.ListPairMode,'series(Di)')% case of volume, background index refers to j index
-                    par_civ1.NbSlice_j=par_civ1.NbSlice;
-                end
-            else
-                backgroundname=Param.ActionInput.Civ1.Background;
-            end
-            if strcmp(backgroundoldname,backgroundname)% background exist, not already read in civ1
-                par_civ1.Background=background; %use background already opened
-            else
-                if ~isempty(regexp(backgroundname,'(^http://)|(^https://)', 'once'))|| exist(backgroundname,'file')
-                    try
-                        par_civ1.Background=uint16(imread(backgroundname));%update the background, an store it for future use
-                    catch ME
-                        if ~isempty(ME.message)
-                            errormsg=['error reading input image: ' ME.message];
-                            disp_uvmat('ERROR',errormsg,checkrun)
-                            return
-                        end
-                    end
-                else
-                    par_civ1.Background=[];
-                end
-                background=par_civ1.Background;
-                backgroundoldname=backgroundname;
-            end
-            par_civ1.ImageA=uint16(par_civ1.ImageA)-par_civ1.Background;
-            par_civ1.ImageB=uint16(par_civ1.ImageB)-par_civ1.Background;
-        end
-        
-        % case of image luminosity rescaling
-        if par_civ1.CheckRescale &&~isempty(par_civ1.Maxtanh)
-            par_civ1.ImageA =par_civ1.Maxtanh*tanh(double(par_civ1.ImageA)/par_civ1.Maxtanh);
-            par_civ1.ImageB=par_civ1.Maxtanh*tanh(double(par_civ1.ImageB)/par_civ1.Maxtanh);
-        end
-        
         % par_civ1.ImageWidth=size(par_civ1.ImageA,2);
         % par_civ1.ImageHeight=size(par_civ1.ImageA,1);
@@ -467,4 +423,51 @@
         Data.ListGlobalAttribute=[ListGlobalAttribute Civ1_param];
         Data.CivStage=1;
+            
+            
+            
+        % case of background image to subtract
+        if par_civ1.CheckBackground &&~isempty(par_civ1.Background)
+            [RootPath_background,SubDir_background,RootFile_background,~,~,~,~,Ext_background]=fileparts_uvmat(Param.ActionInput.Civ1.Background);
+            if strcmp(NomTypeNc,'_1-2_1')% case of volume,backgrounds act on different j levels
+                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',j1_series_Civ1(ifield));
+            elseif isfield(par_civ1,'NbSlice')
+                i1_background=mod(i1-1,par_civ1.NbSlice)+1;
+                backgroundname=fullfile_uvmat(RootPath_background,SubDir_background,RootFile_background,Ext_background,'_1',i1_background);
+                if strcmp(Param.ActionInput.PairIndices.ListPairMode,'series(Di)')% case of volume, background index refers to j index
+                    par_civ1.NbSlice_j=par_civ1.NbSlice;
+                end
+            else
+                backgroundname=Param.ActionInput.Civ1.Background;
+            end
+            if strcmp(backgroundoldname,backgroundname)% background exist, not already read in civ1
+                par_civ1.Background=background; %use background already opened
+            else
+                if ~isempty(regexp(backgroundname,'(^http://)|(^https://)', 'once'))|| exist(backgroundname,'file')
+                    try
+                        par_civ1.Background=uint16(imread(backgroundname));%update the background, an store it for future use
+                    catch ME
+                        if ~isempty(ME.message)
+                            errormsg=['error reading input image: ' ME.message];
+                            disp_uvmat('ERROR',errormsg,checkrun)
+                            return
+                        end
+                    end
+                else
+                    par_civ1.Background=[];
+                end
+                background=par_civ1.Background;
+                backgroundoldname=backgroundname;
+            end
+            par_civ1.ImageA=uint16(par_civ1.ImageA)-par_civ1.Background;
+            par_civ1.ImageB=uint16(par_civ1.ImageB)-par_civ1.Background;
+        end
+        
+        % case of image luminosity rescaling
+        if par_civ1.CheckRescale &&~isempty(par_civ1.Maxtanh)
+            par_civ1.ImageA =par_civ1.Maxtanh*tanh(double(par_civ1.ImageA)/par_civ1.Maxtanh);
+            par_civ1.ImageB=par_civ1.Maxtanh*tanh(double(par_civ1.ImageB)/par_civ1.Maxtanh);
+        end
+        
+        
         
         % set the list of variables
Index: /trunk/src/series/usr_fct/check_field_series.m
===================================================================
--- /trunk/src/series/usr_fct/check_field_series.m	(revision 1203)
+++ /trunk/src/series/usr_fct/check_field_series.m	(revision 1203)
@@ -0,0 +1,68 @@
+%'check_field_series': checks the existence and type of the input file series
+%------------------------------------------------------------------------
+% function GUIParam=check_data_files(Param)
+%
+%%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %%%%%%%%%%%%%%%%%%%%%%%%%%%
+%OUTPUT
+% GUISeriesParam=list of options in the GUI series.fig needed for the function
+%
+%INPUT:
+% In run mode, the input parameters are given as a Matlab structure Param copied from the GUI series.
+% In batch mode, Param is the name of the corresponding xml file containing the same information
+% In the absence of input (as activated when the current Action is selected
+% in series), the function ouput GUI_input set the activation of the needed GUI elements
+
+function GUIParam=check_field_series(Param)
+
+GUIParam=[];
+
+%% input preparation mode (no RUN)
+if isstruct(Param) && isequal(Param.Action.RUN,0)
+    GUIParam.OutputSubDirMode='auto'; %(options 'none'/'custom'/'auto'/'first'/'last','auto' by default)  
+    GUIParam.OutputDirExt='.check_fields';%set the output dir extension
+     msgbox_uvmat('CONFIMATION','This function will check the series of input fields')
+    return
+end
+%------------------------------------------------------------------------
+
+%% read input parameters from an xml file if input is a file name (batch mode)
+if ischar(Param)
+    Param=xml2struct(Param);% read Param as input file (batch case)
+end
+
+%% root input file(s) and type
+RootPath=Param.InputTable{1,1};
+SubDir=Param.InputTable{1,2};
+RootFile=Param.InputTable{1,3};
+NomType=Param.InputTable{1,4};
+FileExt=Param.InputTable{1,5};
+
+%% scans the series indexed with i and j
+i_index=Param.IndexRange.first_i:Param.IndexRange.incr_i:Param.IndexRange.last_i;
+j_index=Param.IndexRange.first_j:Param.IndexRange.incr_j:Param.IndexRange.last_j;
+FileCell=cell(numel(j_index),numel(i_index));%initiate cell array of input file names
+for ifile=1:numel(i_index)
+    for jfile=1:numel(j_index)
+        FullFileName=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,i_index(ifile),[],j_index(jfile));
+        FileName=fullfile_uvmat('','',RootFile,FileExt,NomType,i_index(ifile),[],j_index(jfile));%name without path
+        if exist(FullFileName,'file')
+            FileInfo=get_file_info(FullFileName);% get the info on the file          
+            FileCell{jfile,ifile}=[FileName ': ' FileInfo.FileType];
+        else
+            FileCell{jfile,ifile}=[FileName ': missing'];
+        end
+    end
+end
+
+%% transform cell arrays into text and display in workspace
+OutputText = strjoin(FileCell, '\n'); %transform cell arrays into text
+disp(OutputText) %display the list of files
+
+%% save the list in the appropriate output folder
+OutputPath=fullfile(Param.OutputPath,Param.Experiment,Param.Device);
+OutputSubDir=[Param.OutputSubDir Param.OutputDirExt];
+FullOutputFile=fullfile_uvmat(OutputPath,OutputSubDir,RootFile,'.txt','1-2',i_index(1),i_index(end))
+writelines(OutputText,FullOutputFile);
+
+'END'
+
