|
1 | | -function filename = getConfoundsRegressorFilename(BIDS, opt, subLabel, session, run) |
| 1 | +function filenames = getConfoundsRegressorFilename(BIDS, opt, subLabel, session, run) |
2 | 2 | % |
3 | 3 | % Gets the potential confounds files for a given subject, session, run |
4 | 4 | % |
|
33 | 33 | filter = fileFilterForBold(opt, subLabel, 'confounds'); |
34 | 34 | filter.ses = session; |
35 | 35 | filter.run = run; |
36 | | - filename = bids.query(BIDS, 'data', filter); |
| 36 | + filenames = bids.query(BIDS, 'data', filter); |
37 | 37 |
|
38 | | - if numel(filename) > 1 |
39 | | - disp(filename); |
40 | | - errorHandling(mfilename(), 'tooManyFiles', 'This should only get one file.', false, true); |
| 38 | + if numel(filenames) > 1 |
| 39 | + msg = ['Found several confounds files:' createUnorderedList(filenames)]; |
| 40 | + errorHandling(mfilename(), 'tooManyFiles', msg, true, true); |
41 | 41 |
|
42 | | - elseif isempty(filename) |
| 42 | + elseif isempty(filenames) |
43 | 43 | msg = sprintf('No TSV file found in:\n\t%s\nfor query:%s\n', ... |
44 | 44 | BIDS.pth, ... |
45 | 45 | createUnorderedList(opt.query)); |
46 | 46 | errorHandling(mfilename(), 'noFileFound', msg, true, true); |
| 47 | + |
47 | 48 | end |
48 | 49 |
|
49 | | - filename = filename{1}; |
| 50 | + filenames = filenames{1}; |
50 | 51 |
|
51 | 52 | end |
0 commit comments