]> Creatis software - clitk.git/blob - tests/tools/clitkWriteDicomSeriesTest.cxx
2e0c505c4bbfb00949d1e09b682bb12e842cd5d1
[clitk.git] / tests / tools / clitkWriteDicomSeriesTest.cxx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
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
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================*/
18 #include <iostream>
19 #include <sstream>
20 #include "gtest/gtest.h"
21 #include <itksys/SystemTools.hxx>
22 TEST(clitkWriteDicomSeriesTest, main){
23   
24   std::string fIn=std::string(CLITK_TEST_DATA_PATH)+"/3d/mhd/00.mhd";
25   std::string fOut=std::string(CLITK_TEST_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");
34 }