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
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 "<<type<<"!"<<std::endl);
if(type=="AS" ||
type=="US" ||
type=="SH")
{
- type="1";
- sscanf(type.c_str(),"%u",&typ);
+ // Numerical
+ typ = 1;
}
else
{
- type="2";
- sscanf(type.c_str(),"%u",&typ);
+ // String
+ typ = 2;
}
}