Index: trunk/src/series.m
===================================================================
--- trunk/src/series.m	(revision 598)
+++ trunk/src/series.m	(revision 599)
@@ -282,5 +282,5 @@
      oldfile=fullfile(RootPathCell{1},SubDirCell{1},RootFileCell{1});
  end
-[FileName, PathName, filterindex] = uigetfile( ...
+[FileName, PathName] = uigetfile( ...
        {'*.xml;*.xls;*.png;*.tif;*.avi;*.AVI;*.nc', ' (*.xml,*.xls, *.png,*.tif, *.avi,*.nc)';
        '*.xml',  '.xml files '; ...
@@ -304,5 +304,5 @@
             set_object(Param.ProjObject)
         end
-        set(handles.REFRESH,'UserData',[1:size(Param.InputTable,1)])
+        set(handles.REFRESH,'UserData',1:size(Param.InputTable,1))
         REFRESH_Callback([],[], handles)
         return
@@ -456,5 +456,5 @@
         RootPath=fileparts(RootPath); %will try the upped forldr
     else
-        [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=...
+        [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,FileInfo,MovieObject]=...
             find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]);
     end
@@ -475,5 +475,5 @@
         display_file_name(handles,fileinput,iview)
     else
-        update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,iview)
+        update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,FileInfo,MovieObject,iview)
     end
 end
@@ -514,5 +514,5 @@
 % detect the file type, get the movie object if relevant, and look for the corresponding file series:
 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
-[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);
+[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,FileInfo,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);
 if isempty(RootFile)&&isempty(i1_series)
     errormsg='no input file in the series';
@@ -581,10 +581,10 @@
 
 %% initiate input file series and refresh the current field view:     
-update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,iview);
+update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,FileInfo,MovieObject,iview);
 
 %------------------------------------------------------------------------
 % --- Update information about a new field series (indices to scan, timing,
 %     calibration from an xml file
-function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,iview)
+function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,FileInfo,VideoObject,iview)
 %------------------------------------------------------------------------
 %% update the output dir
@@ -708,4 +708,5 @@
 NbSlice_calib={};
 XmlFileName=find_imadoc(InputTable{iview,1},InputTable{iview,2},InputTable{iview,3},InputTable{iview,5});
+TimeUnit='';
 if ~isempty(XmlFileName)
         [XmlData,warntext]=imadoc2struct(XmlFileName);
@@ -769,8 +770,12 @@
 %% number of slices
 NbSlice=1;%default
-if isfield(XmlData,'GeometryCalib') && isfield(XmlData.GeometryCalib,'SliceCoord')
+heck_calib=0;
+if isfield(XmlData,'GeometryCalib') 
+    check_calib=1;
+    if isfield(XmlData.GeometryCalib,'SliceCoord')
     siz=size(XmlData.GeometryCalib.SliceCoord);
     if siz(1)>1
         NbSlice=siz(1);
+    end
     end
 end
@@ -793,5 +798,12 @@
 SeriesData.j2_series{iview}=j2_series;
 SeriesData.FileType{iview}=FileType;
+SeriesData.FileInfo{iview}=FileInfo;
 SeriesData.Time{iview}=time;
+if ~isempty(TimeUnit)
+    SeriesData.TimeUnit=TimeUnit;
+end
+if check_calib
+SeriesData.GeometryCalib{iview}=XmlData.GeometryCalib;
+end
 set(handles.series,'UserData',SeriesData)
 
@@ -1313,5 +1325,8 @@
 [Series,OutputDir,errormsg]=prepare_jobs(handles);% get parameters form the GUI series
 if ~isempty(errormsg)
+    if ~strcmp(errormsg,'Cancel')
     msgbox_uvmat('ERROR',errormsg)
+    end
+    STOP_Callback([],[], handles)
     return
 end
@@ -1681,5 +1696,8 @@
     while detect
         answer=msgbox_uvmat('INPUT_Y-N',['use existing ouput directory: ' fullfile(Series.InputTable{1,1},SubDirOutNew) ', possibly delete previous data']);
-        if isequal(answer,'Yes')
+        if strcmp(answer,'Cancel')
+            errormsg='Cancel';
+            return
+        elseif strcmp(answer,'Yes')
             detect=0;
             check_create=0;
@@ -1849,5 +1867,7 @@
 [Series,tild,errormsg]=prepare_jobs(handles);% read the parameters from the GUI series
 if ~isempty(errormsg)
+    if ~strcmp(errormsg,'Cancel')
     msgbox_uvmat('ERROR',errormsg)
+    end
     return
 end
@@ -2386,4 +2406,8 @@
     Param=read_GUI(handles.series);
     RootPath=Param.InputTable{1,1};
+    if ~isfield(Param,'OutputSubDir')   
+        msgbox_uvmat('ERROR','no directory defined for output files')
+        return
+    end
     OutputSubDir=[Param.OutputSubDir Param.OutputDirExt];% subdirectory for output files
     OutputDir=fullfile(RootPath,OutputSubDir);
