forked from BUNPC/DataTree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoadDataTree.m
54 lines (49 loc) · 1.65 KB
/
LoadDataTree.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function dataTree = LoadDataTree(varargin)
% Syntax:
%
% dataTree = LoadDataTree()
% dataTree = LoadDataTree(groupDirs)
% dataTree = LoadDataTree(groupDirs, fmt)
% dataTree = LoadDataTree(groupDirs, fmt, procStreamCfgFile)
% dataTree = LoadDataTree(groupDirs, fmt, procStreamCfgFile, parent)
%
% Description:
%
% This function is (or will be) used by all the Homer3 GUIs
% (e.g., ProcStreamGUI, PlotProbeGUI, StimEditGUI, and ofcourse
% Homer3 GUI itself) to load the primary Homer3 data class object,
% dataTree, containing group, subject and run data.
%
% First get all the argument there are to get using the 5 possible syntax
% calls
if nargin==0
groupDirs{1} = pwd;
fmt = '';
procStreamCfgFile = '';
parent = [];
elseif nargin==1
groupDirs = varargin{1};
fmt = '';
procStreamCfgFile = '';
parent = []';
elseif nargin==2
groupDirs = varargin{1};
fmt = varargin{2};
procStreamCfgFile = '';
parent = []';
elseif nargin==3
groupDirs = varargin{1};
fmt = varargin{2};
procStreamCfgFile = varargin{3};
parent = []';
elseif nargin==4
groupDirs = varargin{1};
fmt = varargin{2};
procStreamCfgFile = varargin{3};
parent = varargin{4};
end
if isempty(parent) || ~isproperty(parent, 'dataTree') || isempty(parent.dataTree)
dataTree = DataTreeClass(groupDirs, fmt, procStreamCfgFile);
else
dataTree = parent.dataTree;
end