]> Creatis software - clitk.git/commitdiff
Merge branch 'master' of /home/dsarrut/clitk3.server
authorDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Mon, 26 Sep 2011 07:00:23 +0000 (09:00 +0200)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Mon, 26 Sep 2011 07:00:23 +0000 (09:00 +0200)
CMakeLists.txt
tests/tools/CMakeLists.txt
tests/tools/toolTestRunner.cxx

index 48f125772db517ac6d22b08b3a8ba6169fcf6f14..a8b6c0f6a837dbf1a4c13b10905c0f9b164398a2 100644 (file)
@@ -122,6 +122,10 @@ SET(SCRIPTS
   scripts/create_midP_masks.sh  
   scripts/create_midP_masks-2.0.sh  
   scripts/pts_to_landmarks.sh
+  scripts/create_mhd_3D.sh
+  scripts/create_sequence.sh
+  scripts/dcm_sort_by_field.sh
+  scripts/dicom_info.sh
 )
 
 INSTALL (FILES ${SCRIPTS} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
index 9ceb93c30a23be861c6d366b791ee5f26456ef43..5e1165b1900180ad44c1e481758cdfdcf2fe1ae8 100644 (file)
@@ -43,6 +43,49 @@ ADD_TEST(clitkGetDirection_3d ${exe} clitkGetDirection -i ${p}Lung3D.mhd     ${p}Lu
 # clitkBinarize
 ADD_TEST(clitkBinarizeBGl0.1356_4d ${exe} clitkBinarizeImage -i ${p}Deformation4D.mhd --mode BG -l 0.1356 -o Deformation4D_ref.binarizeBGl0.1356.mhd ${p}Deformation4D_ref.binarizeBGl0.1356)
 ADD_TEST(clitkBinarizeFGl0.1556_3d ${exe} clitkBinarizeImage -i ${p}Lung3D.mhd        --mode FG -l 0.1556 -o Lung3D_ref.binarizeFGl0.1556.mhd ${p}Lung3D_ref.binarizeFGl0.1556)
+#=========================================================
+# clitkImageArithm
+ADD_TEST(clitkImageArithm0_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 0 -o Lung3D_ref.arithm0.mhd ${p}Lung3D_ref.arithm0.mhd)
+ADD_TEST(clitkImageArithm1_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 1 -o Lung3D_ref.arithm1.mhd ${p}Lung3D_ref.arithm1.mhd)
+ADD_TEST(clitkImageArithm2_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 2 -o Lung3D_ref.arithm2.mhd ${p}Lung3D_ref.arithm2.mhd)
+ADD_TEST(clitkImageArithm3_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 3 -o Lung3D_ref.arithm3.mhd ${p}Lung3D_ref.arithm3.mhd)
+ADD_TEST(clitkImageArithm4_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 4 -o Lung3D_ref.arithm4.mhd ${p}Lung3D_ref.arithm4.mhd)
+ADD_TEST(clitkImageArithm5_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 5 -o Lung3D_ref.arithm5.mhd ${p}Lung3D_ref.arithm5.mhd)
+ADD_TEST(clitkImageArithm6_3d ${exe} clitkImageArithm -i ${p}Lung3D.mhd -j ${p}Lung3D.mhd -t 6 -o Lung3D_ref.arithm6.mhd ${p}Lung3D_ref.arithm6.mhd)
+
+ADD_TEST(clitkImageArithm0_4d ${exe} clitkImageArithm -i ${p}Deformation4D.mhd -j ${p}Deformation4D.mhd -t 0 -o Deformation4D_ref.arithm0.mhd ${p}Deformation4D_ref.arithm0.mhd)
+ADD_TEST(clitkImageArithm2_4d ${exe} clitkImageArithm -i ${p}Deformation4D.mhd -j ${p}Deformation4D.mhd -t 2 -o Deformation4D_ref.arithm2.mhd ${p}Deformation4D_ref.arithm2.mhd)
+#=========================================================
+# clitkCropImage
+ADD_TEST(clitkCropImage_3d ${exe} clitkCropImage -i ${p}Lung3D.mhd -b 1,4,0,2,2,3 -o Lung3D_ref.cropImage.1.4.0.2.2.3.mhd ${p}Lung3D_ref.cropImage.1.4.0.2.2.3.mhd)
+#=========================================================
+#clitkMorphoMath
+ADD_TEST(clitkMorphoMath0_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t0.mhd ${p}Lung3D_ref.morphoMath.t0.mhd)
+ADD_TEST(clitkMorphoMath1_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t1.mhd ${p}Lung3D_ref.morphoMath.t1.mhd)
+ADD_TEST(clitkMorphoMath2_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t2.mhd ${p}Lung3D_ref.morphoMath.t2.mhd)
+ADD_TEST(clitkMorphoMath3_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t3.mhd ${p}Lung3D_ref.morphoMath.t3.mhd)
+ADD_TEST(clitkMorphoMath4_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t4.mhd ${p}Lung3D_ref.morphoMath.t4.mhd)
+ADD_TEST(clitkMorphoMath5_3d ${exe} clitkMorphoMath -i ${p}Lung3D.mhd -o Lung3D_ref.morphoMath.t5.mhd ${p}Lung3D_ref.morphoMath.t5.mhd)
+
+ADD_TEST(clitkMorphoMath0_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t0.mhd ${p}Deformation4D_ref.morphoMath.t0.mhd)
+ADD_TEST(clitkMorphoMath1_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t1.mhd ${p}Deformation4D_ref.morphoMath.t1.mhd)
+ADD_TEST(clitkMorphoMath2_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t2.mhd ${p}Deformation4D_ref.morphoMath.t2.mhd)
+ADD_TEST(clitkMorphoMath3_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t3.mhd ${p}Deformation4D_ref.morphoMath.t3.mhd)
+ADD_TEST(clitkMorphoMath4_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t4.mhd ${p}Deformation4D_ref.morphoMath.t4.mhd)
+ADD_TEST(clitkMorphoMath5_4d ${exe} clitkMorphoMath -i ${p}Deformation4D.mhd -o Deformation4D_ref.morphoMath.t5.mhd ${p}Deformation4D_ref.morphoMath.t5.mhd)
+
+
+#=========================================================
+
+
+
+
+
+
+
+
+
+
 
 UNSET(exe)
 UNSET(p)
index 8a49c43e1cedb0561fe41068877fa7b7d23ecd6f..a4795ee8781fc1e6d4e73fb4b71bf55024a1019e 100644 (file)
@@ -78,6 +78,11 @@ void dosToUnixFile(std::string dosFile, std::string unixedFile){
        
 }
 #endif
+
+std::string mhdToRawName(const std::string &mhdName){
+       int found = mhdName.find_last_of(".");
+  return mhdName.substr(0, found)+".raw";
+}
 /**
  * argv
  * [1] executable
@@ -90,7 +95,8 @@ void dosToUnixFile(std::string dosFile, std::string unixedFile){
 int main(int argc, char** argv){
   //reference file must exist or we fail
   char* refFile = argv[argc-1];
-  assertFalse(!(itksys::SystemTools::FileExists(refFile, true)), "refFile "+std::string(refFile)+" doesn't exist");
+       std::string strRefFile = std::string(refFile);
+  assertFalse(!(itksys::SystemTools::FileExists(refFile, true)), "refFile "+strRefFile+" doesn't exist");
   
   std::ostringstream cmd_line;
   cmd_line<<CLITK_TEST_TOOLS_PATH;
@@ -124,13 +130,9 @@ int main(int argc, char** argv){
   assertFalse((itksys::SystemTools::FilesDiffer(outFile.c_str(), refFile)), "Generated mhd file != ref File");
 #endif
   
-       
-       //eventually raw files associated
-  //should be passed as a boolean to check also for raw or not
-  std::string refRawFile = std::string(refFile)+".raw";
-   
-  int found=outFile.find_last_of(".");
-  std::string rawFile = outFile.substr(0, found)+".raw";
+  std::string refRawFile = mhdToRawName(strRefFile);
+  std::string rawFile = mhdToRawName(outFile);
+  
   if((itksys::SystemTools::FileExists(refRawFile.c_str(), true))){
     //compare the raw stuff
     if((itksys::SystemTools::FileExists(rawFile.c_str(), true))){