Dear Freesurfer expert
I have produce a script to make percent difference in cortical thickens using information from the mailing list. Could you please take look if this script is correct, or if there is a better way to do it?
function [ out ] = diff_map( difference, average ) %percent difference Summary of this function goes here % This function takes two gamma.mgh from group differences 1 -1 and divide % with gamma.mgh from 0.5 0.5 to produce a new mgh with percent % difference between two groups. % Copyright Knut Jørgen Bjuland knutjbj@hotmail.com % Freesurfer license mat=fast_vol2mat(difference.vol); n=size(mat);
for i=1:n(2), mat(i)=difference.vol(i)*100/average.vol(i); end
out=difference; out.vol=fast_mat2vol(mat,out.volsize);
end
how about this instead?
out = difference; out.vol = 100*difference.vol./average.vol;
On 10/18/2012 04:00 PM, Knut J Bjuland wrote:
Dear Freesurfer expert
I have produce a script to make percent difference in cortical thickens using information from the mailing list. Could you please take look if this script is correct, or if there is a better way to do it?
function [ out ] = diff_map( difference, average ) %percent difference Summary of this function goes here % This function takes two gamma.mgh from group differences 1 -1 and divide % with gamma.mgh from 0.5 0.5 to produce a new mgh with percent % difference between two groups. % Copyright Knut Jørgen Bjulandknutjbj@hotmail.com % Freesurfer license mat=fast_vol2mat(difference.vol); n=size(mat);
for i=1:n(2), mat(i)=difference.vol(i)*100/average.vol(i); end
out=difference; out.vol=fast_mat2vol(mat,out.volsize);
end
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu