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 ===========================================================================*/
20 #include "gtest/gtest.h"
21 #include <itksys/SystemTools.hxx>
22 TEST(clitkWriteDicomSeriesTest, main){
24 std::string fIn=std::string(CLITK_DATA_PATH)+"/3d/mhd/00.mhd";
25 std::string fOut=std::string(CLITK_DATA_PATH)+"/3d/dcm/1.2.840.113704.1.111.536.1248695032.26";
26 ASSERT_TRUE(itksys::SystemTools::FileExists(fIn.c_str(), true));
27 std::ostringstream cmd_line;
28 cmd_line << TOOLS_PATH <<"clitkWriteDicomSeries -i " << fIn << " -d " << fOut << " -o dcm --verbose";
29 EXPECT_TRUE(itksys::SystemTools::FileExists(fOut.c_str(), false));
30 EXPECT_TRUE(itksys::SystemTools::FileExists("dcm", false));
31 EXPECT_EQ(0, system(cmd_line.str().c_str()));
32 //does directory exists
33 itksys::SystemTools::RemoveADirectory("dcm");