本文整理汇总了C++中DicomMap::GetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ DicomMap::GetSize方法的具体用法?C++ DicomMap::GetSize怎么用?C++ DicomMap::GetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DicomMap
的用法示例。
在下文中一共展示了DicomMap::GetSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddAnswer
static void AddAnswer(DicomFindAnswers& answers,
const Json::Value& resource,
const DicomArray& query)
{
DicomMap result;
for (size_t i = 0; i < query.GetSize(); i++)
{
// Fix issue 30 (QR response missing "Query/Retrieve Level" (008,0052))
if (query.GetElement(i).GetTag() == DICOM_TAG_QUERY_RETRIEVE_LEVEL)
{
result.SetValue(query.GetElement(i).GetTag(), query.GetElement(i).GetValue());
}
else if (query.GetElement(i).GetTag() == DICOM_TAG_SPECIFIC_CHARACTER_SET)
{
}
else
{
std::string tag = query.GetElement(i).GetTag().Format();
std::string value;
if (resource.isMember(tag))
{
value = resource.get(tag, Json::arrayValue).get("Value", "").asString();
result.SetValue(query.GetElement(i).GetTag(), value);
}
else
{
result.SetValue(query.GetElement(i).GetTag(), "");
}
}
}
if (result.GetSize() == 0)
{
LOG(WARNING) << "The C-FIND request does not return any DICOM tag";
}
else
{
answers.Add(result);
}
}
示例2: AddAnswer
static void AddAnswer(DicomFindAnswers& answers,
const Json::Value& resource,
const DicomArray& query,
const std::list<DicomTag>& sequencesToReturn,
const DicomMap* counters)
{
DicomMap result;
for (size_t i = 0; i < query.GetSize(); i++)
{
if (query.GetElement(i).GetTag() == DICOM_TAG_QUERY_RETRIEVE_LEVEL)
{
// Fix issue 30 on Google Code (QR response missing "Query/Retrieve Level" (008,0052))
result.SetValue(query.GetElement(i).GetTag(), query.GetElement(i).GetValue());
}
else if (query.GetElement(i).GetTag() == DICOM_TAG_SPECIFIC_CHARACTER_SET)
{
// Do not include the encoding, this is handled by class ParsedDicomFile
}
else
{
std::string tag = query.GetElement(i).GetTag().Format();
std::string value;
if (resource.isMember(tag))
{
value = resource.get(tag, Json::arrayValue).get("Value", "").asString();
result.SetValue(query.GetElement(i).GetTag(), value, false);
}
else
{
result.SetValue(query.GetElement(i).GetTag(), "", false);
}
}
}
if (counters != NULL)
{
DicomArray tmp(*counters);
for (size_t i = 0; i < tmp.GetSize(); i++)
{
result.SetValue(tmp.GetElement(i).GetTag(), tmp.GetElement(i).GetValue().GetContent(), false);
}
}
if (result.GetSize() == 0 &&
sequencesToReturn.empty())
{
LOG(WARNING) << "The C-FIND request does not return any DICOM tag";
}
else if (sequencesToReturn.empty())
{
answers.Add(result);
}
else
{
ParsedDicomFile dicom(result);
for (std::list<DicomTag>::const_iterator tag = sequencesToReturn.begin();
tag != sequencesToReturn.end(); ++tag)
{
const Json::Value& source = resource[tag->Format()];
if (source.type() == Json::objectValue &&
source.isMember("Type") &&
source.isMember("Value") &&
source["Type"].asString() == "Sequence" &&
source["Value"].type() == Json::arrayValue)
{
Json::Value content = Json::arrayValue;
for (Json::Value::ArrayIndex i = 0; i < source["Value"].size(); i++)
{
Json::Value item;
Toolbox::SimplifyTags(item, source["Value"][i], DicomToJsonFormat_Short);
content.append(item);
}
dicom.Replace(*tag, content, false, DicomReplaceMode_InsertIfAbsent);
}
}
answers.Add(dicom);
}
}