Skip to content

Commit e9e87a8

Browse files
committed
ensure that bidsResults show all contrasts results at the group level
1 parent 004b438 commit e9e87a8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/batches/stats/setBatchGroupLevelResults.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
load(fullfile(result.dir, 'SPM.mat'));
2424
result.nbSubj = SPM.nscan;
2525

26-
result.contrastNb = 1;
27-
2826
result.label = 'group';
2927

3028
result.outputName = defaultOuputNameStruct(opt, result);

src/workflows/stats/bidsResults.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@
374374
if all(ismember(lower(groupBy), {'contrast'}))
375375

376376
result.name = name;
377+
result.contrastNb = 1;
377378
result.dir = getRFXdir(opt, result.nodeName, name);
378379

379380
[matlabbatch, results] = appendToBatch(matlabbatch, opt, results, result);
@@ -389,6 +390,7 @@
389390

390391
thisGroup = availableGroups{iGroup};
391392
result.name = [thisGroup ' - ' name];
393+
result.contrastNb = 1;
392394
result.dir = getRFXdir(opt, result.nodeName, name, thisGroup);
393395

394396
[matlabbatch, results] = appendToBatch(matlabbatch, opt, results, result);
@@ -400,10 +402,14 @@
400402
case 'two_sample_t_test'
401403

402404
thisContrast = opt.model.bm.get_contrasts('Name', result.nodeName);
403-
result.name = [thisContrast{1}.Name ' - ' name];
405+
404406
result.dir = getRFXdir(opt, result.nodeName, name);
405407

406-
[matlabbatch, results] = appendToBatch(matlabbatch, opt, results, result);
408+
for iCon = 1:numel(thisContrast)
409+
result.name = [thisContrast{iCon}.Name ' - ' name];
410+
result.contrastNb = iCon;
411+
[matlabbatch, results] = appendToBatch(matlabbatch, opt, results, result);
412+
end
407413

408414
otherwise
409415
msg = sprintf('Node %s has has model type I cannot handle.\n', result.nodeName);

0 commit comments

Comments
 (0)