From: mpech Date: Tue, 20 Sep 2011 15:28:53 +0000 (+0200) Subject: comparing raw files automatically. refFile can end with .mhd or not X-Git-Tag: v1.3.0~233^2~4 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e0ebf1a64a59619732afac9476efd97fc9a2dcb6;p=clitk.git comparing raw files automatically. refFile can end with .mhd or not --- diff --git a/tests/tools/CMakeLists.txt b/tests/tools/CMakeLists.txt index b431375..a38a883 100644 --- a/tests/tools/CMakeLists.txt +++ b/tests/tools/CMakeLists.txt @@ -45,18 +45,21 @@ ADD_TEST(clitkBinarizeBGl0.1356_4d ${exe} clitkBinarizeImage -i ${p}Deformation4 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 +#check raws are also checked 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 0 -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 0 -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 0 -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 0 -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 0 -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 0 -o Lung3D_ref.arithm6.mhd ${p}Lung3D_ref.arithm6.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 0 -o Deformation4D_ref.arithm2.mhd ${p}Deformation4D_ref.arithm2.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} crlitkCropImage -i ${p}Lung3D.mhd -b 0 -o Lung3D_ref.arithm0.mhd ${p}Lung3D_ref.arithm0.mhd) UNSET(exe) diff --git a/tests/tools/toolTestRunner.cxx b/tests/tools/toolTestRunner.cxx index 8a49c43..a4795ee 100644 --- a/tests/tools/toolTestRunner.cxx +++ b/tests/tools/toolTestRunner.cxx @@ -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<