Changeset 1072 for trunk/src/series.m


Ignore:
Timestamp:
Jan 17, 2020, 8:13:53 PM (4 years ago)
Author:
sommeria
Message:

LIF updated and bug corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r1071 r1072  
    14521452    Param.TransformInput=SeriesData.TransformInput;
    14531453end
     1454if isfield(SeriesData,'ProjObject')
     1455    Param.ProjObject=SeriesData.ProjObject;
     1456end
    14541457if ~isfield(SeriesData,'i1_series')
    14551458    errormsg='The input field series needs to be refreshed: press REFRESH';
     
    16021605NbExp=1;% initiate the number of experiments set by the GUI browse_data, =1 otherwise
    16031606if get(handles.Replicate,'Value')
    1604     set(handles.Replicate,'BackgroundColor',[1 1 0])%paint Relicate button in yellow
    16051607    hh=findobj(allchild(0),'Tag','browse_data');
    1606     BrowseData=guidata(hh);
    1607     SourceDir=get(BrowseData.SourceDir,'String');
    1608     ListExp=get(BrowseData.ListExperiments,'String');
    1609     ExpIndices=get(BrowseData.ListExperiments,'Value');
    1610     ListExp=ListExp(ExpIndices);
    1611     ListDevices=get(BrowseData.ListDevices,'String');
    1612     DeviceIndices=get(BrowseData.ListDevices,'Value');
    1613     ListDevices=ListDevices(DeviceIndices);
    1614     ListDataSeries=get(BrowseData.DataSeries,'String');
    1615     DataSeriesIndices=get(BrowseData.DataSeries,'Value');
    1616     ListDataSeries=ListDataSeries(DataSeriesIndices);
    1617     NbExp=0; % counter of the number of experiments set by the GUI browse_data
    1618     for iexp=1:numel(ListExp)
    1619         if ~isempty(regexp(ListExp{iexp},'^\+/'))% if it is a folder
    1620             if strcmp(get(BrowseData.DataSeries,'enable'),'off');%case of a multiple input line for series
    1621                 NbExp=NbExp+1;
    1622                 ExpIndex{NbExp}=iexp;
    1623                 for idevice=1:numel(ListDevices)
    1624                     lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
    1625                         regexprep(ListDevices{idevice},'^\+/',''));
    1626                     ldir=regexprep(ListDataSeries{idevice},'^\+/','');
    1627                     ListPath{idevice,NbExp}=lpath;
    1628                     ListSubdir{idevice,NbExp}=ldir;
    1629                 end
    1630             else
    1631                 for idevice=1:numel(ListDevices)
    1632                     if ~isempty(regexp(ListDevices{idevice},'^\+/'))% if it is a folder
    1633                         for isubdir=1:numel(ListDataSeries)
    1634                             if ~isempty(regexp(ListDataSeries{isubdir},'^\+/'))% if it is a folder
    1635                                 lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
    1636                                     regexprep(ListDevices{idevice},'^\+/',''));
    1637                                 ldir= regexprep(ListDataSeries{isubdir},'^\+/','');
    1638                                 if exist(fullfile(lpath,ldir),'dir')
    1639                                     NbExp=NbExp+1;
    1640                                     ExpIndex{NbExp}=iexp;
    1641                                     ListPath{NbExp}=lpath;
    1642                                     ListSubdir{NbExp}=ldir;
     1608    if isempty(hh)
     1609        set(handles.Replicate,'Value',0)
     1610    else
     1611        set(handles.Replicate,'BackgroundColor',[1 1 0])%paint Relicate button in yellow
     1612        BrowseData=guidata(hh);
     1613        SourceDir=get(BrowseData.SourceDir,'String');
     1614        ListExp=get(BrowseData.ListExperiments,'String');
     1615        ExpIndices=get(BrowseData.ListExperiments,'Value');
     1616        ListExp=ListExp(ExpIndices);
     1617        ListDevices=get(BrowseData.ListDevices,'String');
     1618        DeviceIndices=get(BrowseData.ListDevices,'Value');
     1619        ListDevices=ListDevices(DeviceIndices);
     1620        ListDataSeries=get(BrowseData.DataSeries,'String');
     1621        DataSeriesIndices=get(BrowseData.DataSeries,'Value');
     1622        ListDataSeries=ListDataSeries(DataSeriesIndices);
     1623        NbExp=0; % counter of the number of experiments set by the GUI browse_data
     1624        for iexp=1:numel(ListExp)
     1625            if ~isempty(regexp(ListExp{iexp},'^\+/'))% if it is a folder
     1626                if strcmp(get(BrowseData.DataSeries,'enable'),'off');%case of a multiple input line for series
     1627                    NbExp=NbExp+1;
     1628                    ExpIndex{NbExp}=iexp;
     1629                    for idevice=1:numel(ListDevices)
     1630                        lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
     1631                            regexprep(ListDevices{idevice},'^\+/',''));
     1632                        ldir=regexprep(ListDataSeries{idevice},'^\+/','');
     1633                        ListPath{idevice,NbExp}=lpath;
     1634                        ListSubdir{idevice,NbExp}=ldir;
     1635                    end
     1636                else
     1637                    for idevice=1:numel(ListDevices)
     1638                        if ~isempty(regexp(ListDevices{idevice},'^\+/'))% if it is a folder
     1639                            for isubdir=1:numel(ListDataSeries)
     1640                                if ~isempty(regexp(ListDataSeries{isubdir},'^\+/'))% if it is a folder
     1641                                    lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
     1642                                        regexprep(ListDevices{idevice},'^\+/',''));
     1643                                    ldir= regexprep(ListDataSeries{isubdir},'^\+/','');
     1644                                    if exist(fullfile(lpath,ldir),'dir')
     1645                                        NbExp=NbExp+1;
     1646                                        ExpIndex{NbExp}=iexp;
     1647                                        ListPath{NbExp}=lpath;
     1648                                        ListSubdir{NbExp}=ldir;
     1649                                    end
    16431650                                end
    16441651                            end
     
    16481655            end
    16491656        end
    1650     end
    1651     answer=msgbox_uvmat('INPUT_Y-N-Cancel',['replicate the processing on ' num2str(NbExp) ' data series']);
    1652     if strcmp(answer,'Cancel')||strcmp(answer,'No')
    1653         return
     1657        answer=msgbox_uvmat('INPUT_Y-N-Cancel',['replicate the processing on ' num2str(NbExp) ' data series']);
     1658        if strcmp(answer,'Cancel')||strcmp(answer,'No')
     1659            return
     1660        end
    16541661    end
    16551662end
     
    16781685    Param.IndexRange.last_i=str2num(get(handles.num_last_i,'String'));
    16791686   
    1680     %% create the output data directory if needed, after chcking its existence
     1687    %% create the output data directory if needed, after checking its existence
    16811688    OutputDir='';
    16821689    answer='';
     
    26542661    ProjObjectVisible='off';
    26552662end
    2656 set(handles.ProjObject,'Visible',ProjObjectVisible)
     2663set(handles.ProjObjectName,'Visible',ProjObjectVisible)
    26572664set(handles.DeleteObject,'Visible',ProjObjectVisible)
    26582665set(handles.ViewObject,'Visible',ProjObjectVisible)
     
    30743081        end
    30753082        ProjObject=read_GUI(hset_object);
    3076         set(handles.ProjObject,'String',ProjObject.Name); % display the object name
     3083        set(handles.ProjObjectName,'String',ProjObject.Name); % display the object name
    30773084        SeriesData=get(handles.series,'UserData');
    30783085        SeriesData.ProjObject=ProjObject;
     
    30823089    set(handles.DeleteObject,'Visible','on');
    30833090    set(handles.ViewObject,'Visible','on');
    3084     set(handles.ProjObject,'Visible','on');
     3091    set(handles.ProjObjectName,'Visible','on');
    30853092else
    30863093    set(handles.EditObject,'Visible','off');
     
    30903097        set(handles.ViewObject,'Value',0);
    30913098    end
    3092     set(handles.ProjObject,'Visible','off');
     3099    set(handles.ProjObjectName,'Visible','off');
    30933100end
    30943101
     
    31313138SeriesData.ProjObject=[];
    31323139set(handles.series,'UserData',SeriesData)
    3133 set(handles.ProjObject,'String','')
    3134 set(handles.ProjObject,'Visible','off')
     3140set(handles.ProjObjectName,'String','')
     3141set(handles.ProjObjectName,'Visible','off')
    31353142set(handles.CheckObject,'Value',0)
    31363143set(handles.ViewObject,'Visible','off')
     
    33893396set(handles.series,'UserData',SeriesData)
    33903397if isfield(Param,'CheckObject') && isequal(Param.CheckObject,1)
    3391     set(handles.ProjObject,'String',Param.ProjObject.Name)
     3398    set(handles.ProjObjectName,'String',Param.ProjObject.Name)
    33923399    set(handles.ViewObject,'Visible','on')
    33933400    set(handles.EditObject,'Visible','on')
    33943401    set(handles.DeleteObject,'Visible','on')
    33953402else     
    3396     set(handles.ProjObject,'String','')
    3397     set(handles.ProjObject,'Visible','off')
     3403    set(handles.ProjObjectName,'String','')
     3404    set(handles.ProjObjectName,'Visible','off')
    33983405    set(handles.ViewObject,'Visible','off')
    33993406    set(handles.EditObject,'Visible','off')
     
    38743881    end
    38753882end
     3883
     3884
     3885
Note: See TracChangeset for help on using the changeset viewer.