]> Creatis software - clitk.git/commitdiff
create_mhd_4D
authorRomulo Pinho <pinho@lyon.fnclcc.fr>
Mon, 18 Jul 2011 15:00:21 +0000 (17:00 +0200)
committerRomulo Pinho <pinho@lyon.fnclcc.fr>
Mon, 18 Jul 2011 15:00:21 +0000 (17:00 +0200)
- avoid recusrive directory searches
+ find -maxdepth 1 ...

itk/clitkConditionalBinaryDilateImageFilter.txx
scripts/create_mhd_4D.sh

index 2059f9d96368eef66e0df5bc93f38b625854ba9d..f3c66d33a326ee9949cb4cf64a6f68e7dfe5cfc2 100644 (file)
@@ -277,9 +277,9 @@ namespace clitk
                    IndexType idx = tmpRegIndexIt.GetIndex() + *itIdx;
                    if( outputRegion.IsInside( idx ) )
                      { 
-                       // JV output->SetPixel( idx, static_cast<OutputPixelType> ( foregroundValue ) ); }
-                       if (input->GetPixel(idx)==backgroundValue)
-                         output->SetPixel( idx, static_cast<OutputPixelType> ( foregroundValue ) ); 
+            // JV output->SetPixel( idx, static_cast<OutputPixelType> ( foregroundValue ) ); }
+            if (input->GetPixel(idx)==backgroundValue)
+                output->SetPixel( idx, static_cast<OutputPixelType> ( foregroundValue ) ); 
                      }
                  }
  
index 00df85ce77720452d5ab9174393face3c81f410f..bc51da445d06389ab8a1347495d680b566d4c892 100755 (executable)
@@ -28,7 +28,7 @@ then
   exit 1
 fi
 
-nb_phase_file=`find $1 -iname "*[0-9]*.mhd" -o -iname "*[0-9]*\]*.mhd" | wc -l`
+nb_phase_file=`find $1 -maxdepth 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 +38,7 @@ fi
 ########## CT #########
 
 list_pattern=""
-list_phase_file=`find $1 -iname "*[0-9]*.mhd"`
+list_phase_file=`find $1 -maxdepth 1 -iname "*[0-9]*.mhd"`
 for phase_file in $list_phase_file
 do
   phase_file_name=`basename $phase_file`
@@ -63,9 +63,9 @@ do
     pattern=""
   fi
 
-  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`
+  nbph=`find $1 -maxdepth 1 -iname "${pattern}*[0-9]*.mhd" | wc -l`
+  orig=`find $1 -maxdepth 1 -iname "${pattern}*[0-9]*.mhd" | sort | head -n 1`
+  listph=`find $1 -maxdepth 1 -iname "${pattern}*[0-9]*.raw" | sort`
 
   file_name_4D="${pattern}_4D.mhd"
   echo $file_name_4D
@@ -78,7 +78,7 @@ done
 ############ PET ###########
 
 list_pattern=""
-list_phase_file=`find $1 -iname "*[0-9]*\]*.mhd"`
+list_phase_file=`find $1 -maxdepth 1 -iname "*[0-9]*\]*.mhd"`
 for phase_file in $list_phase_file
 do
   phase_file_name=`basename $phase_file`
@@ -103,9 +103,9 @@ do
     pattern=""
   fi
 
-  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`
+  nbph=`find $1 -maxdepth 1 -iname "*[0-9]${pattern}\]*.mhd" | wc -l`
+  orig=`find $1 -maxdepth 1 -iname "*[0-9]${pattern}\]*.mhd" | sort | head -n 1`
+  listph=`find $1 -maxdepth 1 -iname "*[0-9]${pattern}\]*.raw" | sort`
   
   file_name_4D=`basename "$orig" | sed "s/[0-9]${pattern}\]/${pattern}\]/;s/_.mhd/_4D.mhd/"`