]> Creatis software - gdcm.git/blob - Example/FlatHashTablePrint.cxx
ENH: Adding 'gdcm' namespace. Be nice with me this was a ~13000 lines patch. Also...
[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    gdcm::Header* header = new gdcm::Header( argv[1] );
17    gdcm::TagDocEntryHT* Ht = header->BuildFlatHashTable();
18    
19    for (gdcm::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 }