]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOTreeAttributeDescriptor.cpp
Changed drawing method for pop ups.
[creaImageIO.git] / src2 / creaImageIOTreeAttributeDescriptor.cpp
index 13616ce47fe574973d642066e3eb508a44e4129a..34647974489a1cb26156579808d0dd5435256f29 100644 (file)
@@ -69,7 +69,7 @@ namespace creaImageIO
       GDCM_NAME_SPACE::DictEntry* entry =
        GDCM_NAME_SPACE::Global::GetDicts()
        ->GetDefaultPubDict()->GetEntry(mGroup,mElement);
-
+         
       if (entry)
        {
          mName = entry->GetName();
@@ -104,7 +104,7 @@ namespace creaImageIO
          std::string g = key.substr(1,4);
          sscanf(key.c_str(),"D %04x _ %04x ",&group,&elem);  
          sscanf(g.c_str(),"%04x",&group);
-         GimmickMessage(5,"GetDicomGroupElementFromKey '"<<g<<"' : "
+         GimmickDebugMessage(3,"GetDicomGroupElementFromKey '"<<g<<"' : "
                         <<group<<"|"<<elem<<std::endl);
        }
       else 
@@ -114,7 +114,42 @@ namespace creaImageIO
        }
       return;
     }
+
     //=====================================================================
+       /// Decodes the type of the attribute
+     void AttributeDescriptor::DecodeType(unsigned int& typ) const
+         {
+                 
+               
+                 // Retrieve the name from gdcm dict
+               GDCM_NAME_SPACE::DictEntry* entry =
+               GDCM_NAME_SPACE::Global::GetDicts()
+               ->GetDefaultPubDict()->GetEntry(GetGroup(),GetElement());
+
+               std::string type = entry->GetVR().str();
+               GimmickDebugMessage(3,"VR Value is "<<type<<"!"<<std::endl);
+               if(type=="AS" ||
+               type=="DA" ||
+               type=="FL" ||
+               type=="FD" ||
+               type=="IS" ||
+               type=="SL" ||
+               type=="SS" ||
+               type=="UI" ||
+               type=="US" ||
+               type=="SH")
+               {
+                       type="1";
+                        sscanf(type.c_str(),"%u",&typ);
+               }
+               else
+               {
+                       type="2";
+                        sscanf(type.c_str(),"%u",&typ);
+               }
+               
+         }
+         //=====================================================================
 
   } // EO namespace tree