#include #include #if defined(USE_GDCM) #include #include #endif #if defined(USE_GDCM2) #include #include #include #endif #include namespace creaImageIO { namespace tree { //======================================================================== void AttributeDescriptor::CleanName(std::string& str) const { // quote must be doubled for SQL // crea::Utils::Replace( str, "'", "''" ); boost::algorithm::replace_all(str,"'","''"); // Found strange strings which contained NULL char INSIDE string int i,size=str.size(); for (i=0;iGetDefaultPubDict()->GetEntry(mGroup,mElement); if (entry) { mName = entry->GetName(); CleanName(mName); GimmickDebugMessage(3,"='"<GetDefaultPubDict()->GetEntry(GetGroup(),GetElement()); if( entry != 0) { if( entry->GetVR().str() == "DA" ) { btest = true; } } #endif #if defined(USE_GDCM2) const gdcm::Global& g = gdcm::Global::GetInstance(); const gdcm::Dicts &dicts = g.GetDicts(); const gdcm::Dict &dict = dicts.GetPublicDict(); if(mGroup != 0 && mElement != 0) { gdcm::DictEntry dictentry = dict.GetDictEntry(gdcm::Tag(GetGroup(), GetElement())); if( gdcm::VR::GetVRString(dictentry.GetVR()) == "DA") { btest = true; } } #endif return btest; } //===================================================================== /// test if the type is a time bool AttributeDescriptor::isTimeEntry() const { bool btest = false; #if defined(USE_GDCM) // 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; } } #endif #if defined(USE_GDCM2) const gdcm::Global& g = gdcm::Global::GetInstance(); // sum of all knowledge ! const gdcm::Dicts &dicts = g.GetDicts(); const gdcm::Dict &dict = dicts.GetPublicDict(); // Part 6 if(mGroup != 0 && mElement != 0) { gdcm::DictEntry dictentry = dict.GetDictEntry(gdcm::Tag(mGroup, mElement)); if(gdcm::VR::GetVRString(dictentry.GetVR()) == "TM") { btest = true; } } #endif return btest; } //===================================================================== /// Decodes the type of the attribute void AttributeDescriptor::DecodeType(unsigned int& typ) const { std::string type=""; #if defined(USE_GDCM) // 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; } type = entry->GetVR().str(); #endif #if defined(USE_GDCM2) const gdcm::Global& g = gdcm::Global::GetInstance(); // sum of all knowledge ! const gdcm::Dicts &dicts = g.GetDicts(); const gdcm::Dict &dict = dicts.GetPublicDict(); // Part 6 gdcm::DictEntry dictentry = dict.GetDictEntry(gdcm::Tag(mGroup, mElement)); type = gdcm::VR::GetVRString(dictentry.GetVR()); #endif GimmickDebugMessage(3,"VR Value is "<