X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOTreeAttributeDescriptor.cpp;h=c6a694f8cff678e267d621f9da6a8d7585e4c902;hb=96ca5a0d7b7ccd6b4291160c19afd48e3207db2a;hp=34647974489a1cb26156579808d0dd5435256f29;hpb=384558d116ebb2ca264900f837c4a921d695515a;p=creaImageIO.git diff --git a/src2/creaImageIOTreeAttributeDescriptor.cpp b/src2/creaImageIOTreeAttributeDescriptor.cpp index 3464797..c6a694f 100644 --- a/src2/creaImageIOTreeAttributeDescriptor.cpp +++ b/src2/creaImageIOTreeAttributeDescriptor.cpp @@ -115,6 +115,43 @@ namespace creaImageIO return; } + //===================================================================== + /// test if the type is a date + bool AttributeDescriptor::isDateEntry() 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() == "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 @@ -126,6 +163,11 @@ namespace creaImageIO 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 "<