]> Creatis software - clitk.git/commitdiff
Make clitkDicomWave2Text compile with itk4
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Tue, 11 Oct 2011 09:44:37 +0000 (11:44 +0200)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Tue, 11 Oct 2011 09:44:37 +0000 (11:44 +0200)
- Protect the code with GDCM_MAJOR_VERSION < 2 and print an error
  message when compiled with 2.x GDCM version.

tools/clitkDicomWave2Text.cxx
tools/clitkDicomWave2Text.h

index 2ceef2d68d0a68c1e9aceb8c0f0255adb46a5722..7fc7c6bb48db5730f4fce4964326161baa336f02 100644 (file)
@@ -1,13 +1,18 @@
 #include "clitkDicomWave2Text.h"
 #include "clitkDicomWave2Text_ggo.h"
 
+#include "clitkCommon.h"
 //gdcm include
-#include "gdcmUtil.h"
 #include "gdcmFile.h"
-#include "gdcmBinEntry.h"
-#include "gdcmValEntry.h"
-#include "gdcmSeqEntry.h"
-#include "gdcmSQItem.h"
+
+#if GDCM_MAJOR_VERSION < 2
+  #include "gdcmUtil.h"
+  #include "gdcmBinEntry.h"
+  #include "gdcmValEntry.h"
+  #include "gdcmSeqEntry.h"
+  #include "gdcmSQItem.h"
+#endif
+
 #include "gdcmSerieHelper.h"
 
 #include <iostream>
@@ -22,6 +27,7 @@ int main(int argc, char * argv[]) {
 GGO(clitkDicomWave2Text, args_info);
 //-----------------------------------------------------------------------------
 
+#if GDCM_MAJOR_VERSION < 2
 //-----------------------------------------------------------------------
 // opening dicom input file
 gdcm::File * mDCMFile = new gdcm::File();
@@ -100,5 +106,8 @@ if(text_file)
 }
 else
     std::cerr << "Error openning "<< args_info.OutputFile_arg << std::endl;
-       
+#else
+    std::cerr << argv[0] << " is not compatible with GDCM 2.x you should use GDCM 1.x" << std::endl;
+    return 1;
+#endif
 }
index fa492679bdebda6b18532334efdabb5a96fd5592..cf71505dcbc970075ab336cbb8570e52e2b6fc9f 100644 (file)
@@ -1,16 +1,6 @@
 #ifndef CLITKDICOMWAVE2TEXT_H
 #define CLITKDICOMWAVE2TEXT_H
 
-#include "clitkCommon.h"
-//gdcm include
-#include "gdcmUtil.h"
-#include "gdcmFile.h"
-#include "gdcmValEntry.h"
-#include "gdcmSeqEntry.h"
-#include "gdcmSQItem.h"
-#include "gdcmSerieHelper.h"
-
-
 namespace clitk {
 
   //---------------------------------------------------------------------
@@ -24,7 +14,7 @@ namespace clitk {
       ~DicomWave2Text();
 
   };
-  
+
 } // end namespace
 
 #endif