From e2f16c750e87742d77560833f6ac394f3d7aecfc Mon Sep 17 00:00:00 2001 From: Romulo Pinho Date: Mon, 17 Oct 2011 17:20:46 +0200 Subject: [PATCH] calculation of motion amplitude itself... - that is, (max - min) over time --- scripts/calculate_motion_amplitude.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/calculate_motion_amplitude.sh b/scripts/calculate_motion_amplitude.sh index 9fa0aa9..b40c766 100755 --- a/scripts/calculate_motion_amplitude.sh +++ b/scripts/calculate_motion_amplitude.sh @@ -43,10 +43,16 @@ clitkResampleImage -i ${roi_mask} -o ${roi_mask2} --like ${vector_file} dir=( sagittal coronal axial ) for i in 0 1 2; do echo Motion along ${dir[$i]} direction - clitkImageStatistics -i ${vector_file} -m ${roi_mask2} -c $i --verbose 2> /dev/null | tail -n 8 | head -n 6 + clitkImageStatistics -i ${vector_file} -m ${roi_mask2} -c $i --verbose 2> /dev/null | tail -n 8 | head -n 6 > /tmp/res.txt + min=`tail -n 2 /tmp/res.txt | head -n 1 | cut -f 2 -d ':'` + max=`tail -n 1 /tmp/res.txt | cut -f 2 -d ':'` + amp=`echo $max-$min | bc` + cat /tmp/res.txt + echo "Amplitude: $amp" echo done rm `basename $roi_mask .mhd`.{mhd,raw} rm `basename $roi_mask2 .mhd`.{mhd,raw} rm /tmp/err.txt +rm /tmp/res.txt -- 2.45.1