Matlab Code for Reducing FA

From Psych 221 Image Systems Engineering
Revision as of 20:32, 9 December 2009 by imported>Psych 204 (Created page with 'Return to function alteredFAmasked = AlterFA(dt6, mask, densitymap, effectsize) % input: % dt6: ie dt.dt6 (can use dt=dtiLoadDt6('dt6.mat')) % mask: name of brain mask, ie …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Return to function alteredFAmasked = AlterFA(dt6, mask, densitymap, effectsize)

% input: % dt6: ie dt.dt6 (can use dt=dtiLoadDt6('dt6.mat')) % mask: name of brain mask, ie 'ab_mask.nii.gz' % densitymap: image of fiber density (betw 0 and 1), i.e. using % dtiComputeFiberDensityNOGUI % effectsize: the factor by which to lower/raise FA (to be weighted by % fiber density). With effectsize of 0.1, weighted effectsize = % 0.1*fiberdensity, and newFA = origFA*[1-(weighted effectsize)] % % returns: % XxYxZ image with altered fa, in image space % % 2009.11.15 JT

fa = dtiComputeFA(dt6); brainMask=readFileNifti(mask); brainMask.data=double(brainMask.data); % effectsize = .1;

weightedESmap = effectsize*densitymap; alteredFA = fa.*(1-weightedESmap); alteredFAmasked = alteredFA.*brainMask.data;

% fa = dtiComputeFA(dt6); % weightedESmap = effectsize*densitymap; % alteredFA = fa.*(1-weightedESmap);

return