]> Creatis software - clitk.git/blobdiff - tools/clitkDicomInfo.cxx
Remove tmp files
[clitk.git] / tools / clitkDicomInfo.cxx
index ef62cfa51bcc12ac3b85a8ce083037f3e57c866a..fe2d869d8bbf2e756068ae0b488c30dc45641583 100644 (file)
@@ -1,18 +1,20 @@
-/*-------------------------------------------------------------------------
-                                                                                
-Program:   clitk
-Language:  C++
-                                                                                
-Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
-l'Image). All rights reserved. See Doc/License.txt or
-http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
-                                                                                
-This software is distributed WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.  See the above copyright notices for more information.
-                                                                             
--------------------------------------------------------------------------*/
+/*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
 
+  Authors belong to:
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
+
+  This software is distributed WITHOUT ANY WARRANTY; without even
+  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE.  See the copyright notices for more information.
+
+  It is distributed under dual licence
+
+  - BSD        See included LICENSE.txt file
+  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
 /**
    -------------------------------------------------
    * @file   clitkDicomInfo.cxx
@@ -26,9 +28,14 @@ PURPOSE.  See the above copyright notices for more information.
 
 // itk (gdcm) include
 #include "gdcmFile.h"
+#if GDCM_MAJOR_VERSION == 2
+  #include "gdcmReader.h"
+  #include "gdcmPrinter.h"
+#endif
 
 //--------------------------------------------------------------------
-int main(int argc, char * argv[]) {
+int main(int argc, char * argv[])
+{
 
   // init command line
   GGO(clitkDicomInfo, args_info);
@@ -38,14 +45,24 @@ int main(int argc, char * argv[]) {
 
   // Loop files
   for(unsigned int i=0; i<args_info.inputs_num; i++) {
+#if GDCM_MAJOR_VERSION == 2
+    gdcm::Reader reader;
+    reader.SetFileName(args_info.inputs[i]);
+    reader.Read();
+    gdcm::Printer printer;
+    printer.SetFile(reader.GetFile());
+    printer.SetStyle(gdcm::Printer::VERBOSE_STYLE);
+    printer.Print( std::cout );
+#else
     gdcm::File *header = new gdcm::File();
     header->SetFileName(args_info.inputs[i]);
-    header->SetMaxSizeLoadEntry(16384);
+    header->SetMaxSizeLoadEntry(163840);
     header->Load();
     header->Print();
+#endif
   }
 
-  // this is the end my friend  
+  // this is the end my friend
   return 0;
 }
 //--------------------------------------------------------------------