| 1 | function [ListPath, ListSubdir]=read_browsdata (hbrowse) |
|---|
| 2 | |
|---|
| 3 | BrowseData=guidata(hbrowse); |
|---|
| 4 | SourceDir=get(BrowseData.SourceDir,'String'); |
|---|
| 5 | ListExp=get(BrowseData.ListExperiments,'String'); |
|---|
| 6 | ExpIndices=get(BrowseData.ListExperiments,'Value'); |
|---|
| 7 | ListExp=ListExp(ExpIndices); |
|---|
| 8 | ListDevices=get(BrowseData.ListDevices,'String'); |
|---|
| 9 | DeviceIndices=get(BrowseData.ListDevices,'Value'); |
|---|
| 10 | ListDevices=ListDevices(DeviceIndices); |
|---|
| 11 | ListDataSeries=get(BrowseData.DataSeries,'String'); |
|---|
| 12 | DataSeriesIndices=get(BrowseData.DataSeries,'Value'); |
|---|
| 13 | ListDataSeries=ListDataSeries(DataSeriesIndices); |
|---|
| 14 | NbExp=0; % counter of the number of experiments set by the GUI browse_data |
|---|
| 15 | for iexp=1:numel(ListExp) |
|---|
| 16 | if ~isempty(regexp(ListExp{iexp},'^\+/', 'once'))% if it is a folder |
|---|
| 17 | for idevice=1:numel(ListDevices) |
|---|
| 18 | if ~isempty(regexp(ListDevices{idevice},'^\+/', 'once'))% if it is a folder |
|---|
| 19 | for isubdir=1:numel(ListDataSeries) |
|---|
| 20 | if ~isempty(regexp(ListDataSeries{isubdir},'^\+/', 'once'))% if it is a folder |
|---|
| 21 | lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),... |
|---|
| 22 | regexprep(ListDevices{idevice},'^\+/','')); |
|---|
| 23 | ldir= regexprep(ListDataSeries{isubdir},'^\+/',''); |
|---|
| 24 | if exist(fullfile(lpath,ldir),'dir') |
|---|
| 25 | NbExp=NbExp+1; |
|---|
| 26 | ListPath{NbExp}=lpath; |
|---|
| 27 | ListSubdir{NbExp}=ldir; |
|---|
| 28 | ExpIndex{NbExp}=iexp; |
|---|
| 29 | end |
|---|
| 30 | end |
|---|
| 31 | end |
|---|
| 32 | end |
|---|
| 33 | end |
|---|
| 34 | end |
|---|
| 35 | end |
|---|