X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOTreeAttributeDescriptor.cpp;h=c6a694f8cff678e267d621f9da6a8d7585e4c902;hb=66b7c66deb6102bd632daf96fe298b1d5764b7cc;hp=13616ce47fe574973d642066e3eb508a44e4129a;hpb=f08880c40f6304be640c7f8702bbbe96f8d50b40;p=creaImageIO.git diff --git a/src2/creaImageIOTreeAttributeDescriptor.cpp b/src2/creaImageIOTreeAttributeDescriptor.cpp index 13616ce..c6a694f 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 "<