|
8 | 8 | % |
9 | 9 | % :param opt: Options chosen for the analysis. |
10 | 10 | % See :func:`checkOptions`. |
11 | | - % |
12 | 11 | % :type opt: structure |
13 | 12 | % |
14 | 13 | % :param bidsDir: the directory where the data is ; defaults to |
15 | 14 | % ``fullfile(opt.dataDir, '..', 'derivatives', 'bidspm')`` |
16 | | - % |
17 | 15 | % :type bidsDir: char |
18 | 16 | % |
19 | 17 | % :param indexDependencies: Use ``'index_dependencies', true`` |
20 | 18 | % in bids.layout. |
21 | | - % |
22 | 19 | % :type indexDependencies: logical |
23 | 20 | % |
| 21 | + % :param layoutFilter: filter to pass to bids.layout. default = struct() |
| 22 | + % :type layoutFilter: struct |
| 23 | + % |
| 24 | + % |
24 | 25 | % :return: opt |
25 | 26 | % :rtype: structure |
26 | 27 | % |
|
38 | 39 | addRequired(args, 'opt', @isstruct); |
39 | 40 | addRequired(args, 'bidsDir', isFolder); |
40 | 41 | addOptional(args, 'indexDependencies', true, @islogical); |
| 42 | + addOptional(args, 'layoutFilter', struct(), @isstruct); |
41 | 43 |
|
42 | 44 | try |
43 | 45 | parse(args, varargin{:}); |
|
60 | 62 | indexDependencies = false; |
61 | 63 | end |
62 | 64 |
|
| 65 | + layoutFilter = args.Results.layoutFilter; |
| 66 | + |
63 | 67 | anatOnly = false; |
64 | 68 | if isfield(opt, 'anatOnly') |
65 | 69 | anatOnly = opt.anatOnly; |
|
72 | 76 |
|
73 | 77 | validationInputFile(bidsDir, 'dataset_description.json'); |
74 | 78 |
|
75 | | - layout_filter = struct([]); |
76 | 79 | if ~isempty(opt.subjects{1}) && ~ismember('', opt.subjects) |
77 | | - layout_filter = struct('sub', {opt.subjects}); |
| 80 | + layoutFilter.sub = opt.subjects; |
78 | 81 | end |
79 | 82 |
|
80 | 83 | if anatOnly |
81 | | - layout_filter(1).modality = {'anat'}; |
| 84 | + layoutFilter(1).modality = {'anat'}; |
82 | 85 | end |
83 | 86 |
|
84 | 87 | BIDS = bids.layout(bidsDir, ... |
85 | 88 | 'use_schema', opt.useBidsSchema, ... |
86 | 89 | 'verbose', opt.verbosity > 1, ... |
87 | | - 'filter', layout_filter, ... |
| 90 | + 'filter', layoutFilter, ... |
88 | 91 | 'index_dependencies', indexDependencies); |
89 | 92 |
|
90 | 93 | if strcmp(opt.pipeline.type, 'stats') && ~opt.pipeline.isBms |
|
96 | 99 |
|
97 | 100 | if isempty(fieldnames(tmp)) |
98 | 101 | BIDS.raw = bids.layout(opt.dir.raw, ... |
99 | | - 'filter', layout_filter, ... |
| 102 | + 'filter', layoutFilter, ... |
100 | 103 | 'index_dependencies', indexDependencies); |
101 | 104 | else |
102 | 105 | BIDS.raw = tmp.BIDS; |
103 | 106 | end |
104 | 107 | else |
105 | 108 | BIDS.raw = bids.layout(opt.dir.raw, ... |
106 | 109 | 'verbose', opt.verbosity > 1, ... |
107 | | - 'filter', layout_filter); |
| 110 | + 'filter', layoutFilter); |
108 | 111 | end |
109 | 112 | end |
110 | 113 |
|
|
0 commit comments