]> Creatis software - gdcm.git/blob - Example/PrintDocument.cxx
ENH: Adding 'gdcm' namespace. Be nice with me this was a ~13000 lines patch. Also...
[gdcm.git] / Example / PrintDocument.cxx
1 #include <iostream>
2 #include "gdcm.h"
3
4 int main(int argc, char* argv[])
5 {
6  
7    gdcm::Header *e1;
8    std::string fileName;   
9
10    if (argc != 2) {
11       std::cout << " Usage : "
12                 << argv[0] 
13                 << " filename."
14                 << std::endl;
15    }
16
17    if (argc > 1) {
18       fileName=argv[1];
19    } else {
20       fileName += GDCM_DATA_ROOT;
21       fileName += "/test.acr";
22    }
23    
24    e1= new gdcm::Header( fileName.c_str() );
25
26    e1->SetPrintLevel(2);
27    
28    e1->Print();
29       
30    std::cout << "\n\n" << std::endl;        
31    
32    if(e1->IsReadable())
33       std::cout <<std::endl<<fileName<<" is Readable"<<std::endl;
34    else
35       std::cout <<std::endl<<fileName<<" is NOT Readable"<<std::endl;
36    std::cout<<std::flush;
37    delete e1;
38
39    return 0;
40    
41 }