Hi,
if you need both values, but as separate variables I would recommend to
run fslstats only once. This might be quiet a bit faster.
minmax=`fslstats yourfile -R`
min=`echo "$minmax" | cut -d ' ' -f 1`
max=`echo "$minmax" | cut -d ' ' -f 2`
another option would be to declare minmax as array:
declare -a minmax=(`fslstats yourfile -R`)
so if you need the minimum value you:
${minmax[0]}
and for the maximum:
${minmax[1]}
Even though it seems sometimes easier to run several calls of a function
to cut out the required values it might slow down your script
dramatically. So I would allways ttry to reduce repetitive (and
redundant) function calls.
good luck anyway,
wolf
On 10/11/2009 08:38 PM, Rolf Heckemann wrote:
> Hi Moran
>
> fslstats file -R | cut -d ' ' -f 1
>
> gives you the minimum voxel value and
>
> fslstats file -R | cut -d ' ' -f 2
>
> the maximum.
>
> HTH
>
> Rolf
>
>
> On Sun, Oct 11, 2009 at 03:47:58PM +0100, Moran Artzi wrote:
>
>> Hi,
>> Using fslstats -R option results min intensity + max intensity outputs
>> Is there any option to get each one separately (in order to run its on script)
>>
>> Thanks
>> Moran
>>
>
|