X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOTreeAttributeDescriptor.cpp;h=08fd784d9e26960199d35fc69585051121022305;hb=b029354f54449e058d14c671e7155e65b4086de6;hp=13616ce47fe574973d642066e3eb508a44e4129a;hpb=f08880c40f6304be640c7f8702bbbe96f8d50b40;p=creaImageIO.git diff --git a/src2/creaImageIOTreeAttributeDescriptor.cpp b/src2/creaImageIOTreeAttributeDescriptor.cpp index 13616ce..08fd784 100644 --- a/src2/creaImageIOTreeAttributeDescriptor.cpp +++ b/src2/creaImageIOTreeAttributeDescriptor.cpp @@ -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 '"<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 "<