Skip to content

Commit 28f3898

Browse files
authored
[FIX] do not compute subject level contrast when running dataset level (#1102)
* do not compute subject level contrast when running dataset level * update change log
1 parent 54e2111 commit 28f3898

File tree

5 files changed

+49
-4
lines changed

5 files changed

+49
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424

2525
### Added
2626

27-
* [DOC] support label of activations with all atlases [1100](https://github.com/cpp-lln-lab/bidspm/pull/1100) by [Remi-Gau](https://github.com/Remi-Gau)
27+
* [ENH] support label of activations with all atlases [1100](https://github.com/cpp-lln-lab/bidspm/pull/1100) by [Remi-Gau](https://github.com/Remi-Gau)
2828

2929
### Changed
3030

@@ -38,7 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3838

3939
### Fixed
4040

41-
* [INFRA] copy `RepetitionTime` in sidecar JSON after running smoothing in #1099 by @Remi-Gau
41+
* [FIX] do not compute subject level contrast when running dataset level #1102 by @Remi-Gau
42+
* [FIX] copy `RepetitionTime` in sidecar JSON after running smoothing in #1099 by @Remi-Gau
4243

4344
### Security
4445

demos/openneuro/ds000001_aroma_run.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,9 @@
4747
'participant_label', participant_label, ...
4848
'preproc_dir', preproc_dir, ...
4949
'model_file', model_file);
50+
51+
%% dataset level
52+
bidspm(bids_dir, output_dir, 'dataset', ...
53+
'action', 'results', ...
54+
'preproc_dir', preproc_dir, ...
55+
'model_file', model_file);

demos/openneuro/models/model-balloonanalogrisktaskAroma_smdl.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,36 @@
8585
"DummyContrasts": {
8686
"Test": "t"
8787
}
88+
},
89+
{
90+
"Level": "Dataset",
91+
"Name": "dataset_level",
92+
"GroupBy": [
93+
"contrast"
94+
],
95+
"Model": {
96+
"X": [
97+
1
98+
],
99+
"Type": "glm",
100+
"Software": {
101+
"bidspm": {
102+
"Results": [
103+
{
104+
"name": [
105+
"cash_demean",
106+
"control_pumps_demean",
107+
"explode_demean",
108+
"pumps_demean"
109+
]
110+
}
111+
]
112+
}
113+
}
114+
},
115+
"DummyContrasts": {
116+
"Test": "t"
117+
}
88118
}
89119
]
90120
}

src/cli/cliStats.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ function cliStats(varargin)
8888
end
8989

9090
if results
91-
bidsResults(opt, 'nodeName', nodeName);
91+
bidsResults(opt, 'nodeName', nodeName, ...
92+
'analysisLevel', analysisLevel);
9293
end
9394

9495
end

src/workflows/stats/bidsResults.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,14 @@
143143

144144
args.addRequired('opt', @isstruct);
145145
args.addParameter('nodeName', '');
146+
args.addParameter('analysisLevel', '', @ischar);
146147

147148
args.parse(varargin{:});
148149

149150
opt = args.Results.opt;
150151

151152
nodeName = args.Results.nodeName;
153+
analysisLevel = args.Results.analysisLevel;
152154

153155
%%
154156
currentDirectory = pwd;
@@ -177,10 +179,15 @@
177179
keep = ismember(listNodeNames, nodeName);
178180
opt.results = opt.results(keep);
179181
end
182+
listNodeLevels = returnlistNodeLevels(opt);
183+
if ~isempty(analysisLevel)
184+
keep = ismember(listNodeLevels, analysisLevel);
185+
opt.results = opt.results(keep);
186+
listNodeLevels = listNodeLevels(keep);
187+
end
180188

181189
% skip data indexing if we are only at the group level
182190
indexData = true;
183-
listNodeLevels = returnlistNodeLevels(opt);
184191
if all(ismember(listNodeLevels, 'dataset'))
185192
indexData = false;
186193
end

0 commit comments

Comments
 (0)