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