Index: /trunk/src/read_field.m
===================================================================
--- /trunk/src/read_field.m	(revision 768)
+++ /trunk/src/read_field.m	(revision 769)
@@ -63,4 +63,8 @@
         [Field,ParamOut.VelType,errormsg]=read_civdata(FileName,InputField,ParamIn.VelType);
         if ~isempty(errormsg),errormsg=['read_civdata / ' errormsg];return,end
+        if ~isempty(strcmp('C',ParamIn.FieldName))% if C image correlation is requested as field (not color visu)
+            ScalarIndex=strcmp('C',Field.ListVarName);
+            Field.VarAttribute{ScalarIndex}.Role='scalar';%put role as 'scalar' instead of ancillary
+        end      
         ParamOut.CivStage=Field.CivStage;
     case 'civx'% old (obsolete) format for civ results
@@ -175,17 +179,17 @@
             ind_var_U=find(strcmp(UName,ListVar));%check previous listing of variable r.UName
             ind_var_V=find(strcmp(VName,ListVar));%check previous listing of variable r.VName
-             if ~checkU && ~checkV
-                    Field.ListVarName([ind_var_U+2 ind_var_V+2])=[];
-                    Field.VarDimName([ind_var_U+2 ind_var_V+2])=[];
-                    Field.VarAttribute([ind_var_U+2 ind_var_V+2])=[];
-                elseif ~checkU
-                    Field.ListVarName(ind_var_U+2)=[];
-                    Field.VarDimName(ind_var_U+2)=[];
-                    Field.VarAttribute(ind_var_U+2 )=[];
-                elseif ~checkV
-                    Field.ListVarName(ind_var_V+2)=[];
-                    Field.VarDimName(ind_var_V+2)=[];
-                    Field.VarAttribute(ind_var_V+2 )=[];
-             end
+            if ~checkU && ~checkV
+                Field.ListVarName([ind_var_U+2 ind_var_V+2])=[];
+                Field.VarDimName([ind_var_U+2 ind_var_V+2])=[];
+                Field.VarAttribute([ind_var_U+2 ind_var_V+2])=[];
+            elseif ~checkU
+                Field.ListVarName(ind_var_U+2)=[];
+                Field.VarDimName(ind_var_U+2)=[];
+                Field.VarAttribute(ind_var_U+2 )=[];
+            elseif ~checkV
+                Field.ListVarName(ind_var_V+2)=[];
+                Field.VarDimName(ind_var_V+2)=[];
+                Field.VarAttribute(ind_var_V+2 )=[];
+            end
         end
     case 'video'
Index: /trunk/src/series.m
===================================================================
--- /trunk/src/series.m	(revision 768)
+++ /trunk/src/series.m	(revision 769)
@@ -253,4 +253,6 @@
         display_file_name(handles,Param.FileName,'one')%refresh the input table
     end
+else
+    set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed
 end  
 if isfield(Param,'incr_i')
@@ -260,5 +262,4 @@
     set(handles.num_incr_j,'String',num2str(Param.incr_j))
 end
-set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed
 
 %------------------------------------------------------------------------
@@ -1022,6 +1023,6 @@
 switch FileType
     case {'civx','civdata'}
-        FieldList=set_field_list('U','V','C');
-        set(handles.FieldName,'String',[FieldList;{'get_field...'}]);%standard menu for civx data
+        FieldList=set_field_list('U','V');
+        set(handles.FieldName,'String',[FieldList;{'C'};{'get_field...'}]);%standard menu for civx data
         set(handles.FieldName,'Value',1) % set menu to 'velocity
         set(handles.Coord_x,'Value',1);
@@ -1404,4 +1405,12 @@
 function RUN_Callback(hObject, eventdata, handles)
 
+%% read the data on the GUI series
+Param=read_GUI_series(handles);%displayed parameters
+SeriesData=get(handles.series,'UserData');%hidden parameters
+if isfield(Param,'InputFields')&& isequal(Param.InputFields.FieldName,'get_field...')
+    msgbox_uvmat('ERROR','input field name(s) not defined, select get_field...')
+    return
+end
+
 %% settings of the button RUN
 set(handles.RUN,'BusyAction','queue');% activation of STOP button will set BusyAction to 'cancel'
@@ -1412,21 +1421,18 @@
 status_Callback(hObject, eventdata, handles)
 
-%% read the data on the GUI series
-Param=read_GUI_series(handles);%displayed parameters
-SeriesData=get(handles.series,'UserData');%hidden parameters
-
-
-
 %% select the Action mode, 'local', 'background' or 'cluster' (if available)
 RunMode='local';%default (needed for first opening of the GUI series)
 if isfield(Param.Action,'RunMode')
     RunMode=Param.Action.RunMode;
+    Param.Action=rmfield(Param.Action,'RunMode');%remove from the recorded xml file to avoid interference during ImportConfig
 end
 ActionExt='.m';%default
 if isfield(Param.Action,'ActionExt')
     ActionExt=Param.Action.ActionExt;% '.m' or '.sh' (compiled)
+    Param.Action=rmfield(Param.Action,'ActionExt');%remove from the recorded xml file to avoid interference during ImportConfig
 end
 ActionName=Param.Action.ActionName;
 ActionPath=Param.Action.ActionPath;
+
 path_series=fileparts(which('series'));
 
@@ -1483,12 +1489,4 @@
 
 %% If a compiled version has been selected (ext .sh) check weather it needs to be recompiled
-% ActionExtList=get(handles.ActionExt,'String');
-% ActionExt=ActionExtList{get(handles.ActionExt,'Value')};
-% ActionList=get(handles.ActionName,'String');
-% ActionName=ActionList{get(handles.ActionName,'Value')};
-% TransformPath='';
-% if ~isempty(get(handles.ActionExt,'UserData'))
-%     TransformPath=get(handles.ActionExt,'UserData');
-% end
 if strcmp(ActionExt,'.sh')
     TransformPath='';
@@ -1506,7 +1504,5 @@
             currentdir=pwd;
             cd(get(handles.ActionPath,'String'))% go to the directory of Action
-            %  addpath(get(handles.TransformPath,'String'))
             addpath(path_uvmat)% add the path to uvmat to run the fct 'compile'
-           % addpath(fullfile(path_uvmat,'transform_field'))% add the path to uvmat to run the fct 'compile'
             compile(ActionName,TransformPath)
             cd(currentdir)
@@ -1523,5 +1519,4 @@
                 currentdir=pwd;
                 cd(get(handles.ActionPath,'String'))% go to the directory of Action
-                %  addpath(get(handles.TransformPath,'String'))
                 addpath(path_uvmat)% add the path to uvmat to run the fct 'compile'
                 addpath(fullfile(path_uvmat,'transform_field'))% add the path to uvmat to run the fct 'compile'
@@ -2330,5 +2325,8 @@
                 set(handles.VelType,'visible','on')
         end
+        set(handles.FieldName,'Value',1)
+        set(handles.FieldName,'String',[FieldList; {'get_field...'}]);
         if ~strcmp(GetFieldData.FieldOption,'civdata...')
+            set(handles.FieldName,'Value',[1:numel(FieldList)])%select all input fields by default
             set(handles.VelType,'visible','off')
             XName=GetFieldData.Coordinates.Coord_x;
@@ -2353,8 +2351,6 @@
             end
         end
-        set(handles.Coord_x,'String',{XName})
+                set(handles.Coord_x,'String',{XName})
         set(handles.Coord_y,'String',YName)
-        set(handles.FieldName,'Value',1)
-        set(handles.FieldName,'String',[FieldList; {'get_field...'}]);
     end
 end
@@ -2802,4 +2798,9 @@
     fill_GUI(Param,handles.series)% fill the elements of the GUI series with the input parameters
     SeriesData=get(handles.series,'UserData');
+    if isfield(Param,'InputFields')
+        ListField=Param.InputFields.FieldName;
+        set(handles.FieldName,'String',[ListField;{'get-field...'}])
+         set(handles.FieldName,'Value',1:numel(ListField))
+    end       
     if isfield(Param,'ActionInput')%  introduce  parameters specific to an Action fct, for instance PIV parameters
         set(handles.ActionInput,'Visible','on')
Index: /trunk/src/set_field_list.m
===================================================================
--- /trunk/src/set_field_list.m	(revision 768)
+++ /trunk/src/set_field_list.m	(revision 769)
@@ -4,34 +4,17 @@
 %
 % OUTPUT:
-% Scal: matlab vector representing the scalar values (length nbvec defined by var_read)
-%      if no input, Scal=list of programmed scalar names (to put in menus)
-%      if only the field name is put as input, vec_A=type of scalar, which can be:
-%                   'discrete': related to the individual velocity vectors, not interpolated by patch
-%                   'vel': scalar calculated solely from velocity components
-%                   'der': needs spatial derivatives
-%                   'var': the scalar name directly corresponds to a field name in the netcdf files
-% error: error flag
-%      error = 0; OK
-%      error = 1; the prescribed scalar cannot be read or calculated from available fields
+% FieldList: list (cell column) of the fields to propose in the menu FieldName
+% VecColorList: list (cell column) of the fields to propose in the menu for vector color
 %
 % INPUT:
-% FieldList: cell array of strings representing the name(s) of the field(s) to calculate
-% DataIn: structure representing the field, as defined in check_field_srtructure.m
-% Coord_interp(:,nb_coord) optional set of coordinates to interpolate the field (use with thin plate shell)
+% UName: name of the x vector component
+% VName: name of the y vector component
+% CName: name of an additional scalar for color
 %
 % FUNCTION related
 % varname_generator.m: determines the field names to read in the netcdf
 % file, depending on the scalar
+
 function [FieldList,VecColorList]=set_field_list(UName,VName,CName)
-%function [DataOut,errormsg]=calc_field(FieldList,DataIn,Coord_interp)
-
-%list of defined scalars to display in menus (in addition to 'ima_cor').
-% a type is associated to each scalar:
-%              'discrete': related to the individual velocity vectors, not interpolated by patch
-%              'vel': calculated from velocity components, continuous field (interpolated with velocity)
-%              'der': needs spatial derivatives
-%              'var': the scalar name corresponds to a field name in the netcdf files
-% a specific variable name for civ1 and civ2 fields are also associated, if
-% the scalar is calculated from other fields, as explicited below
 
 FieldList={['vec(' UName ',' VName ')'];...
@@ -45,26 +28,7 @@
     UName;...
     VName};...
-    if ~isempty(CName)
+if exist('CName','var') && ~isempty(CName)
     VecColorList=[{CName};VecColorList];
-    end
+end
 
 
-
-% %% list of field options implemented
-% FieldList={'vec(U,V)';...%image correlation corresponding to a vel vector
-%     'C';...%image correlation corresponding to a vel vector
-%     'norm(U,V)';...%norm of the velocity
-%     'curl(U,V)';...%vorticity
-%     'div(U,V)';...%divergence
-%     'strain(U,V)';...%rate of strain
-%     'U';... %u velocity component
-%     'V';... %v velocity component
-%     'W';... %w velocity component
-%     'W_normal';... %w velocity component normal to the plane
-%     'error'}; %error associated to a vector (for stereo or patch)
-% ColorList={'C';...%image correlation corresponding to a vel vector
-%     'norm(U,V)';...%norm of the velocity
-%     'U';... %u velocity component
-%     'V';... %v velocity component
-%     }
-
