]> Creatis software - creaImageIO.git/blob - tests/TestDcmDescriptor.cpp
54c14e3fb8f21963d6813ff4eb88687a6c2d4e53
[creaImageIO.git] / tests / TestDcmDescriptor.cpp
1 /**
2 * \file TestDcmDescriptor.cxx
3 * \brief Test the Descriptor reading.
4 */
5 #include <stdlib.h>
6 #include <iostream>
7
8 #include <creaImageIOTreeDescriptor.h>
9 using namespace creaImageIO;
10 using namespace creaImageIO::tree;
11 /**
12 * TestDcmDescriptor
13 * \brief Read a descriptor file and check its content.
14 * \param argc Argument count (unused).
15 * \param argv Argument list (unused).
16 * \return The test result.
17 */
18 int TestDcmDescriptor( int argc, char* argv[] )
19 {
20     std::cout << "TestDcmDescriptor..." << std::endl;
21     
22
23     // read a descriptor file
24     creaImageIO::tree::Descriptor dscp;
25     const std::string path = GIMMICK_TEST_DATA_DIR;
26     const std::string filepath = path + "/localdatabase_Descriptor.dscp";
27      std::cout << path << std::endl;
28     dscp.createDescriptorfromFile(filepath);
29
30     // get Attribute map
31         creaImageIO::tree::AttributeMapType tags;
32         dscp.BuildAttributeMap(tags);
33     
34     // check its content
35     std::cout << "tags size: " << tags.size() << std::endl;
36     creaImageIO::tree::AttributeMapType::iterator it;
37     for ( it=tags.begin() ; it != tags.end(); it++ )
38     {
39         std::cout << (*it).first << " => " <<  "empty" << std::endl;
40     }
41
42     
43     // default test result
44     return EXIT_FAILURE;
45 }