]> Creatis software - gdcm.git/blob - Testing/TestPrintAllDocument.cxx
Name normalization
[gdcm.git] / Testing / TestPrintAllDocument.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: TestPrintAllDocument.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/02/02 10:41:10 $
7   Version:   $Revision: 1.1 $
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
19 // TODO : check what's *actually* usefull
20
21 #include "gdcmDictEntry.h"
22 #include "gdcmDict.h"
23 #include "gdcmDictSet.h"
24 #include "gdcmFile.h"
25 #include "gdcmUtil.h"
26 #include "gdcmCommon.h"
27 #include "gdcmBinEntry.h"  
28 #include "gdcmDocEntry.h" 
29 #include "gdcmDocEntrySet.h"           
30 #include "gdcmDocument.h"          
31 #include "gdcmElementSet.h"        
32 #include "gdcmSeqEntry.h" 
33 #include "gdcmSQItem.h" 
34 #include "gdcmValEntry.h" 
35
36 #include <iostream>
37
38 //Generated file:
39 #include "gdcmDataImages.h"
40
41 int TestPrintAllDocument(int, char *[])
42 {
43    int i = 0;
44
45    while( gdcmDataImages[i] != 0 )
46    {
47       std::string filename = GDCM_DATA_ROOT;
48       filename += "/";  //doh!
49       filename += gdcmDataImages[i];
50
51       gdcm::File *e1= new gdcm::File( filename );
52       e1->SetPrintLevel(2);
53       e1->Print();
54
55       // just to be able to grep the display result, for some usefull info     
56       std::cout << filename
57                 << " TransferSyntaxName= [" << e1->GetTransferSyntaxName() 
58                 << "] SwapCode = "          << e1->GetSwapCode() 
59                 << " PhotometricInterpretation=" 
60                                             << e1->GetEntryValue(0x0028,0x0004)
61                 << " pixelType="            << e1->GetPixelType() 
62                 << " SamplesPerPixel="      << e1->GetSamplesPerPixel()
63                 << " PlanarConfiguration="  << e1->GetPlanarConfiguration();
64       if ( e1->CheckIfEntryExist(0x0088,0x0200) )
65            std::cout << " Icon Image Sequence";
66
67        std::cout << std::endl;
68    
69       if( e1->IsReadable() )
70       {
71          std::cout <<filename << " is Readable" 
72                    << std::endl << std::endl;
73       }
74       else
75       {
76          std::cout << filename << " is NOT Readable" 
77                    << std::endl << std::endl;
78          delete e1;
79          return 1;
80       }
81
82       delete e1;
83       i++;
84    }
85    return 0;
86 }