From: bouilhol Date: Tue, 12 Apr 2011 11:52:57 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v1.2.0~51 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=5e6ee2503e6908ec0ffa9e2b39163ce3370930d4;p=clitk.git *** empty log message *** --- diff --git a/vv/scripts/create_mhd_4D.sh b/vv/scripts/create_mhd_4D.sh index e3b4c1b..662c5a3 100755 --- a/vv/scripts/create_mhd_4D.sh +++ b/vv/scripts/create_mhd_4D.sh @@ -28,7 +28,8 @@ then exit 1 fi -nb_phase_file=`find $1 -iname "*[0-99].[0-9].mhd" -o -iname "*[0-99]*\]*.mhd" | wc -l` +#nb_phase_file=`find $1 -iname "*[0-99].[0-9].mhd" -o -iname "*[0-99]*\]*.mhd" | wc -l` +nb_phase_file=`find $1 -iname "*[0-9].mhd" -o -iname "*[0-9]*\]*.mhd" | wc -l` if [ $nb_phase_file = 0 ] then echo "Error: no phase found" @@ -38,7 +39,8 @@ fi ########## CT ######### list_pattern="" -list_phase_file=`find $1 -iname "*[0-99].[0-9].mhd"` +#list_phase_file=`find $1 -iname "*[0-99].[0-9].mhd"` +list_phase_file=`find $1 -iname "*[0-9].mhd"` for phase_file in $list_phase_file do phase_file_name=`basename $phase_file` @@ -63,17 +65,21 @@ do pattern="" fi - nbph0=`find $1 -iname "${pattern}[0-9].[0-9].mhd" | wc -l` - orig0=`find $1 -iname "${pattern}[0-9].[0-9].mhd" | sort | head -n 1` - listph0=`find $1 -iname "${pattern}[0-9].[0-9].raw" | sort` + #nbph0=`find $1 -iname "${pattern}[0-9].[0-9].mhd" | wc -l` + #orig0=`find $1 -iname "${pattern}[0-9].[0-9].mhd" | sort | head -n 1` + #listph0=`find $1 -iname "${pattern}[0-9].[0-9].raw" | sort` - nbph1=`find $1 -iname "${pattern}[0-9][0-9].[0-9].mhd" | wc -l` - orig1=`find $1 -iname "${pattern}[0-9][0-9].[0-9].mhd" | sort | head -n 1` - listph1=`find $1 -iname "${pattern}[0-9][0-9].[0-9].raw" | sort` + #nbph1=`find $1 -iname "${pattern}[0-9][0-9].[0-9].mhd" | wc -l` + #orig1=`find $1 -iname "${pattern}[0-9][0-9].[0-9].mhd" | sort | head -n 1` + #listph1=`find $1 -iname "${pattern}[0-9][0-9].[0-9].raw" | sort` - nbph=$(( nbph0+nbph1 )) - orig=`echo -e "$orig0\n$orig1" | head -n 1` - listph="$listph0 $listph1" + #nbph=$(( nbph0+nbph1 )) + #orig=`echo -e "$orig0\n$orig1" | head -n 1` + #listph="$listph0 $listph1" + + nbph=`find $1 -iname "${pattern}*[0-9].mhd" | wc -l` + orig=`find $1 -iname "${pattern}*[0-9].mhd" | sort | head -n 1` + listph=`find $1 -iname "${pattern}*[0-9].raw" | sort` file_name_4D="${pattern}_4D.mhd" @@ -85,13 +91,16 @@ done ############ PET ########### list_pattern="" -list_phase_file=`find $1 -iname "*[0-99]*\]*.mhd"` +#list_phase_file=`find $1 -iname "*[0-99]*\]*.mhd"` +list_phase_file=`find $1 -iname "*[0-9]*\]*.mhd"` for phase_file in $list_phase_file do phase_file_name=`basename $phase_file` - if [[ ! -z `echo "$phase_file_name" | grep "[0-99]-.*\]"` ]] + #if [[ ! -z `echo "$phase_file_name" | grep "[0-99]-.*\]"` ]] + if [[ ! -z `echo "$phase_file_name" | grep "[0-9]-.*\]"` ]] then - prefix=`echo $phase_file_name | sed "s/.*[0-99]-/-/;s/\]_.*//"` + #prefix=`echo $phase_file_name | sed "s/.*[0-99]-/-/;s/\]_.*//"` + prefix=`echo $phase_file_name | sed "s/.*[0-9]-/-/;s/\]_.*//"` else prefix="NONE" fi @@ -110,11 +119,16 @@ do pattern="" fi - nbph=`find $1 -iname "*[0-99]${pattern}\]*.mhd" | wc -l` - orig=`find $1 -iname "*[0-99]${pattern}\]*.mhd" | sort | head -n 1` - listph=`find $1 -iname "*[0-99]${pattern}\]*.raw" | sort` + #nbph=`find $1 -iname "*[0-99]${pattern}\]*.mhd" | wc -l` + #orig=`find $1 -iname "*[0-99]${pattern}\]*.mhd" | sort | head -n 1` + #listph=`find $1 -iname "*[0-99]${pattern}\]*.raw" | sort` + + nbph=`find $1 -iname "*[0-9]${pattern}\]*.mhd" | wc -l` + orig=`find $1 -iname "*[0-9]${pattern}\]*.mhd" | sort | head -n 1` + listph=`find $1 -iname "*[0-9]${pattern}\]*.raw" | sort` - file_name_4D=`basename "$orig" | sed "s/[0-99]${pattern}\]/${pattern}\]/;s/_.mhd/_4D.mhd/"` + #file_name_4D=`basename "$orig" | sed "s/[0-99]${pattern}\]/${pattern}\]/;s/_.mhd/_4D.mhd/"` + file_name_4D=`basename "$orig" | sed "s/[0-9]${pattern}\]/${pattern}\]/;s/_.mhd/_4D.mhd/"` write_mhd_4D $1