Skip to content

Commit f761d3f

Browse files
authored
Merge pull request #772 from Remi-Gau/design_only
[ENH] add design only to CLI
2 parents 5c45768 + b9c2021 commit f761d3f

File tree

3 files changed

+38
-11
lines changed

3 files changed

+38
-11
lines changed

bidspm.m

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function bidspm(varargin)
1616
isEmptyOrCellstr = @(x) isempty(x) || iscellstr(x); %#ok<*ISCLSTR>
1717
isFileOrStruct = @(x) isstruct(x) || exist(x, 'file') == 2;
1818

19-
isLogical = @(x) islogial(x) && numel(x) == 1;
19+
isLogical = @(x) islogical(x) && numel(x) == 1;
2020
isChar = @(x) ischar(x);
2121
isPositiveScalar = @(x) isnumeric(x) && numel(x) == 1 && x >= 0;
2222

@@ -51,6 +51,7 @@ function bidspm(varargin)
5151
addParameter(args, 'preproc_dir', pwd, isFolder);
5252
addParameter(args, 'model_file', struct([]), isFileOrStruct);
5353
addParameter(args, 'roi_based', false, isLogical);
54+
addParameter(args, 'design_only', false, isLogical);
5455
% group level stats only
5556
addParameter(args, 'node_name', '', isChar);
5657

@@ -195,6 +196,7 @@ function bidspm(varargin)
195196
% stats
196197
opt.dir.preproc = args.Results.preproc_dir;
197198
opt.model.file = args.Results.model_file;
199+
opt.model.designOnly = args.Results.design_only;
198200

199201
opt = overrideRoiBased(opt, args);
200202

@@ -322,16 +324,27 @@ function stats(args)
322324
contrasts = ismember(action, {'stats', 'contrasts'});
323325
results = ismember(action, {'stats', 'contrasts', 'results'});
324326

327+
if opt.model.designOnly
328+
contrasts = false;
329+
results = false;
330+
end
331+
325332
if opt.glm.roibased.do
326333

327334
bidsFFX('specify', opt);
328-
bidsRoiBasedGLM(opt);
335+
if ~opt.model.designOnly
336+
bidsRoiBasedGLM(opt);
337+
end
329338

330339
else
331340

332341
if estimate
333342
if isSubjectLevel
334-
bidsFFX('specifyAndEstimate', opt);
343+
if opt.model.designOnly
344+
bidsFFX('specify', opt);
345+
else
346+
bidsFFX('specifyAndEstimate', opt);
347+
end
335348
else
336349
bidsRFX('RFX', opt, 'nodeName', nodeName);
337350
end

demos/MoAE/test_moae.m

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
models = {fullfile(WD, 'models', 'model-MoAE_smdl.json')
4848
fullfile(WD, 'models', 'model-MoAE_smdl.json')
4949
fullfile(WD, 'models', 'model-MoAEindividual_smdl.json')
50-
fullfile(WD, 'models', 'model-MoAEindividual_smdl.json')
51-
};
50+
fullfile(WD, 'models', 'model-MoAEindividual_smdl.json')};
5251

5352
for iOption = 1:numel(space)
5453

@@ -69,6 +68,16 @@
6968
%% stats
7069
preproc_dir = fullfile(output_dir, 'bidspm-preproc');
7170

71+
% only specify the subject level model
72+
bidspm(bids_dir, output_dir, 'subject', ...
73+
'participant_label', {'01'}, ...
74+
'action', 'stats', ...
75+
'preproc_dir', preproc_dir, ...
76+
'model_file', models{iOption}, ...
77+
'options', optionsFile, ...
78+
'design_only', true);
79+
80+
% specify, estimate model and contrasts, and view results
7281
bidspm(bids_dir, output_dir, 'subject', ...
7382
'participant_label', {'01'}, ...
7483
'action', 'stats', ...

src/messages/bidspmHelp.m

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ function bidspmHelp()
136136
% 'space', {'individual', 'IXI549Space'}, ...
137137
% 'options', struct([]), ...,
138138
% 'roi_based', false, ...
139+
% 'design_only', false, ...
139140
% 'ignore', {}, ...
140141
% 'task', {}, ...
141142
% 'fwhm', 6)
@@ -153,16 +154,20 @@ function bidspmHelp()
153154
% *Optional parameters*
154155
%
155156
% :param roi_based:
156-
% :type roi_based: logical
157+
% :type roi_based: logical
157158
%
158159
% :param task:
159-
% :type task: cell string
160+
% :type task: cell string
160161
%
161-
% :param fwhm: smoothing lelvel of the preprocessed data
162-
% :type fwhm: positive scalar
162+
% :param fwhm: smoothing lelvel of the preprocessed data
163+
% :type fwhm: positive scalar
164+
%
165+
% :param design_only: to only run the model specification when at the group level
166+
% :type design_only: logical
167+
%
168+
% :param ignore: can be any of ``{'qa'}``
169+
% :type ignore: cell string
163170
%
164-
% :param ignore: can be any of ``{'qa'}``
165-
% :type ignore: cell string
166171
%
167172
% **low level calls**
168173
%

0 commit comments

Comments
 (0)