|
39 | 39 | % |
40 | 40 | % (C) Copyright 2019 CPP_SPM developers |
41 | 41 |
|
42 | | - % |
43 | 42 | [pth, file, ext] = spm_fileparts(tsvFile); |
44 | 43 | tsv.file = validationInputFile(pth, [file, ext]); |
45 | | - |
46 | 44 | tsv.content = bids.util.tsvread(tsv.file); |
47 | 45 |
|
48 | 46 | if ~all(isnumeric(tsv.content.onset)) |
49 | 47 |
|
50 | | - errorID = 'onsetsNotNumeric'; |
51 | 48 | msg = sprintf('%s\n%s', 'Onset column contains non numeric values in file:', tsv.file); |
52 | | - errorHandling(mfilename(), errorID, msg, false, opt.verbosity); |
| 49 | + errorHandling(mfilename(), 'onsetsNotNumeric', msg, false, opt.verbosity); |
53 | 50 |
|
54 | 51 | end |
55 | 52 |
|
56 | 53 | if ~all(isnumeric(tsv.content.duration)) |
57 | 54 |
|
58 | | - errorID = 'durationsNotNumeric'; |
59 | 55 | msg = sprintf('%s\n%s', 'Duration column contains non numeric values in file:', tsv.file); |
60 | | - errorHandling(mfilename(), errorID, msg, false, opt.verbosity); |
| 56 | + errorHandling(mfilename(), 'durationsNotNumeric', msg, false, opt.verbosity); |
61 | 57 |
|
62 | 58 | end |
63 | 59 |
|
64 | 60 | varToConvolve = opt.model.bm.getVariablesToConvolve(); |
65 | 61 | designMatrix = opt.model.bm.getBidsDesignMatrix(); |
66 | 62 | designMatrix = removeIntercept(designMatrix); |
67 | 63 |
|
68 | | - % conditions to be filled in according to the conditions present in each run |
| 64 | + % conditions to be filled according to the conditions present in each run |
69 | 65 | condToModel.names = {}; |
70 | 66 | condToModel.onsets = {}; |
71 | 67 | condToModel.durations = {}; |
|
81 | 77 |
|
82 | 78 | for iVar = 1:numel(varToConvolve) |
83 | 79 |
|
84 | | - trialTypeNotFound = false; % should be dead code by now |
85 | | - variableNotFound = false; |
86 | | - extra = ''; |
87 | | - |
88 | | - % first assume the input is from events.tsv |
| 80 | + % in case we get the column names with a dot separator |
89 | 81 | tokens = regexp(varToConvolve{iVar}, '\.', 'split'); |
90 | 82 |
|
91 | 83 | % if the variable is present in namespace |
|
138 | 130 |
|
139 | 131 | else |
140 | 132 |
|
141 | | - variableNotFound = true; |
142 | | - errorID = 'variableNotFound'; |
143 | | - input1 = 'Variable'; |
144 | | - |
145 | | - end |
146 | | - |
147 | | - if variableNotFound |
148 | | - |
149 | 133 | if opt.glm.useDummyRegressor |
150 | 134 | condToModel = addDummyRegressor(condToModel); |
151 | 135 | end |
152 | 136 |
|
153 | | - msg = sprintf('%s %s not found in \n %s\n Adding dummy regressor instead.', ... |
154 | | - input1, ... |
| 137 | + msg = sprintf('Variable %s not found in \n %s\n Adding dummy regressor instead.', ... |
155 | 138 | varToConvolve{iVar}, ... |
156 | 139 | tsv.file); |
157 | 140 |
|
158 | | - errorHandling(mfilename(), errorID, msg, true, opt.verbosity); |
| 141 | + errorHandling(mfilename(), 'variableNotFound', msg, true, opt.verbosity); |
159 | 142 |
|
160 | 143 | end |
161 | 144 |
|
|
0 commit comments