X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src2%2FcreaImageIOTreeAttributeDescriptor.cpp;h=c6a694f8cff678e267d621f9da6a8d7585e4c902;hb=76f7c62a930e60f9a569ede29b9546a179875d2c;hp=5a3e5b47f6559dd09c95709b3a611c89ce320a40;hpb=f4bdead5143dc3d816f1c2f2bd9786a21c843760;p=creaImageIO.git diff --git a/src2/creaImageIOTreeAttributeDescriptor.cpp b/src2/creaImageIOTreeAttributeDescriptor.cpp index 5a3e5b4..c6a694f 100644 --- a/src2/creaImageIOTreeAttributeDescriptor.cpp +++ b/src2/creaImageIOTreeAttributeDescriptor.cpp @@ -60,18 +60,16 @@ namespace creaImageIO //GDCM_NAME_SPACE::TagKey tag(group,element); char ctag[12]; sprintf(ctag,"D%04x_%04x",group,element); - std::string tag(ctag); + mKey = ctag; - GimmickDebugMessage(3,"AttributeDescriptor : '"<GetDefaultPubDict()->GetEntry(mGroup,mElement); - + if (entry) { mName = entry->GetName(); @@ -80,7 +78,7 @@ namespace creaImageIO } else { - GimmickMessage(1,"!! WARNING : tag '"<GetDefaultPubDict()->GetEntry(GetGroup(),GetElement()); + if( entry != 0) + { + if( entry->GetVR().str() == "DA" ) + { + btest = true; + } + } + return btest; + } + + //===================================================================== + /// test if the type is a time + bool AttributeDescriptor::isTimeEntry() const + { + + bool btest = false; + // Retrieve the name from gdcm dict + GDCM_NAME_SPACE::DictEntry* entry = GDCM_NAME_SPACE::Global::GetDicts()->GetDefaultPubDict()->GetEntry(GetGroup(),GetElement()); + if( entry != 0) + { + if( entry->GetVR().str() == "TM" ) + { + btest = true; + } + } + return btest; + } + + //===================================================================== + /// 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()); + + if (entry==0) + { + typ = 2; + return; + } + std::string type = entry->GetVR().str(); + GimmickDebugMessage(3,"VR Value is "<