Hi
Use shell scripting, e.g.
---------
#!/bin/sh
mymean=`fslstats $1 -M`;
mystd=`fslstats $1 -S
fslmaths $i -sub $mymean -div $mystd $2
---------
make this executable (e.g. as 'normalise.sh' with chmod 777 and then
call this with
normalise input output
hth
Christian
On 19 Jul 2009, at 18:10, Moran Artzi wrote:
> Hi,
>
> 1. I'm trying to interface fslmaths and fslstats options. However I
> don’t know
> how to call to the calculated values. Let say I have SPGR image
> which I want
> to subtract from the mean value and then divide by image std. I should
> choose:
>>> fslstats SPGR.nii –M
> XX
>>> fslstats SPGR.nii –S
> YY
>>> fslmaths SPGR.nii -sub XX SPGR_Sub.nii
>>> SPGR_Sub.nii.gz -div YY SPGR_Sub_div.nii.gz
>
> Now I want this to run automatically on N subjects for this I need
> to call the
> calculates results (XX,YY)
> Is their any way to do so?
>
> 2. Regarding the fslstats histogram option
>>> fslstats <input> -H <nbins> <min> <max>
> How can I get normalized histogram (in percentages/ln)?
> In addition, how can I output the results (to a text/matlab file) ?
>
> Many thanks
> Moran
_______________________________________________
Christian F. Beckmann, DPhil
Senior Lecturer, Clinical Neuroscience Department
Division of Neuroscience and Mental Health
Imperial College London, Hammersmith Campus
Rm 419, Burlington Danes Bldg, Du Cane Road, London W12 0NN, UK
Tel.: +44 (0)20 7594 6685 --- Fax: +44 (0)20 7594 6548
Email: [log in to unmask]
http://www.imperial.ac.uk/medicine/people/c.beckmann/
Senior Research Fellow, FMRIB Centre
University of Oxford
JR Hospital - Oxford OX3 9DU
Tel.: +44 (0)1865 222551 --- Fax: +44 (0)1865 222717
Email: [log in to unmask]
http://www.fmrib.ox.ac.uk/~beckmann
|