From: tbaudier Date: Wed, 14 Nov 2018 12:28:25 +0000 (+0100) Subject: Merge dose by region uncertainties using Gate uncertainty calculation X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=clitk.git;a=commitdiff_plain;h=d27b2f45396b69a0d3e61a2179b3d0c784ff9652 Merge dose by region uncertainties using Gate uncertainty calculation Instead of using partial uncertainty, I use the total dose or edep and the square of the dose and edep like I removed a bash function because it's useless --- diff --git a/cluster_tools/gate_power_merge.sh b/cluster_tools/gate_power_merge.sh index bc3b3e0..b2ced88 100755 --- a/cluster_tools/gate_power_merge.sh +++ b/cluster_tools/gate_power_merge.sh @@ -217,14 +217,13 @@ function merge_doseByRegions { if test ! -f "${merged}" then update_bar ${count} "copying first partial result ${partial}" - addWithoutPartialResult -i "${partial}" -o "${merged}" + cp "${partial}" "${merged}" continue fi update_bar ${count} "adding ${partial}" addToPartialResult -i "${merged}" -j "${partial}" -o "${merged}" 2> /dev/null > /dev/null || warning "error while calling ${doseMerger}" done - divideUncertaintyResult -i "${merged}" -j "${count}" -o "${merged}" end_bar echo " ${indent}merged ${count} files" } diff --git a/cluster_tools/mergeDoseByRegions.sh b/cluster_tools/mergeDoseByRegions.sh index 0548db6..598df69 100755 --- a/cluster_tools/mergeDoseByRegions.sh +++ b/cluster_tools/mergeDoseByRegions.sh @@ -44,18 +44,6 @@ function addToPartialResult { edep3=${edep3/#./0.} file3=$(echo $file3 |awk -v r=${edep3} '{$3=r}1') - # sqrt sum square std_edep*edep: get the 2 values, sum the square, take the sqrt and replace it in the file3 - stdEdep1=$(echo ${file1} | cut -f4 -d' ') - stdEdep2=$(echo ${file2} | cut -f4 -d' ') - stdEdep3=$(python <> ${TMP} - # for all lines (except the 1st), split according tab - # sum the some elements (dose, edep) ... - for i in $(seq 2 $nblines); do - #Get the lines - file1=`sed -n "${i}p" < ${IN1}` - - # copy id - id1=$(echo ${file1} | cut -f1 -d' ') - id1=${id1/#./0.} - file3=$(echo $id1) - - # copy volume - vol1=$(echo ${file1} | cut -f2 -d' ') - vol1=${vol1/#./0.} - file3=$(echo "$file3 $vol1") - - # copy edep - edep1=$(echo ${file1} | cut -f3 -d' ') - edep1=${edep1/#./0.} - file3=$(echo "$file3 $edep1") - - # sqrt sum square std_edep*edep - stdEdep1=$(echo ${file1} | cut -f4 -d' ') - stdEdep3=$(python <> ${TMP} - done - mv -f ${TMP} ${RESULT} -} - - function divideUncertaintyResult { IN1=$2 value=$4 @@ -202,7 +90,7 @@ function divideUncertaintyResult { TMP="$(mktemp)" - # check if all 3 text files have the same number of lines + # check if all 2 text files have the same number of lines nblines=`cat ${IN1} | wc -l` nb3=`cat ${RESULT} | wc -l` @@ -223,13 +111,10 @@ function divideUncertaintyResult { # Divide uncertainty and replace it in the file3 edep1=$(echo ${file1} | cut -f3 -d' ') - stdEdep1=$(echo ${file1} | cut -f4 -d' ') + sqEdep1=$(echo ${file1} | cut -f5 -d' ') stdEdep3=$(python <