Skip to content

Commit

Permalink
M cvManovaTest/cvManovaTest.m
Browse files Browse the repository at this point in the history
M	cvManovaTest/cvManovaTest_model.m
M	cvManovaTest/cvManovaTest_preprocess.m
  • Loading branch information
allefeld committed Nov 1, 2019
1 parent 7d285b9 commit ca2b75f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cvManovaTest/cvManovaTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
%
% It can also be taken as an example for how to use the implementation.
%
% With Matlab 8.5.0 (R2015a) and SPM12 r6685, this script
% With Matlab R2015a–R2019a and SPM12 r6685, this script
% produces the following pattern distinctness values on regions:
% region 1, contrast 1: D = 5.443427
% region 1, contrast 2: D = 1.021870
Expand Down Expand Up @@ -67,3 +67,4 @@
% check results
cvManovaTest_check
fprintf('\nconsider deleting the directory %s and its contents\n', modelDir)

5 changes: 3 additions & 2 deletions cvManovaTest/cvManovaTest_model.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
fmri_spec.timing.fmri_t0 = 12;
for ri = 1 : nRuns
vi = (ri - 1) * nVolsPerRun + (1 : nVolsPerRun);
vn = arrayfun(@(i) sprintf('%s,%d', [pwd filesep fnrBOLD], i), vi, 'UniformOutput', false);
vn = arrayfun(@(i) sprintf('%s,%d', [pwd filesep fnrBOLD], i), ...
vi, 'UniformOutput', false);
Q = nan(nVolsPerRun, 6);
for i = 1 : nVolsPerRun
qq = spm_imatrix(mat(:, :, vi(i)) / mat(:, :, vi(1)));
Q(i, :) = qq(1 : 6);
end

fmri_spec.sess(ri).scans = vn;
fmri_spec.sess(ri).scans = vn';
for ci = 1 : numel(conditions)
fmri_spec.sess(ri).cond(ci).name = conditions{ci};
fmri_spec.sess(ri).cond(ci).onset = onsets{ri, ci};
Expand Down
3 changes: 2 additions & 1 deletion cvManovaTest/cvManovaTest_preprocess.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
matlabbatch = {};
for ri = 1 : nRuns
vi = (ri - 1) * nVolsPerRun + (1 : nVolsPerRun);
vn = arrayfun(@(i) sprintf('%s,%d', fnBOLD, i), vi, 'UniformOutput', false);
vn = arrayfun(@(i) sprintf('%s,%d', fnBOLD, i), ...
vi, 'UniformOutput', false);
matlabbatch{1}.spm.spatial.realign.estwrite.data{ri} = vn';
end
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.quality = 0.9;
Expand Down

0 comments on commit ca2b75f

Please sign in to comment.