Skip to content

Commit

Permalink
Merge pull request #7 from ebalteau/master
Browse files Browse the repository at this point in the history
Bug fix - retrieving file names
  • Loading branch information
EvelyneBalteau authored and GitHub Enterprise committed Mar 20, 2018
2 parents e429369 + e663168 commit 22204bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hmri_create_MTProt.m
Expand Up @@ -295,13 +295,15 @@
if mpm_params.QA.enable
fprintf(1,'\n -------- multi-contrast R2* map calculation for QA --------\n');

fR2sQA = cell(1,mpm_params.ncon);
for ccon = 1:mpm_params.ncon
fR2sQA{ccon} = fullfile(calcpath,[outbasename '_R2s_' mpm_params.input(ccon).tag 'w.nii']);
dt = [spm_type('float32'),spm_platform('bigend')];
Ni = nifti;
Ni.mat = V_pdw(1).mat;
Ni.mat0 = V_pdw(1).mat;
Ni.descrip='OLS R2* map [s-1]';
Ni.dat = file_array(fullfile(calcpath,[outbasename '_R2s_' mpm_params.input(ccon).tag 'w.nii']),dm,dt, 0,1,0);
Ni.dat = file_array(fR2sQA{ccon},dm,dt, 0,1,0);
create(Ni);

TE = mpm_params.input(ccon).TE;
Expand Down Expand Up @@ -782,7 +784,7 @@
% calculate SD within the WM mask (measure of the intra-run motion for
% each contrast)
for ccon = 1:mpm_params.ncon
R2s = spm_read_vols(spm_vol(spm_select('FPList',calcpath,sprintf('^s.*_R2s_%sw.nii$',mpm_params.input(ccon).tag))));
R2s = spm_read_vols(spm_vol(fR2sQA{ccon}));
MaskedR2s = squeeze(R2s.*WMmask);
SDR2s = std(MaskedR2s(MaskedR2s~=0),[],1);
mpm_params.QA.SDR2s.([mpm_params.input(ccon).tag 'w']) = SDR2s;
Expand Down

0 comments on commit 22204bb

Please sign in to comment.