|
1 | 1 | function [roiList, roiFolder] = getROIs(varargin) |
2 | 2 | % |
3 | | - % Get the rois from : |
| 3 | + % Get the rois depending on value of "opt.bidsFilterFile.roi.space": |
4 | 4 | % |
5 | | - % - the group folder when running analysis in MNI space |
6 | | - % - the ``sub-*/roi/sub-subLabel`` folder when in individual space |
| 5 | + % - the group folder for space: "MNI" or "IXI549Space" |
| 6 | + % - the ``sub-*/roi/sub-subLabel`` folder: |
| 7 | + % - when in individual space ('T1w') |
| 8 | + % - or another MNI space |
7 | 9 | % |
8 | 10 | % USAGE:: |
9 | 11 | % |
|
64 | 66 |
|
65 | 67 | else |
66 | 68 |
|
67 | | - % we expect ROI files to have BIDS valid names |
68 | | - BIDS_ROI = bids.layout(opt.dir.roi, 'use_schema', false); |
69 | | - |
70 | 69 | if strcmp(subLabel, '') |
71 | | - msg = sprintf('Provide a subject label amongst those:\n%s\n\n', ... |
72 | | - bids.internal.create_unordered_list(bids.query(BIDS_ROI, 'subjects'))); |
| 70 | + msg = sprintf('Provide a subject label.'); |
73 | 71 | id = 'noSubject'; |
74 | 72 | logger('ERROR', msg, 'filename', mfilename(), 'id', id); |
75 | 73 | end |
76 | 74 |
|
| 75 | + % we expect ROI files to have BIDS valid names |
| 76 | + clear filter; |
| 77 | + filter.sub = {subLabel}; |
| 78 | + filter.modality = {'roi'}; |
| 79 | + BIDS_ROI = bids.layout(opt.dir.roi, ... |
| 80 | + 'use_schema', false, ... |
| 81 | + 'filter', filter, ... |
| 82 | + 'verbose', opt.verbosity > 1, ... |
| 83 | + 'index_dependencies', false); |
| 84 | + |
| 85 | + clear filter; |
77 | 86 | filter = opt.bidsFilterFile.roi; |
78 | 87 | filter.sub = regexify(subLabel); |
79 | 88 |
|
80 | 89 | if ~isempty(roiNames) |
81 | 90 | if iscell(roiNames) |
82 | | - if ~(numel(roiNames) == 1 && ~strcmp(roiNames{1}, '')) |
| 91 | + if numel(roiNames) > 1 |
| 92 | + filter.label = ['(' strjoin(opt.roi.name, '|') '){1}']; |
| 93 | + elseif ~(numel(roiNames) == 1 && ~strcmp(roiNames{1}, '')) |
83 | 94 | else |
84 | 95 | filter.label = ['(' strjoin(opt.roi.name, '|') '){1}']; |
85 | 96 | end |
|
119 | 130 | space = {space}; |
120 | 131 | end |
121 | 132 |
|
122 | | - if any(~cellfun('isempty', regexp(space, 'MNI'))) || ismember('IXI549Space', space) |
| 133 | + if ~strcmp(space{1}, 'MNI') && ~cellfun('isempty', regexp(space, 'MNI')) |
| 134 | + elseif ismember(space, {'IXI549Space', 'MNI'}) |
123 | 135 | space = 'MNI'; |
124 | 136 | end |
125 | 137 |
|
|
0 commit comments