]> Creatis software - clitk.git/blobdiff - scripts/create_midP_masks.sh
ITK v4 compatibility
[clitk.git] / scripts / create_midP_masks.sh
index bb153c88db3a99a458d4485e46b74fcb8e300dc6..845237d6a31dd3a4923fdc7acd4786b262b073c1 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
-}
+source `dirname $0`/midp_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
 
@@ -246,16 +241,13 @@ fi
 #
 # variables exported in this scope
 #
-# mask_dir: directory where all mask are kept
+# mask_dir: directory where all masks are kept
 # regmask_in_list: list of registration mask files (inside lungs)
 # regmask_out_list: list of registration mask files (outised lungs)
 # reg_in_list: list of registration image files (inside lungs)
 # 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