From b52dd3c5ebaddf789b044a6baca5aec8c724988f Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Tue, 11 Oct 2011 11:44:37 +0200 Subject: [PATCH] Make clitkDicomWave2Text compile with itk4 - Protect the code with GDCM_MAJOR_VERSION < 2 and print an error message when compiled with 2.x GDCM version. --- tools/clitkDicomWave2Text.cxx | 21 +++++++++++++++------ tools/clitkDicomWave2Text.h | 12 +----------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/tools/clitkDicomWave2Text.cxx b/tools/clitkDicomWave2Text.cxx index 2ceef2d..7fc7c6b 100644 --- a/tools/clitkDicomWave2Text.cxx +++ b/tools/clitkDicomWave2Text.cxx @@ -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 @@ -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 } diff --git a/tools/clitkDicomWave2Text.h b/tools/clitkDicomWave2Text.h index fa49267..cf71505 100644 --- a/tools/clitkDicomWave2Text.h +++ b/tools/clitkDicomWave2Text.h @@ -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 -- 2.47.1