|
361 | 361 | % |
362 | 362 | % Only necessary |
363 | 363 | % if the user did not specify the run number in result.name |
364 | | - % by adding an "_[0-9]*" to indicate the run number to get this contrast |
| 364 | + % by adding an "_[0-9]+" to indicate the run number to get this contrast |
365 | 365 | % for example |
366 | 366 | % |
367 | 367 | % opt.result.name = 'listening_1' |
368 | 368 | % |
369 | 369 |
|
370 | | - endsWithRunNumber = regexp(contrastName, '_[0-9]*\${0,1}$', 'match'); |
371 | | - if isempty(endsWithRunNumber) |
372 | | - tmp.name = [contrastName '_[0-9]*']; |
373 | | - else |
| 370 | + tmp.name = [contrastName '_[0-9]+']; |
| 371 | + if ~endsWithRunNumber(contrastName) |
374 | 372 | tmp.name = contrastName; |
375 | 373 | end |
376 | 374 |
|
|
392 | 390 |
|
393 | 391 | contrastNb = getContrastNb(tmp, opt, SPM); |
394 | 392 |
|
395 | | - constrastsNamesList = {SPM.xCon(contrastNb).name}'; |
| 393 | + contrastsNamesList = {SPM.xCon(contrastNb).name}'; |
396 | 394 |
|
397 | | - for j = 1:numel(constrastsNamesList) |
| 395 | + for j = 1:numel(contrastsNamesList) |
398 | 396 |
|
399 | 397 | result = opt.results(iRes); |
400 | 398 |
|
401 | | - result.name = constrastsNamesList{j}; |
| 399 | + result.name = contrastsNamesList{j}; |
402 | 400 |
|
403 | | - if ~isRunLevel |
404 | | - % skip contrast with name ending in _[0-9]* as they are run level |
405 | | - % contrasts |
406 | | - endsWithRunNumber = regexp(result.name, '_[0-9]*$', 'match'); |
407 | | - if ~isempty(endsWithRunNumber) |
408 | | - continue |
409 | | - end |
| 401 | + % skip contrast with name ending in _[0-9]+ |
| 402 | + % as they are run level contrasts |
| 403 | + if ~isRunLevel && endsWithRunNumber(result.name) |
| 404 | + continue |
410 | 405 | end |
411 | 406 |
|
412 | 407 | result.space = opt.space; |
|
0 commit comments