X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src2%2FcreaImageIOTreeAttributeDescriptor.cpp;h=c6a694f8cff678e267d621f9da6a8d7585e4c902;hb=e4a54c9026a2a0c17e3be0b5915c34688a9385ad;hp=54c56b87e2308f22d5d77c15ea97bcd170a72a0c;hpb=41a140d8961e44ca197016805bd0f66035985ca3;p=creaImageIO.git diff --git a/src2/creaImageIOTreeAttributeDescriptor.cpp b/src2/creaImageIOTreeAttributeDescriptor.cpp index 54c56b8..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 @@ -146,15 +183,11 @@ namespace creaImageIO { // Numerical typ = 1; -// type="1"; -// sscanf(type.c_str(),"%u",&typ); } else { // String typ = 2; - // type="2"; -// sscanf(type.c_str(),"%u",&typ); } }