Skip to content

Commit 6a6b2d3

Browse files
authored
Merge pull request #530 from Remi-Gau/glm_checks
[ENH] add checks and more verbose ouput for subject level GLM specification
2 parents dd44cc8 + e42d7b5 commit 6a6b2d3

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

demos/face_repetition/face_rep_func.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
% instead of AR(1), motion regressors added)
99
%
1010
% TODO
11-
% - add derivatives to the model
12-
% - compute the relevant contrasts
1311
% - compute motion effect
1412
% - run parametric model
1513
%
@@ -46,7 +44,7 @@
4644
bidsResliceTpmToFunc(opt);
4745

4846
% DEBUG
49-
% functionalQA(opt);
47+
functionalQA(opt);
5048

5149
bidsSmoothing(FWHM, opt);
5250

src/batches/setBatchSubjectLevelGLMSpec.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@
100100

101101
for iRun = 1:nbRuns
102102

103+
if ~strcmp(runs{iRun}, '')
104+
fprintf(1, 'Processing run %s\n', runs{iRun});
105+
end
106+
103107
% get functional files
104108
[fullpathBoldFileName, prefix] = ...
105109
getBoldFilenameForFFX(BIDS, opt, subLabel, funcFWHM, iSes, iRun);

src/subject_level/convertOnsetTsvToMat.m

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,29 @@
2626
tsvFile = validationInputFile(pth, [file, ext]);
2727

2828
% Read the tsv file
29-
fprintf('reading the tsv file : %s \n', tsvFile);
29+
fprintf(' Reading the tsv file : %s \n', tsvFile);
3030
t = spm_load(tsvFile);
3131

32+
if ~all(isnumeric(t.onset))
33+
34+
errorStruct.identifier = 'convertOnsetTsvToMat:onsetsNotNumeric';
35+
errorStruct.message = sprintf('%s\n%s', ...
36+
'Onset column contains non numeric values in this file:', ...
37+
tsvFile);
38+
error(errorStruct);
39+
40+
end
41+
42+
if ~all(isnumeric(t.duration))
43+
44+
errorStruct.identifier = 'convertOnsetTsvToMat:durationsNotNumeric';
45+
errorStruct.message = sprintf('%s\n%s', ...
46+
'Duration column contains non numeric values in this file:', ...
47+
tsvFile);
48+
error(errorStruct);
49+
50+
end
51+
3252
if ~isfield(t, 'trial_type')
3353

3454
errorStruct.identifier = 'convertOnsetTsvToMat:noTrialType';
@@ -76,13 +96,17 @@
7696
% each line in the tsv files
7797
idx = find(strcmp(conditionName, conds));
7898

99+
fprintf(' Condition %s: %i trials found.\n', conditionName, numel(idx));
100+
79101
if ~isempty(idx)
80102
% Get the onset and duration of each condition
81103
names{1, end + 1} = conditionName;
82104
onsets{1, end + 1} = t.onset(idx)'; %#ok<*AGROW,*NASGU>
83105
durations{1, end + 1} = t.duration(idx)';
106+
84107
else
85108
warning('No trial found for trial type %s in \n%s', conditionName, tsvFile);
109+
86110
end
87111

88112
end

0 commit comments

Comments
 (0)