X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=scripts%2Fcalculate_motion_amplitude.sh;h=b40c766997115c960a4ce7a21aab0f8c91b2cbd1;hb=cedd478160fa5337b497f3be8712f564dee61de1;hp=9fa0aa9f35877d72adc467694da0dc7820e84085;hpb=42e050104aebe7830f2111d096f0dd6673987d1e;p=clitk.git 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