]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOWxDescriptorPanel.cpp
correctios to use gdcm2
[creaImageIO.git] / src2 / creaImageIOWxDescriptorPanel.cpp
index 3b0f78e55dd3dd4918f1bcfcbb14cbfe2239be9d..d50de1fecfaae7803d68b00bec5fd8540b633312 100644 (file)
@@ -4,8 +4,12 @@
 #include <gdcmGlobal.h>
 #include <gdcmDictSet.h>
 #endif
-#include <boost/algorithm/string.hpp>
 
+#if defined(USE_GDCM2)
+#include <gdcmGlobal.h>
+#include <gdcmDicts.h>
+#include <gdcmDict.h>
+#endif
 #include <boost/algorithm/string.hpp>
 
 namespace creaImageIO
@@ -700,9 +704,16 @@ namespace creaImageIO
    {
           std::ifstream i_file(i_name.c_str());
           std::stringstream buffer;
-               buffer << i_file.rdbuf();
-               std::string line;
-               std::string level;
+          buffer << i_file.rdbuf();
+          std::string line;
+          std::string level;
+
+#if defined(USE_GDCM2)
+          const gdcm::Global& g = gdcm::Global::GetInstance(); // sum of all knowledge !
+          const gdcm::Dicts &dicts = g.GetDicts();
+          const gdcm::Dict &dict = dicts.GetPublicDict(); // Part 6
+#endif
+         
 
                bool bname;
                int ilevel = -1;
@@ -768,6 +779,16 @@ namespace creaImageIO
                                        {
                                                onAddAttribute( entry->GetName(),compose, level);
                                        }
+#endif
+
+#if defined(USE_GDCM2)
+                                       gdcm::DictEntry dictentry =  dict.GetDictEntry(gdcm::Tag(group, element));
+                                       if(ilevel>0)
+                                       {
+                                               onAddAttribute( dictentry.GetName(),compose, level);
+                                       }
+       
+
 #endif
                                }
                                else if(descriptors[0].find("#") != -1)