Closed lukasvo76 closed 3 years ago
Adding the following on line 394-7 of _canlab_glm_subject_levelsrun1subject.m solves the problem! I have tested this solution on my 60 subjects, and @bogpetre will do so on paingen, after which we will commit and push.
for m=1:size(multipleregressors,2)
idx(m)=isempty(multipleregressors{m});
end
multipleregressors(idx)=[];
I ended up fixing the issue differently, changes have been committed and pushed a few months ago!
If
DSGN.allowmissingfunc = true
, and you have missing functional files for runs that are not the last runs of your subject, noise_regs.mat files (containing the spm-style R matrix) are not assigned to the correct runs. When a folder for a run is empty, this is handled correctly for onsets and durations files, but not for the noise_reg files. For the latter, the code looks for a noise_regs.mat file in the folder for the empty run, does not find one, causing the mutliple regressors field in the spm batch file to be empty, and then picking the wrong noise_regs.mat file for the following run (the file for run n-1 is assigned to run n). The problem seems to be located in canlab_glm_subject_levels_run1subject.m, which is a child process of canlab_glm_subject_levels.m - I may need some help to fix it but should definitely be feasible @bogpetre @torwager