Index: trunk/src/series.m
===================================================================
--- trunk/src/series.m	(revision 1071)
+++ trunk/src/series.m	(revision 1072)
@@ -1452,4 +1452,7 @@
     Param.TransformInput=SeriesData.TransformInput;
 end
+if isfield(SeriesData,'ProjObject')
+    Param.ProjObject=SeriesData.ProjObject;
+end
 if ~isfield(SeriesData,'i1_series')
     errormsg='The input field series needs to be refreshed: press REFRESH';
@@ -1602,43 +1605,47 @@
 NbExp=1;% initiate the number of experiments set by the GUI browse_data, =1 otherwise
 if get(handles.Replicate,'Value')
-    set(handles.Replicate,'BackgroundColor',[1 1 0])%paint Relicate button in yellow
     hh=findobj(allchild(0),'Tag','browse_data');
-    BrowseData=guidata(hh);
-    SourceDir=get(BrowseData.SourceDir,'String');
-    ListExp=get(BrowseData.ListExperiments,'String');
-    ExpIndices=get(BrowseData.ListExperiments,'Value');
-    ListExp=ListExp(ExpIndices);
-    ListDevices=get(BrowseData.ListDevices,'String');
-    DeviceIndices=get(BrowseData.ListDevices,'Value');
-    ListDevices=ListDevices(DeviceIndices);
-    ListDataSeries=get(BrowseData.DataSeries,'String');
-    DataSeriesIndices=get(BrowseData.DataSeries,'Value');
-    ListDataSeries=ListDataSeries(DataSeriesIndices);
-    NbExp=0; % counter of the number of experiments set by the GUI browse_data
-    for iexp=1:numel(ListExp)
-        if ~isempty(regexp(ListExp{iexp},'^\+/'))% if it is a folder
-            if strcmp(get(BrowseData.DataSeries,'enable'),'off');%case of a multiple input line for series
-                NbExp=NbExp+1;
-                ExpIndex{NbExp}=iexp;
-                for idevice=1:numel(ListDevices)
-                    lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
-                        regexprep(ListDevices{idevice},'^\+/',''));
-                    ldir=regexprep(ListDataSeries{idevice},'^\+/','');
-                    ListPath{idevice,NbExp}=lpath;
-                    ListSubdir{idevice,NbExp}=ldir;
-                end
-            else
-                for idevice=1:numel(ListDevices)
-                    if ~isempty(regexp(ListDevices{idevice},'^\+/'))% if it is a folder
-                        for isubdir=1:numel(ListDataSeries)
-                            if ~isempty(regexp(ListDataSeries{isubdir},'^\+/'))% if it is a folder
-                                lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
-                                    regexprep(ListDevices{idevice},'^\+/',''));
-                                ldir= regexprep(ListDataSeries{isubdir},'^\+/','');
-                                if exist(fullfile(lpath,ldir),'dir')
-                                    NbExp=NbExp+1;
-                                    ExpIndex{NbExp}=iexp;
-                                    ListPath{NbExp}=lpath;
-                                    ListSubdir{NbExp}=ldir;
+    if isempty(hh)
+        set(handles.Replicate,'Value',0)
+    else
+        set(handles.Replicate,'BackgroundColor',[1 1 0])%paint Relicate button in yellow
+        BrowseData=guidata(hh);
+        SourceDir=get(BrowseData.SourceDir,'String');
+        ListExp=get(BrowseData.ListExperiments,'String');
+        ExpIndices=get(BrowseData.ListExperiments,'Value');
+        ListExp=ListExp(ExpIndices);
+        ListDevices=get(BrowseData.ListDevices,'String');
+        DeviceIndices=get(BrowseData.ListDevices,'Value');
+        ListDevices=ListDevices(DeviceIndices);
+        ListDataSeries=get(BrowseData.DataSeries,'String');
+        DataSeriesIndices=get(BrowseData.DataSeries,'Value');
+        ListDataSeries=ListDataSeries(DataSeriesIndices);
+        NbExp=0; % counter of the number of experiments set by the GUI browse_data
+        for iexp=1:numel(ListExp)
+            if ~isempty(regexp(ListExp{iexp},'^\+/'))% if it is a folder
+                if strcmp(get(BrowseData.DataSeries,'enable'),'off');%case of a multiple input line for series
+                    NbExp=NbExp+1;
+                    ExpIndex{NbExp}=iexp;
+                    for idevice=1:numel(ListDevices)
+                        lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
+                            regexprep(ListDevices{idevice},'^\+/',''));
+                        ldir=regexprep(ListDataSeries{idevice},'^\+/','');
+                        ListPath{idevice,NbExp}=lpath;
+                        ListSubdir{idevice,NbExp}=ldir;
+                    end
+                else
+                    for idevice=1:numel(ListDevices)
+                        if ~isempty(regexp(ListDevices{idevice},'^\+/'))% if it is a folder
+                            for isubdir=1:numel(ListDataSeries)
+                                if ~isempty(regexp(ListDataSeries{isubdir},'^\+/'))% if it is a folder
+                                    lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
+                                        regexprep(ListDevices{idevice},'^\+/',''));
+                                    ldir= regexprep(ListDataSeries{isubdir},'^\+/','');
+                                    if exist(fullfile(lpath,ldir),'dir')
+                                        NbExp=NbExp+1;
+                                        ExpIndex{NbExp}=iexp;
+                                        ListPath{NbExp}=lpath;
+                                        ListSubdir{NbExp}=ldir;
+                                    end
                                 end
                             end
@@ -1648,8 +1655,8 @@
             end
         end
-    end
-    answer=msgbox_uvmat('INPUT_Y-N-Cancel',['replicate the processing on ' num2str(NbExp) ' data series']);
-    if strcmp(answer,'Cancel')||strcmp(answer,'No')
-        return
+        answer=msgbox_uvmat('INPUT_Y-N-Cancel',['replicate the processing on ' num2str(NbExp) ' data series']);
+        if strcmp(answer,'Cancel')||strcmp(answer,'No')
+            return
+        end
     end
 end
@@ -1678,5 +1685,5 @@
     Param.IndexRange.last_i=str2num(get(handles.num_last_i,'String'));
     
-    %% create the output data directory if needed, after chcking its existence
+    %% create the output data directory if needed, after checking its existence
     OutputDir='';
     answer='';
@@ -2654,5 +2661,5 @@
     ProjObjectVisible='off';
 end
-set(handles.ProjObject,'Visible',ProjObjectVisible)
+set(handles.ProjObjectName,'Visible',ProjObjectVisible)
 set(handles.DeleteObject,'Visible',ProjObjectVisible)
 set(handles.ViewObject,'Visible',ProjObjectVisible)
@@ -3074,5 +3081,5 @@
         end
         ProjObject=read_GUI(hset_object);
-        set(handles.ProjObject,'String',ProjObject.Name); % display the object name
+        set(handles.ProjObjectName,'String',ProjObject.Name); % display the object name
         SeriesData=get(handles.series,'UserData');
         SeriesData.ProjObject=ProjObject;
@@ -3082,5 +3089,5 @@
     set(handles.DeleteObject,'Visible','on');
     set(handles.ViewObject,'Visible','on');
-    set(handles.ProjObject,'Visible','on');
+    set(handles.ProjObjectName,'Visible','on');
 else
     set(handles.EditObject,'Visible','off');
@@ -3090,5 +3097,5 @@
         set(handles.ViewObject,'Value',0);
     end
-    set(handles.ProjObject,'Visible','off');
+    set(handles.ProjObjectName,'Visible','off');
 end
 
@@ -3131,6 +3138,6 @@
 SeriesData.ProjObject=[];
 set(handles.series,'UserData',SeriesData)
-set(handles.ProjObject,'String','')
-set(handles.ProjObject,'Visible','off')
+set(handles.ProjObjectName,'String','')
+set(handles.ProjObjectName,'Visible','off')
 set(handles.CheckObject,'Value',0)
 set(handles.ViewObject,'Visible','off')
@@ -3389,11 +3396,11 @@
 set(handles.series,'UserData',SeriesData)
 if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)
-    set(handles.ProjObject,'String',Param.ProjObject.Name)
+    set(handles.ProjObjectName,'String',Param.ProjObject.Name)
     set(handles.ViewObject,'Visible','on')
     set(handles.EditObject,'Visible','on')
     set(handles.DeleteObject,'Visible','on')
 else     
-    set(handles.ProjObject,'String','')
-    set(handles.ProjObject,'Visible','off')
+    set(handles.ProjObjectName,'String','')
+    set(handles.ProjObjectName,'Visible','off')
     set(handles.ViewObject,'Visible','off')
     set(handles.EditObject,'Visible','off')
@@ -3874,2 +3881,5 @@
     end
 end
+
+
+
