本文整理汇总了C++中DicomMap::GetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ DicomMap::GetValue方法的具体用法?C++ DicomMap::GetValue怎么用?C++ DicomMap::GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DicomMap
的用法示例。
在下文中一共展示了DicomMap::GetValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mm
TEST(DicomMap, Tags)
{
DicomMap m;
ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_NAME));
ASSERT_FALSE(m.HasTag(0x0010, 0x0010));
m.SetValue(0x0010, 0x0010, "PatientName");
ASSERT_TRUE(m.HasTag(DICOM_TAG_PATIENT_NAME));
ASSERT_TRUE(m.HasTag(0x0010, 0x0010));
ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_ID));
m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID");
ASSERT_TRUE(m.HasTag(0x0010, 0x0020));
m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID2");
ASSERT_EQ("PatientID2", m.GetValue(0x0010, 0x0020).AsString());
m.Remove(DICOM_TAG_PATIENT_ID);
ASSERT_THROW(m.GetValue(0x0010, 0x0020), OrthancException);
std::auto_ptr<DicomMap> mm(m.Clone());
ASSERT_EQ("PatientName", mm->GetValue(DICOM_TAG_PATIENT_NAME).AsString());
m.SetValue(DICOM_TAG_PATIENT_ID, "Hello");
ASSERT_THROW(mm->GetValue(DICOM_TAG_PATIENT_ID), OrthancException);
mm->CopyTagIfExists(m, DICOM_TAG_PATIENT_ID);
ASSERT_EQ("Hello", mm->GetValue(DICOM_TAG_PATIENT_ID).AsString());
DicomNullValue v;
ASSERT_TRUE(v.IsNull());
}
示例2: ValueAsString
static std::string ValueAsString(const DicomMap& summary,
const DicomTag& tag)
{
const DicomValue& value = summary.GetValue(tag);
if (value.IsNull())
{
return "(null)";
}
else
{
return value.GetContent();
}
}
示例3: ExtractTagFromMainDicomTags
static void ExtractTagFromMainDicomTags(std::set<std::string>& target,
ServerIndex& index,
const DicomTag& tag,
const std::list<std::string>& resources,
ResourceType level)
{
for (std::list<std::string>::const_iterator
it = resources.begin(); it != resources.end(); ++it)
{
DicomMap tags;
if (index.GetMainDicomTags(tags, *it, level, level) &&
tags.HasTag(tag))
{
target.insert(tags.GetValue(tag).GetContent());
}
}
}
示例4: FilterMainDicomTags
bool DicomFindQuery::FilterMainDicomTags(const std::string& resourceId,
ResourceType level,
const DicomMap& mainTags) const
{
std::set<DicomTag> tags;
mainTags.GetTags(tags);
for (std::set<DicomTag>::const_iterator
it = tags.begin(); it != tags.end(); ++it)
{
Constraints::const_iterator constraint = constraints_.find(*it);
if (constraint != constraints_.end() &&
!constraint->second->Apply(mainTags.GetValue(*it).AsString()))
{
return false;
}
}
return true;
}
示例5: LogMissingRequiredTag
void LogMissingRequiredTag(const DicomMap& summary)
{
std::string s, t;
if (summary.HasTag(DICOM_TAG_PATIENT_ID))
{
if (t.size() > 0)
t += ", ";
t += "PatientID=" + summary.GetValue(DICOM_TAG_PATIENT_ID).AsString();
}
else
{
if (s.size() > 0)
s += ", ";
s += "PatientID";
}
if (summary.HasTag(DICOM_TAG_STUDY_INSTANCE_UID))
{
if (t.size() > 0)
t += ", ";
t += "StudyInstanceUID=" + summary.GetValue(DICOM_TAG_STUDY_INSTANCE_UID).AsString();
}
else
{
if (s.size() > 0)
s += ", ";
s += "StudyInstanceUID";
}
if (summary.HasTag(DICOM_TAG_SERIES_INSTANCE_UID))
{
if (t.size() > 0)
t += ", ";
t += "SeriesInstanceUID=" + summary.GetValue(DICOM_TAG_SERIES_INSTANCE_UID).AsString();
}
else
{
if (s.size() > 0)
s += ", ";
s += "SeriesInstanceUID";
}
if (summary.HasTag(DICOM_TAG_SOP_INSTANCE_UID))
{
if (t.size() > 0)
t += ", ";
t += "SOPInstanceUID=" + summary.GetValue(DICOM_TAG_SOP_INSTANCE_UID).AsString();
}
else
{
if (s.size() > 0)
s += ", ";
s += "SOPInstanceUID";
}
if (t.size() == 0)
{
LOG(ERROR) << "Store has failed because all the required tags (" << s << ") are missing (is it a DICOMDIR file?)";
}
else
{
LOG(ERROR) << "Store has failed because required tags (" << s << ") are missing for the following instance: " << t;
}
}