]> Creatis software - gdcm.git/blobdiff - Example/PrintFile.cxx
ENH: I am a moron. Fix compilation of gdcm in static mode, I had to add some new...
[gdcm.git] / Example / PrintFile.cxx
index 810712a490e634a21f211b7663062f0fa0dff0cf..0e780d213abf6fde248bdffcdc195cdfd94bbf1f 100644 (file)
@@ -1,22 +1,6 @@
 #include <iostream>
+#include "gdcm.h"
 
-#include "gdcmException.h"
-#include "gdcmCommon.h"
-
-#include "gdcmDictEntry.h"
-#include "gdcmDict.h"
-#include "gdcmDictSet.h"
-#include "gdcmHeader.h"
-#include "gdcmUtil.h"
-#include "gdcmBinEntry.h"  
-#include "gdcmDocEntry.h" 
-#include "gdcmDocEntrySet.h"           
-#include "gdcmDocument.h"          
-#include "gdcmElementSet.h"        
-#include "gdcmSeqEntry.h" 
-#include "gdcmSQItem.h" 
-#include "gdcmValEntry.h" 
-#include "gdcmFile.h" 
 int main(int argc, char* argv[])
 {
  
@@ -34,8 +18,7 @@ int main(int argc, char* argv[])
       fileName += "/test.acr";
    }
    
-   e1= new gdcmHeader 
-          (fileName.c_str(),false, true);
+   e1= new gdcmHeader( fileName.c_str() );
 
    f1 = new gdcmFile(e1);
 
@@ -69,6 +52,14 @@ int main(int argc, char* argv[])
    int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
    std::cout << " NumberOfScalarComponents " << numberOfScalarComponents <<std::endl;
 
+  
+  if ( e1->GetEntryByNumber(0x0002,0x0010) == GDCM_NOTLOADED ) {
+     std::cout << "Transfert Syntax not loaded. " << std::endl
+               << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
+               << std::endl;
+      return 0;
+  }
+  
    std::string transferSyntaxName = e1->GetTransfertSyntaxName();
    std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl;
    
@@ -80,7 +71,7 @@ int main(int argc, char* argv[])
   {
       std::cout << std::endl << "==========================================="
                   << std::endl; 
-         f1->ParsePixelData();  // gdcmFile Method :-(
+         f1->ParsePixelData();
       std::cout << std::endl << "==========================================="
                   << std::endl; 
    }