Print

Print



Here's the same in csh using dc in case you prefer your calculations reverse polish :)
lowercase -m and -v give stats for non-zero voxels without setting the threshold.

set a = `fslstats image.nii.gz -m`
set b = `fslstats image.nii.gz -v`
set sum = `echo "${a} ${b[1]} * p" | dc`


On 28 July 2011 16:12, Auer, Tibor MD. Ph.D. <[log in to unmask]> wrote:
Sorry, there is one more modification (the previous will give you the sum of non-zeros):

voxmean=$(fslstats img -l 0 -M);
voxnum=$(fslstats img -l 0 -V | awk '{print $1}');

voxsum=$(echo "$voxmean*$voxnum" | bc);

Auer, Tibor M.D. Ph.D.
Biomedizinische NMR Forschungs GmbH
am Max-Planck Institut für Biophysikalische Chemie
Am Fassberg 11
37077 Göttingen
Germany
Phone/Work: +49-(0)551-201-1725
Mobile: +49-(0)176-8012-7921
E-Mail: [log in to unmask]


-----Original Message-----
From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Gabor Perlaki
Sent: Thursday, July 28, 2011 5:11 PM
To: [log in to unmask]
Subject: Re: [FSL] fsl_tools

Thank you!