[pubgit-commits-list] Clitk branch master updated. v1.2.0-631-gcd054ae

root root at tux.creatis.insa-lyon.fr
Thu Jan 26 15:35:12 CET 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Clitk".

The branch, master has been updated
       via  cd054aec7943b5973dbf27ec20f62f38f0f11719 (commit)
      from  1f5410866499059022f8c35696f50c222d0f839e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.creatis.insa-lyon.fr/pubgit/?p=clitk.git;a=commitdiff;h=cd054aec7943b5973dbf27ec20f62f38f0f11719

commit cd054aec7943b5973dbf27ec20f62f38f0f11719
Author: Romulo Pinho <romulo.pinho at lyon.unicancer.fr>
Date:   Thu Jan 26 15:35:00 2012 +0100

    bug in mhd 4D creation

diff --git a/scripts/create_mhd_4D_pattern.sh b/scripts/create_mhd_4D_pattern.sh
index 2fa41d4..9f7896a 100755
--- a/scripts/create_mhd_4D_pattern.sh
+++ b/scripts/create_mhd_4D_pattern.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh 
 
 ###############################################################################
 #
@@ -21,12 +21,12 @@ write_mhd_4D()
 		  s/AnatomicalOrientation = .*/AnatomicalOrientation = ????/
 		  /ElementSpacing/ s/.*/& 1/
 		  /DimSize/ s/.*/& $nbph/
-		  s/ElementDataFile = .*/ElementDataFile = LIST/" > "$1/$file_name_4D"
+		  s/ElementDataFile = .*/ElementDataFile = LIST/" > "$dirname/$file_name_4D"
   
   for ph in $listph
   do
     phase=`basename $ph`
-    echo "$phase" >> "$1/$file_name_4D"
+    echo "$phase" >> "$dirname/$file_name_4D"
   done
 }
 
@@ -39,25 +39,32 @@ then
   exit 1
 fi
 
-prefix=$1
+dirname=`dirname $1`
+prefix=`basename $1`
 suffix=$2
 
-dirname=`dirname $1`
-pattern=`basename $1`
+nbph=0
+list_phase_file=`ls -1 $dirname/$prefix*[0-9]*$suffix.mhd`
+for ph in $list_phase_file
+do
+  if [ -e `echo $ph | sed 's/mhd/raw/'` ]
+  then
+    listph="$listph $ph"
+    nbph=$(( nbph + 1 ))
+  fi
+done
 
-list_phase_file=`ls -1 $prefix*[0-9]*$suffix.mhd`
-nb_phase_file=`ls -1 $prefix*[0-9]*$suffix.mhd | wc -l`
+nb_phase_file=`ls -1 $dirname/$prefix*[0-9]*$suffix.mhd | wc -l`
 if [ $nb_phase_file = 0 ]
 then
   echo "Error: no phase found"
   exit 1
 fi
 
-nbph=$nb_phase_file
 orig=`echo $list_phase_file | cut -f 1 -d ' '`
-listph=`echo $list_phase_file | sed 's:\.mhd:\.raw:g'`
+listph=`echo $listph | sed 's:\.mhd:\.raw:g'`
 
 file_name_4D=`echo "${prefix}4D${suffix}.mhd"`
 
-write_mhd_4D $dirname
+write_mhd_4D
 echo "$dirname/$file_name_4D"

-----------------------------------------------------------------------

Summary of changes:
 scripts/create_mhd_4D_pattern.sh |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Clitk


More information about the Pubgit-commits-list mailing list