]> Creatis software - gdcm.git/blob - Example/PrintDocument.cxx
Stage 2 of names normalization :
[gdcm.git] / Example / PrintDocument.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: PrintDocument.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/01/21 11:40:52 $
7   Version:   $Revision: 1.10 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18 #include "gdcmFile.h"
19
20 #include <iostream>
21
22 int main(int argc, char* argv[])
23 {
24  
25    gdcm::File *e1;
26    std::string fileName;   
27
28    if (argc != 2) {
29       std::cout << " Usage : "
30                 << argv[0] 
31                 << " filename."
32                 << std::endl;
33    }
34
35    if (argc > 1) {
36       fileName=argv[1];
37    } else {
38       fileName += GDCM_DATA_ROOT;
39       fileName += "/test.acr";
40    }
41    
42    e1= new gdcm::File( fileName.c_str() );
43
44    e1->SetPrintLevel(2);
45    
46    e1->Print();
47       
48    std::cout << "\n\n" << std::endl;        
49    
50    if(e1->IsReadable())
51       std::cout <<std::endl<<fileName<<" is Readable"<<std::endl;
52    else
53       std::cout <<std::endl<<fileName<<" is NOT Readable"<<std::endl;
54    std::cout<<std::flush;
55    delete e1;
56
57    return 0;
58    
59 }