From: Marc Vila-Oliva Date: Thu, 4 Jul 2013 17:05:45 +0000 (+0200) Subject: added DosePerEnergy merger and modified filename for mergeStats X-Git-Tag: v1.4.0~169^2~7 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d5a5f36f2a8792c62451316a79a507ce83e02bdc;p=clitk.git added DosePerEnergy merger and modified filename for mergeStats --- diff --git a/cluster_tools/gate_power_merge.sh b/cluster_tools/gate_power_merge.sh index 55fc1f0..1a75244 100755 --- a/cluster_tools/gate_power_merge.sh +++ b/cluster_tools/gate_power_merge.sh @@ -134,7 +134,7 @@ ${rootMerger} ${arguments} > /dev/null || error "error while calling ${rootMerge echo " ${indent}merged ${count} files" } -statMerger="mergeStatFile.py" +statMerger="mergeStatFile.sh" test -x "./mergeStatFile.sh" && statMerger="./mergeStatFile.sh" function merge_stat { @@ -165,6 +165,37 @@ end_bar echo " ${indent}merged ${count} files" } +doseMerger="mergeDosePerEnegryFile.sh" +test -x "./mergeDosePerEnergyFile.sh" && doseMerger="./mergeDosePerEnergyFile.sh" + +function merge_dose { +local merged="$1" +shift +echo " ${indent}entering dose merger" +echo " ${indent}merger is ${doseMerger}" +echo " ${indent}creating ${merged}" +local count=0 +start_bar $# +while test $# -gt 0 +do + local partial="$1" + shift + let count++ + + if test ! -f "${merged}" + then + update_bar ${count} "copying first partial result ${partial}" + cp "${partial}" "${merged}" + continue + fi + + update_bar ${count} "adding ${partial}" + ${doseMerger} -i "${merged}" -j "${partial}" -o "${merged}" 2> /dev/null > /dev/null || warning "error while calling ${doseMerger}" +done +end_bar +echo " ${indent}merged ${count} files" +} + txtImageMerger="clitkMergeAsciiDoseActor" test -f "./clitkMergeAsciiDoseActor" && txtImageMerger="./clitkMergeAsciiDoseActor" @@ -336,6 +367,16 @@ function merge_dispatcher { return fi + if test "${firstpartialoutputextension}" == "txt" && grep -qs 'energydose' "${firstpartialoutputfile}" + then + echo "${indent}this is a dose file" + local mergedfile="${outputdir}/$(basename "${firstpartialoutputfile}")" + merge_dose "${mergedfile}" ${partialoutputfiles} || error "error while merging" + return + fi + + + if test "${firstpartialoutputextension}" == "txt" && grep -qs 'Resol' "${firstpartialoutputfile}" then local resol="$(sed -nr '/Resol/s/^.*=\s+\((.+)\)\s*$/\1/p' "${firstpartialoutputfile}")"