]> Creatis software - gdcm.git/blob - Example/FlatHashTablePrint.cxx
bc9e599f9c5bd7021c728b4be7db29784c87838c
[gdcm.git] / Example / FlatHashTablePrint.cxx
1 #include "gdcmHeader.h"
2
3 // Iterate on all the Dicom entries encountered in the gdcmFile (given
4 // as line argument) and print them. This is an illustration of the
5 // usage of \ref gdcmDocument::BuildFlatHashTable().
6
7 int main(int argc, char* argv[])
8 {
9    if (argc < 2)
10    {
11       std::cerr << "Usage :" << std::endl << 
12       argv[0] << " input_dicom " << std::endl;
13       return 1;
14    }
15
16    gdcmHeader* header = new gdcmHeader( argv[1] );
17    TagDocEntryHT* Ht = header->BuildFlatHashTable();
18    
19    for (TagDocEntryHT::iterator tag = Ht->begin(); tag != Ht->end(); ++tag)
20    {
21       tag->second->Print(); 
22       std::cout << std::endl;
23    }
24
25    return 0;
26 }
27
28
29