]> Creatis software - clitk.git/commitdiff
Abort if no phase found
authorbouilhol <bouilhol>
Wed, 19 Jan 2011 20:47:09 +0000 (20:47 +0000)
committerbouilhol <bouilhol>
Wed, 19 Jan 2011 20:47:09 +0000 (20:47 +0000)
vv/scripts/create_mhd_4D.sh

index 6b27212af6ac4c066c4384aa8dc12c469afd8ccf..962541d85afa0117dc79330fcf85f64d88e33278 100755 (executable)
@@ -1,16 +1,22 @@
 #!/bin/sh
 
+
 #####################################################################
 # create_mhd_4D        argument : repertoire nom_fichier_de_sortie #
 #####################################################################
 if [ $# -lt 1 ]
 then
-    echo "Usage: create_mhd_4D directory output_file_name"
+    echo "Usage: create_mhd_4D.sh directory output_file_name"
     exit 1
 fi
 
 cd $1
-nbph=`ls -l *0.mhd | wc -l`
+nbph=`find -iname *0.mhd | wc -l`
+if [ $nbph = 0 ]
+then
+    echo "Error: no phase found"
+    exit 1
+fi
 orig=`ls -1 *0.mhd | head -n 1`
 
 cat $orig | sed "s/NDims = .*/NDims = 4/