Index: trunk/src/read_field.m
===================================================================
--- trunk/src/read_field.m	(revision 445)
+++ trunk/src/read_field.m	(revision 450)
@@ -2,5 +2,5 @@
 %'read_field': read input fields in different formats
 %--------------------------------------------------------------------------
-%  function [Field,ParamOut,errormsg] = read_field(ObjectName,FileType,ParamIn)
+%  function [Field,ParamOut,errormsg] = read_field(FileName,FileType,ParamIn,num)
 %
 % OUTPUT:
@@ -23,10 +23,10 @@
 %     = video: movie read with VideoReader (recent versions of Matlab)
 %     = vol: images representing scanned volume (images concatened in the y direction)
-% ParamIn: Matlab structure of input parameters
+% ParamIn: movie object or Matlab structure of input parameters
 %     .FieldName: name (char string) of the input field (for Civx data)
 %     .VelType: char string giving the type of velocity data ('civ1', 'filter1', 'civ2'...)
 %     .ColorVar: variable used for vector color
 %     .Npx, .Npy: nbre of pixels along x and y (used for .vol input files)
-function [Field,ParamOut,errormsg] = read_field(ObjectName,FileType,ParamIn,num)
+function [Field,ParamOut,errormsg] = read_field(FileName,FileType,ParamIn,num)
 Field=[];
 if ~exist('num','var')
@@ -57,5 +57,5 @@
                 field_index=strcmp(ParamIn.FieldName,FieldList);%look for ParamIn.FieldName in the list of possible fields for Civx data
                 if isempty(find(field_index,1))% ParamIn.FieldName is not in the list, check whether Civx data exist
-                    Data=nc2struct(ObjectName,'ListGlobalAttribute','Conventions','absolut_time_T0','civ','CivStage');
+                    Data=nc2struct(FileName,'ListGlobalAttribute','Conventions','absolut_time_T0','civ','CivStage');
                     % case of new civdata conventions
                     if isequal(Data.Conventions,'uvmat/civdata')
@@ -63,5 +63,5 @@
                         ParamOut.ColorVar='ima_cor';
                         InputField=[{ParamOut.FieldName} {ParamOut.ColorVar}];
-                        [Field,ParamOut.VelType,errormsg]=read_civdata(ObjectName,InputField,ParamIn.VelType,Data.CivStage);
+                        [Field,ParamOut.VelType,errormsg]=read_civdata(FileName,InputField,ParamIn.VelType,Data.CivStage);
                         CivStage=Field.CivStage;
                         ParamOut.CivStage=Field.CivStage;
@@ -71,5 +71,5 @@
                         ParamOut.ColorVar='ima_cor';
                         InputField=[{ParamOut.FieldName} {ParamOut.ColorVar}];
-                        [Field,ParamOut.VelType]=read_civxdata(ObjectName,InputField,ParamIn.VelType);
+                        [Field,ParamOut.VelType]=read_civxdata(FileName,InputField,ParamIn.VelType);
                         CivStage=Field.CivStage;
                         ParamOut.CivStage=Field.CivStage;
@@ -88,5 +88,5 @@
                         InputField=[InputField {ParamOut.ColorVar}];
                     end
-                    [Field,ParamOut.VelType,errormsg]=read_civxdata(ObjectName,InputField,ParamIn.VelType);
+                    [Field,ParamOut.VelType,errormsg]=read_civxdata(FileName,InputField,ParamIn.VelType);
                     if ~isempty(errormsg)
                         return
@@ -100,10 +100,10 @@
                 hget_field=findobj(allchild(0),'Name',GUIName);%find the get_field... GUI
                 if isempty(hget_field)% open the GUI get_field if it is not found
-                    hget_field= get_field(ObjectName);%open the get_field GUI
+                    hget_field= get_field(FileName);%open the get_field GUI
                     set(hget_field,'Name',GUIName)%update the name of get_field (e.g. get_field_1)
                 end
                 hhget_field=guidata(hget_field);
                 %% update  the get_field GUI
-                set(hhget_field.inputfile,'String',ObjectName)
+                set(hhget_field.inputfile,'String',FileName)
                 set(hhget_field.list_fig,'Value',1)
                 if exist('num','var')&&~isnan(num)
@@ -116,5 +116,5 @@
                 Tabchar={''};%default
                 Tabcell=[];
-                set(hhget_field.inputfile,'String',ObjectName)
+                set(hhget_field.inputfile,'String',FileName)
                 if isfield(Field,'ListGlobalAttribute')&& ~isempty(Field.ListGlobalAttribute)
                     for iline=1:length(Field.ListGlobalAttribute)
@@ -145,7 +145,7 @@
             end
         case {'video','mmreader'}
-            A=read(ObjectName,num);
+            A=read(ParamIn,num);
         case 'vol'
-            A=imread(ObjectName);
+            A=imread(FileName);
             Npz=size(A,1)/ParamIn.Npy;
             A=reshape(A',ParamIn.Npx,ParamIn.Npy,Npz);
@@ -153,7 +153,7 @@
         case 'multimage'
             warning 'off'
-            A=imread(ObjectName,num);
+            A=imread(FileName,num);
         case 'image'
-            A=imread(ObjectName);
+            A=imread(FileName);
     end
 catch ME
