1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================*/
22 #include "gtest/gtest.h"
24 #include <itksys/SystemTools.hxx>
25 static inline void compare(std::string mhd, std::string refMhd, std::string refRaw){
26 std::ostringstream cmd_line;
27 ASSERT_TRUE(itksys::SystemTools::FileExists(mhd.c_str(), true));
28 ASSERT_TRUE(itksys::SystemTools::FileExists(refMhd.c_str(), true));
29 ASSERT_TRUE(itksys::SystemTools::FileExists(refRaw.c_str(), true));
30 cmd_line << TOOLS_PATH<<"clitkAffineTransform -i " << mhd << " -o "<<"out.mhd >/dev/null";
31 system(cmd_line.str().c_str());
32 EXPECT_TRUE(itksys::SystemTools::FileExists("out.mhd", true));
33 EXPECT_FALSE( itksys::SystemTools::FilesDiffer("out.mhd", refMhd.c_str()) );
34 EXPECT_FALSE( itksys::SystemTools::FilesDiffer("out.raw", refRaw.c_str()) );
38 TEST(clitkAffineTransformTest, main){
39 std::string mhd1=std::string(CLITK_DATA_PATH)+"Deformation4D.mhd";
40 std::string refMhd1=std::string(CLITK_DATA_PATH)+"Deformation4DRef.mhd";
41 std::string refRaw1=std::string(CLITK_DATA_PATH)+"Deformation4DRef.raw";
42 compare(mhd1, refMhd1, refRaw1);