GimmickDebugMessage(3,"AttributeDescriptor : '"<<key
<<"' ["<<flags<<"]"<<std::endl);
GimmickDebugMessage(3,"='"<<mName<<"'"<<std::endl);
+ DecodeType();
}
//=====================================================================
GDCM_NAME_SPACE::DictEntry* entry =
GDCM_NAME_SPACE::Global::GetDicts()
->GetDefaultPubDict()->GetEntry(mGroup,mElement);
-
+
if (entry)
{
mName = entry->GetName();
CleanName(mName);
+ DecodeType();
GimmickDebugMessage(3,"='"<<mName<<"'"<<std::endl);
}
else
<<"Considering it as a user attribute"
<< std::endl);
mName = "UNKNOWN";
- mGroup = mElement = 0;
+ mGroup = mElement = mType = 0;
+ DecodeType();
}
}
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 '"<<g<<"' : "
+ GimmickDebugMessage(3,"GetDicomGroupElementFromKey '"<<g<<"' : "
<<group<<"|"<<elem<<std::endl);
}
else
return;
}
//=====================================================================
+ ///Decodes the type of attribute into the valid groups
+ void AttributeDescriptor::DecodeType()
+ {
+ // Retrieve the name from gdcm dict
+ GDCM_NAME_SPACE::DictEntry* entry =
+ GDCM_NAME_SPACE::Global::GetDicts()
+ ->GetDefaultPubDict()->GetEntry(mGroup,mElement);
+
+ std::string type = entry->GetVR().str();
+ CleanName(type);
+ GimmickDebugMessage(3,"VR Value is "<<type<<"!"<<std::endl);
+ if(type=="AS" ||
+ type=="DA" ||
+ type=="FL" ||
+ type=="FD" ||
+ type=="IS" ||
+ type=="SL" ||
+ type=="SS" ||
+ type=="UI" ||
+ type=="US" ||
+ type=="SH")
+ {
+ mType=1;
+ }
+ else
+ {
+ mType=2;
+ }
+
+ }
} // EO namespace tree