]> Creatis software - clitk.git/commitdiff
small changes in scripts
authorRomulo Pinho <pinho@lyon.fnclcc.fr>
Thu, 21 Jul 2011 09:18:15 +0000 (11:18 +0200)
committerRomulo Pinho <pinho@lyon.fnclcc.fr>
Thu, 21 Jul 2011 09:18:15 +0000 (11:18 +0200)
scripts/common.sh [new file with mode: 0755]
scripts/create_midP_masks.sh

diff --git a/scripts/common.sh b/scripts/common.sh
new file mode 100755 (executable)
index 0000000..e06bf25
--- /dev/null
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+
+MAX_THREADS=2
+
+check_threads()
+{
+    while [[ $(jobs -p | wc -l) -ge $1 ]]; do
+        jobs
+        sleep 10
+    done
+}
+
+
index bb153c88db3a99a458d4485e46b74fcb8e300dc6..9c851770f931e7a28d83d120611bafbae0ba7a1b 100755 (executable)
@@ -1,14 +1,6 @@
 #! /bin/bash -x
 
-MAX_THREADS=2
-
-check_threads()
-{
-    while [[ $(jobs -p | wc -l) -ge $1 ]]; do
-        jobs
-        sleep 10
-    done
-}
+. common.sh
 
 extract_patient()
 {
@@ -132,6 +124,9 @@ motion_mask()
   dir=`dirname $1`
   cd $dir
 
+  # import variables specific to each patient
+  source variables
+
   resample_spacing=$2
   resample_algo=$3
 
@@ -253,9 +248,6 @@ fi
 # reg_out_list: list of registration image files (outside lungs)
 #
 
-# import variables specific to each patient
-source variables
-
 if [ $1 != "using-as-lib" ]; then
   motion_mask $1 $2 $3
 fi