comparison UnitTestsSources/DicomMapTests.cpp @ 3551:173c7f363d8f

DicomMap::RemoveBinaryTags
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 26 Oct 2019 15:59:59 +0200
parents 4beabcea3a5c
children 4de1b019ca71
comparison
equal deleted inserted replaced
3550:0f5f9a5eed25 3551:173c7f363d8f
561 ASSERT_EQ("B", b.GetValue(DICOM_TAG_STUDY_DESCRIPTION).GetContent()); 561 ASSERT_EQ("B", b.GetValue(DICOM_TAG_STUDY_DESCRIPTION).GetContent());
562 ASSERT_EQ("C", b.GetValue(DICOM_TAG_SERIES_DESCRIPTION).GetContent()); 562 ASSERT_EQ("C", b.GetValue(DICOM_TAG_SERIES_DESCRIPTION).GetContent());
563 ASSERT_EQ("D", b.GetValue(DICOM_TAG_NUMBER_OF_FRAMES).GetContent()); 563 ASSERT_EQ("D", b.GetValue(DICOM_TAG_NUMBER_OF_FRAMES).GetContent());
564 ASSERT_EQ("F", b.GetValue(DICOM_TAG_SLICE_THICKNESS).GetContent()); 564 ASSERT_EQ("F", b.GetValue(DICOM_TAG_SLICE_THICKNESS).GetContent());
565 ASSERT_FALSE(b.HasOnlyMainDicomTags()); 565 ASSERT_FALSE(b.HasOnlyMainDicomTags());
566 }
567
568
569 TEST(DicomMap, RemoveBinary)
570 {
571 DicomMap b;
572 b.SetValue(DICOM_TAG_PATIENT_NAME, "A", false);
573 b.SetValue(DICOM_TAG_PATIENT_ID, "B", true);
574 b.SetValue(DICOM_TAG_STUDY_INSTANCE_UID, DicomValue()); // NULL
575 b.SetValue(DICOM_TAG_SERIES_INSTANCE_UID, DicomValue("C", false));
576 b.SetValue(DICOM_TAG_SOP_INSTANCE_UID, DicomValue("D", true));
577
578 b.RemoveBinaryTags();
579
580 std::string s;
581 ASSERT_EQ(2u, b.GetSize());
582 ASSERT_TRUE(b.LookupStringValue(s, DICOM_TAG_PATIENT_NAME, false)); ASSERT_EQ("A", s);
583 ASSERT_TRUE(b.LookupStringValue(s, DICOM_TAG_SERIES_INSTANCE_UID, false)); ASSERT_EQ("C", s);
566 } 584 }
567 585
568 586
569 587
570 TEST(DicomWebJson, Multiplicity) 588 TEST(DicomWebJson, Multiplicity)