Matlab Code for Reducing FA: Difference between revisions
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 …' |
imported>Psych 204 No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Return to | Return to [[2009 Christine McLeavey & Jessica Tsang]] | ||
function alteredFAmasked = AlterFA(dt6, mask, densitymap, effectsize) | <br> | ||
<br>function alteredFAmasked = AlterFA(dt6, mask, densitymap, effectsize) | |||
<br> | |||
% input: | <br> | ||
% dt6: ie dt.dt6 (can use dt=dtiLoadDt6('dt6.mat')) | <br>fa = dtiComputeFA(dt6); | ||
% mask: name of brain mask, ie 'ab_mask.nii.gz' | <br>brainMask=readFileNifti(mask); | ||
% densitymap: image of fiber density (betw 0 and 1), i.e. using | <br>brainMask.data=double(brainMask.data); | ||
% dtiComputeFiberDensityNOGUI | <br> | ||
% effectsize: the factor by which to lower/raise FA (to be weighted by | <br>weightedESmap = effectsize*densitymap; % effectsize=.085 | ||
% fiber density). With effectsize of 0.1, weighted effectsize = | <br>alteredFA = fa.*(1-weightedESmap); | ||
% 0.1*fiberdensity, and newFA = origFA*[1-(weighted effectsize)] | <br>alteredFAmasked = alteredFA.*brainMask.data; | ||
% | <br> | ||
% returns: | <br>% Historical: | ||
% XxYxZ image with altered fa, in image space | <br>% input: | ||
% | <br>% dt6: ie dt.dt6 (can use dt=dtiLoadDt6('dt6.mat')) | ||
% 2009.11.15 JT | <br>% mask: name of brain mask, ie 'ab_mask.nii.gz' | ||
<br>% densitymap: image of fiber density (betw 0 and 1), i.e. using | |||
<br>% dtiComputeFiberDensityNOGUI | |||
<br>% effectsize: the factor by which to lower/raise FA (to be weighted by | |||
<br>% fiber density). With effectsize of 0.1, weighted effectsize = | |||
% effectsize = .1; | <br>% 0.1*fiberdensity, and newFA = origFA*[1-(weighted effectsize)] | ||
<br>% | |||
<br>% returns: | |||
<br>% XxYxZ image with altered fa, in image space | |||
<br>% | |||
<br>% 2009.11.15 JT | |||
% fa = dtiComputeFA(dt6); | <br>% effectsize = .1; | ||
% weightedESmap = effectsize*densitymap; | <br>% fa = dtiComputeFA(dt6); | ||
% alteredFA = fa.*(1-weightedESmap); | <br>% weightedESmap = effectsize*densitymap; | ||
<br>% alteredFA = fa.*(1-weightedESmap); | |||
return | <br> | ||
<br>return |
Latest revision as of 17:59, 11 December 2009
Return to 2009 Christine McLeavey & Jessica Tsang
function alteredFAmasked = AlterFA(dt6, mask, densitymap, effectsize)
fa = dtiComputeFA(dt6);
brainMask=readFileNifti(mask);
brainMask.data=double(brainMask.data);
weightedESmap = effectsize*densitymap; % effectsize=.085
alteredFA = fa.*(1-weightedESmap);
alteredFAmasked = alteredFA.*brainMask.data;
% Historical:
% 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
% effectsize = .1;
% fa = dtiComputeFA(dt6);
% weightedESmap = effectsize*densitymap;
% alteredFA = fa.*(1-weightedESmap);
return