Print

Print


Hi Moran -

To do things like this it gets a bit more complex - you probably want to write a small bash script, using the 'bc' calculator.  Something like:

#!/bin/sh
M=`fslstats image -M`
S=`fslstats image -S`
uthr=`echo $M+2*$S | bc -l`
lthr=`echo $M-2*$S | bc -l`
fslmaths image -thr $lthr -uthr $uthr out

It would be worth having a look at the scripting lecture on the FSL 2009 course web page to learn how this works and to make the script more flexible.

Eugene

2009/11/25 Moran Artzi <[log in to unmask]>

Hi Andrew,
Regarding to this issue - one more question
I need to calc the following option:
Calculate image mean + standard deviation value (fslatats -M and -S option) and then threshold the original image with Mean value +/- 2 std
(falmath Orig_Imge  -thr <-2*S-M values>  -uthr <2*S-M values> Threshold_Image)

Any suggestions?
Thanks
Moran




 

On Mon, Nov 23, 2009 at 8:18 PM, Andrew Jahn <[log in to unmask]> wrote:
Try using the backwards quotes (the upper left of the keyboard) to capture the output and use it in the command.  For example,

fslmaths image1 -sub `fslstats image2 -M` outputImage

Is this what you wanted to do?

-Andrew

2009/11/23 Moran Artzi <[log in to unmask]>

Hi
I'm trying to read fslstats results from the command line and to use in as a
values for fslmath.
For example:
Calculate image mean value (fslatats -M option) and then subtract from each
voxel of the original image (falmath -sub <value> OrigImge)

Any suggestions how its can be done?
Many thanks
Moran






--
Eugene Duff

Centre for Functional MRI of the Brain (FMRIB)
University of Oxford
John Radcliffe Hospital, Headington OX3 9DU  Oxford  UK

Ph: +44 (0) 1865 222 523  Fax: +44 (0) 1865 222 717

--