]> Creatis software - clitk.git/blob - tools/clitkDicomInfo.cxx
migration gdcm 2.0 clitkDicom2Image
[clitk.git] / tools / clitkDicomInfo.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 /**
19    -------------------------------------------------
20    * @file   clitkDicomInfo.cxx
21    * @author Laurent ZAGNI <laurent.zagni@insa-lyon.fr>
22    * @date   27 Jul 2006
23    -------------------------------------------------*/
24
25 // clitk includes
26 #include "clitkDicomInfo_ggo.h"
27 #include "clitkCommon.h"
28
29 // itk (gdcm) include
30 #include "gdcmFile.h"
31 #if GDCM_MAJOR_VERSION == 2
32   #include "gdcmReader.h"
33   #include "gdcmPrinter.h"
34 #endif
35
36 //--------------------------------------------------------------------
37 int main(int argc, char * argv[])
38 {
39
40   // init command line
41   GGO(clitkDicomInfo, args_info);
42
43   // check arg
44   if (args_info.inputs_num == 0) return 0;
45
46   // Loop files
47   for(unsigned int i=0; i<args_info.inputs_num; i++) {
48 #if GDCM_MAJOR_VERSION == 2
49     gdcm::Reader reader;
50     reader.SetFileName(args_info.inputs[i]);
51     reader.Read();
52     gdcm::Printer printer;
53     printer.SetFile(reader.GetFile());
54     printer.SetStyle(gdcm::Printer::VERBOSE_STYLE);
55     printer.Print( std::cout );
56 #else
57     gdcm::File *header = new gdcm::File();
58     header->SetFileName(args_info.inputs[i]);
59     header->SetMaxSizeLoadEntry(163840);
60     header->Load();
61     header->Print();
62 #endif
63   }
64
65   // this is the end my friend
66   return 0;
67 }
68 //--------------------------------------------------------------------