|
180 | 180 |
|
181 | 181 | for iCon = 1:length(node.Contrasts) |
182 | 182 |
|
183 | | - this_contrast = checkContrast(node, iCon); |
| 183 | + thisContrast = checkContrast(model, node, iCon); |
184 | 184 |
|
185 | | - if isempty(this_contrast) || strcmp(this_contrast.Test, 'pass') |
| 185 | + if isempty(thisContrast) || strcmp(thisContrast.Test, 'pass') |
186 | 186 | continue |
187 | 187 | end |
188 | 188 |
|
189 | | - conditionList = this_contrast.ConditionList; |
| 189 | + conditionList = thisContrast.ConditionList; |
190 | 190 |
|
191 | 191 | for iCdt = 1:length(conditionList) |
192 | 192 | cdtName = conditionList{iCdt}; |
|
201 | 201 |
|
202 | 202 | if length(nbRuns) > 1 |
203 | 203 | msg = sprintf('Skipping contrast %s: runs are missing condition %s', ... |
204 | | - this_contrast.Name, cdtName); |
| 204 | + thisContrast.Name, cdtName); |
205 | 205 | id = 'runMissingCondition'; |
206 | 206 | logger('WARNING', msg, 'id', id, 'filename', mfilename()); |
207 | 207 |
|
|
213 | 213 | % Use the SPM Sess index for the contrast name |
214 | 214 | iSess = getSessionForRegressorNb(regIdx{1}(iRun), model.SPM); |
215 | 215 |
|
216 | | - contrastName = constructContrastNameFromBidsEntity(this_contrast.Name, model.SPM, iSess); |
217 | | - C = newContrast(model.SPM, contrastName, this_contrast.Test, conditionList); |
| 216 | + contrastName = constructContrastNameFromBidsEntity(thisContrast.Name, model.SPM, iSess); |
| 217 | + C = newContrast(model.SPM, contrastName, thisContrast.Test, conditionList); |
218 | 218 |
|
219 | 219 | for iCdt = 1:length(conditionList) |
220 | 220 |
|
221 | | - if strcmp(this_contrast.Test, 't') |
222 | | - C.C(end, regIdx{iCdt}(iRun)) = this_contrast.Weights(iCdt); |
| 221 | + if strcmp(thisContrast.Test, 't') |
| 222 | + C.C(end, regIdx{iCdt}(iRun)) = thisContrast.Weights(iCdt); |
223 | 223 |
|
224 | | - elseif strcmp(this_contrast.Test, 'F') |
225 | | - C.C(iCdt, regIdx{iCdt}(iRun)) = this_contrast.Weights(iCdt); |
| 224 | + elseif strcmp(thisContrast.Test, 'F') |
| 225 | + for i = 1:size(thisContrast.Weights, 1) |
| 226 | + C.C(i, regIdx{iCdt}(iRun)) = thisContrast.Weights(i, iCdt); |
| 227 | + end |
226 | 228 |
|
227 | 229 | end |
228 | 230 |
|
229 | 231 | end |
230 | 232 |
|
231 | | - [contrasts, counter] = appendContrast(contrasts, C, counter, this_contrast.Test); |
| 233 | + [contrasts, counter] = appendContrast(contrasts, C, counter, thisContrast.Test); |
232 | 234 |
|
233 | 235 | end |
234 | 236 |
|
|
0 commit comments