From: mpech Date: Thu, 28 Jul 2011 16:04:01 +0000 (+0200) Subject: test --mode BG for binarizeImage X-Git-Tag: v1.3.0~247^2~1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3a4b1f60b7147226989f832c33ef76628a5319e5;p=clitk.git test --mode BG for binarizeImage --- diff --git a/tests/tools/CMakeLists.txt b/tests/tools/CMakeLists.txt index fa035f2..26a02ad 100644 --- a/tests/tools/CMakeLists.txt +++ b/tests/tools/CMakeLists.txt @@ -19,30 +19,32 @@ ADD_EXECUTABLE(toolTestRunner ${srcs}) TARGET_LINK_LIBRARIES(toolTestRunner vvLib ${vvExternalLibs}) SET(exe ${EXECUTABLE_OUTPUT_PATH}/toolTestRunner) SET(p ${CLITK_TEST_DATA_PATH}) +SET(tmpFile "feve51zd") #========================================================= # clitkImageInfo -ADD_TEST(clitkImageInfo_1 ${exe} clitkImageInfo ${p}Deformation4D.mhd ${p}Deformation4D_ref.info) -ADD_TEST(clitkImageInfo_2 ${exe} clitkImageInfo ${p}Lung3D.mhd ${p}Lung3D_ref.info) +ADD_TEST(clitkImageInfo_4d ${exe} clitkImageInfo ${p}Deformation4D.mhd ${p}Deformation4D_ref.info) +ADD_TEST(clitkImageInfo_3d ${exe} clitkImageInfo ${p}Lung3D.mhd ${p}Lung3D_ref.info) #========================================================= # clitkGetSpacing -ADD_TEST(clitkGetSpacing_1 ${exe} clitkGetSpacing -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.spacing) -ADD_TEST(clitkGetSpacing_2 ${exe} clitkGetSpacing -i ${p}Lung3D.mhd ${p}Lung3D_ref.spacing) +ADD_TEST(clitkGetSpacing_4d ${exe} clitkGetSpacing -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.spacing) +ADD_TEST(clitkGetSpacing_3d ${exe} clitkGetSpacing -i ${p}Lung3D.mhd ${p}Lung3D_ref.spacing) #========================================================= # clitkGetOrigin -ADD_TEST(clitkGetOrigin_1 ${exe} clitkGetOrigin -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.origin) -ADD_TEST(clitkGetOrigin_2 ${exe} clitkGetOrigin -i ${p}Lung3D.mhd ${p}Lung3D_ref.origin) +ADD_TEST(clitkGetOrigin_4d ${exe} clitkGetOrigin -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.origin) +ADD_TEST(clitkGetOrigin_3d ${exe} clitkGetOrigin -i ${p}Lung3D.mhd ${p}Lung3D_ref.origin) #========================================================= # clitkGetSize -ADD_TEST(clitkGetSize_1 ${exe} clitkGetSize -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.size) -ADD_TEST(clitkGetSize_2 ${exe} clitkGetSize -i ${p}Lung3D.mhd ${p}Lung3D_ref.size) +ADD_TEST(clitkGetSize_4d ${exe} clitkGetSize -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.size) +ADD_TEST(clitkGetSize_3d ${exe} clitkGetSize -i ${p}Lung3D.mhd ${p}Lung3D_ref.size) #========================================================= # clitkGetDirection -ADD_TEST(clitkGetDirection_1 ${exe} clitkGetDirection -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.direction) +ADD_TEST(clitkGetDirection_4d ${exe} clitkGetDirection -i ${p}Deformation4D.mhd ${p}Deformation4D_ref.direction) +ADD_TEST(clitkGetDirection_3d ${exe} clitkGetDirection -i ${p}Lung3D.mhd ${p}Lung3D_ref.direction) +#========================================================= +# clitkBinarize +ADD_TEST(clitkBinarizeBGl0.1356_4d ${exe} clitkBinarizeImage -i ${p}Deformation4D.mhd --mode BG -l 0.1356 -o ${tmpFile}.mhd ${p}Deformation4D_ref.binarizeBGl0.1356) ADD_TEST(clitkGetDirection_2 ${exe} clitkGetDirection -i ${p}Lung3D.mhd ${p}Lung3D_ref.direction) - - - - +UNSET(tmpFile) UNSET(exe) UNSET(p) \ No newline at end of file diff --git a/tests/tools/toolTestRunner.cxx b/tests/tools/toolTestRunner.cxx index 7237c68..42226b7 100644 --- a/tests/tools/toolTestRunner.cxx +++ b/tests/tools/toolTestRunner.cxx @@ -35,17 +35,15 @@ int getOutputOptionIndex(int argc, char** argv){ } std::string getTmpFileName(){ - - - #ifdef _WIN32 - char fileName[L_tmpnam_s]; - errno_t err = tmpnam_s(fileName); - #else - char fileName[] = "/tmp/vvTempXXXXXX"; - int err=0; - int fd = mkstemp(fileName); - if(fd==-1) err=1; - #endif +#ifdef _WIN32 + char fileName[L_tmpnam_s]; + errno_t err = tmpnam_s(fileName); +#else + char fileName[] = "/tmp/vvTempXXXXXX"; + int err=0; + int fd = mkstemp(fileName); + if(fd==-1) err=1; +#endif if(err){ std::cout<<"couldnot create file. Exiting"<"<"<