Skip to content

Commit 69fb49e

Browse files
committed
fix bugs
1 parent 36151fb commit 69fb49e

File tree

3 files changed

+33
-28
lines changed

3 files changed

+33
-28
lines changed

demos/bayes/ds000114_run.m

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
addpath(fullfile(pwd, '..', '..'));
77
bidspm();
88

9+
VERBOSITY = 2;
10+
11+
FWHM = 8;
12+
913
% set to false to not re run the smoothing
1014
SMOOTH = true;
1115

1216
% set to false to not re run the model specification
1317
FIRST_LEVEL = true;
1418

15-
VERBOSITY = 1;
16-
17-
FWHM = 8;
18-
19-
% to run on fewer subjects
19+
% set to true to run on fewer subjects and fewer models
2020
TESTING = true;
2121

2222
% The directory where the data are located
@@ -56,9 +56,9 @@
5656
multiverse.non_steady_state = {false, true};
5757

5858
if TESTING
59-
multiverse.motion = {'none', 'basic'};
60-
multiverse.wm_csf = {'none'};
61-
multiverse.non_steady_state = {false};
59+
multiverse.motion = {'basic', 'full'};
60+
multiverse.scrub = {false, true};
61+
multiverse.non_steady_state = {true};
6262
end
6363

6464
createModelFamilies(default_model_file, multiverse, models_dir);
@@ -69,6 +69,9 @@
6969
%% Subject level analysis
7070
if FIRST_LEVEL
7171

72+
% Silence this warning as this dataset has not been slice time corrected.
73+
warning('OFF', 'setBatchSubjectLevelGLMSpec:noSliceTimingInfoForGlm');
74+
7275
bidspm(bids_dir, output_dir, 'subject', ...
7376
'participant_label', participant_label, ...
7477
'action', 'specify_only', ...

src/bids_model/addConfoundsToDesignMatrix.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@
208208
strategy.(strategies{i}) = {strategy.(strategies{i})};
209209
end
210210

211-
if isnan(strategy.(strategies{i}){1})
211+
if ~isempty(strategy.(strategies{i})) && ...
212+
isnumeric(strategy.(strategies{i}){1}) && ...
213+
isnan(strategy.(strategies{i}){1})
212214
strategy.(strategies{i}){1} = tmp.(strategies{i});
213215
end
214216

tests/tests_bids_model/test_addConfoundsToDesignMatrix.m

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@
77
initTestSuite;
88
end
99

10+
function test_addConfoundsToDesignMatrix_default()
11+
12+
bm = BidsModel('init', true);
13+
14+
bm = addConfoundsToDesignMatrix(bm);
15+
assertEqual(numel(bm.Nodes{1}.Model.X), 0);
16+
17+
strategy.strategies = {'motion', 'non_steady_state'};
18+
strategy.motion = 'basic';
19+
strategy.non_steady_state = true;
20+
21+
bm = addConfoundsToDesignMatrix(bm, 'strategy', strategy);
22+
assertEqual(numel(bm.Nodes{1}.Model.X), 3);
23+
assertEqual(ismember({'rot_?', 'trans_?', 'non_steady_state_outlier*'}, ...
24+
bm.Nodes{1}.Model.X), ...
25+
true(1, 3));
26+
27+
end
28+
1029
function test_addConfoundsToDesignMatrix_from_file()
1130

1231
modelFile = fullfile(getTestDataDir(), 'models', ...
@@ -83,25 +102,6 @@ function test_addConfoundsToDesignMatrix_update_name()
83102
assertEqual(bm.Nodes{1}.Name, [nameBefore '_rp-full_scrub-1_tissue-full_nsso-1']);
84103
end
85104

86-
function test_addConfoundsToDesignMatrix_default()
87-
88-
bm = BidsModel('init', true);
89-
90-
bm = addConfoundsToDesignMatrix(bm);
91-
assertEqual(numel(bm.Nodes{1}.Model.X), 0);
92-
93-
strategy.strategies = {'motion', 'non_steady_state'};
94-
strategy.motion = 'basic';
95-
strategy.non_steady_state = true;
96-
97-
bm = addConfoundsToDesignMatrix(bm, 'strategy', strategy);
98-
assertEqual(numel(bm.Nodes{1}.Model.X), 3);
99-
assertEqual(ismember({'rot_?', 'trans_?', 'non_steady_state_outlier*'}, ...
100-
bm.Nodes{1}.Model.X), ...
101-
true(1, 3));
102-
103-
end
104-
105105
function test_addConfoundsToDesignMatrix_warning()
106106

107107
if bids.internal.is_octave()

0 commit comments

Comments
 (0)