comparison UnitTestsSources/FromDcmtkTests.cpp @ 2007:655489d9165d

DicomMap::ParseDicomMetaInformation()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 Jun 2016 15:46:33 +0200
parents 6301bbcbcaed
children 8e67325eaa3f
comparison
equal deleted inserted replaced
2006:6301bbcbcaed 2007:655489d9165d
299 } 299 }
300 300
301 301
302 TEST(FromDcmtkBridge, ValueRepresentation) 302 TEST(FromDcmtkBridge, ValueRepresentation)
303 { 303 {
304 ASSERT_EQ(ValueRepresentation_PatientName, 304 ASSERT_EQ(ValueRepresentation_PersonName,
305 FromDcmtkBridge::LookupValueRepresentation(DICOM_TAG_PATIENT_NAME)); 305 FromDcmtkBridge::LookupValueRepresentation(DICOM_TAG_PATIENT_NAME));
306 ASSERT_EQ(ValueRepresentation_Date, 306 ASSERT_EQ(ValueRepresentation_Date,
307 FromDcmtkBridge::LookupValueRepresentation(DicomTag(0x0008, 0x0020) /* StudyDate */)); 307 FromDcmtkBridge::LookupValueRepresentation(DicomTag(0x0008, 0x0020) /* StudyDate */));
308 ASSERT_EQ(ValueRepresentation_Time, 308 ASSERT_EQ(ValueRepresentation_Time,
309 FromDcmtkBridge::LookupValueRepresentation(DicomTag(0x0008, 0x0030) /* StudyTime */)); 309 FromDcmtkBridge::LookupValueRepresentation(DicomTag(0x0008, 0x0030) /* StudyTime */));
574 } 574 }
575 575
576 576
577 TEST(ParsedDicomFile, ToJsonFlags1) 577 TEST(ParsedDicomFile, ToJsonFlags1)
578 { 578 {
579 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7053, 0x1000), ValueRepresentation_PatientName, "MyPrivateTag", 1, 1); 579 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7053, 0x1000), ValueRepresentation_PersonName, "MyPrivateTag", 1, 1);
580 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7050, 0x1000), ValueRepresentation_PatientName, "Declared public tag", 1, 1); 580 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7050, 0x1000), ValueRepresentation_PersonName, "Declared public tag", 1, 1);
581 581
582 ParsedDicomFile f(true); 582 ParsedDicomFile f(true);
583 f.Insert(DicomTag(0x7050, 0x1000), "Some public tag", false); // Even group => public tag 583 f.Insert(DicomTag(0x7050, 0x1000), "Some public tag", false); // Even group => public tag
584 f.Insert(DicomTag(0x7052, 0x1000), "Some unknown tag", false); // Even group => public, unknown tag 584 f.Insert(DicomTag(0x7052, 0x1000), "Some unknown tag", false); // Even group => public, unknown tag
585 f.Insert(DicomTag(0x7053, 0x1000), "Some private tag", false); // Odd group => private tag 585 f.Insert(DicomTag(0x7053, 0x1000), "Some private tag", false); // Odd group => private tag
689 { 689 {
690 DicomFindAnswers a; 690 DicomFindAnswers a;
691 691
692 { 692 {
693 DicomMap m; 693 DicomMap m;
694 m.SetValue(DICOM_TAG_PATIENT_ID, "hello"); 694 m.SetValue(DICOM_TAG_PATIENT_ID, "hello", false);
695 a.Add(m); 695 a.Add(m);
696 } 696 }
697 697
698 { 698 {
699 ParsedDicomFile d(true); 699 ParsedDicomFile d(true);
701 a.Add(d); 701 a.Add(d);
702 } 702 }
703 703
704 { 704 {
705 DicomMap m; 705 DicomMap m;
706 m.SetValue(DICOM_TAG_PATIENT_ID, "world"); 706 m.SetValue(DICOM_TAG_PATIENT_ID, "world", false);
707 a.Add(m); 707 a.Add(m);
708 } 708 }
709 709
710 Json::Value j; 710 Json::Value j;
711 a.ToJson(j, true); 711 a.ToJson(j, true);
717 717
718 TEST(ParsedDicomFile, FromJson) 718 TEST(ParsedDicomFile, FromJson)
719 { 719 {
720 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7057, 0x1000), ValueRepresentation_OtherByte, "MyPrivateTag", 1, 1); 720 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7057, 0x1000), ValueRepresentation_OtherByte, "MyPrivateTag", 1, 1);
721 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7059, 0x1000), ValueRepresentation_OtherByte, "MyPrivateTag", 1, 1); 721 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7059, 0x1000), ValueRepresentation_OtherByte, "MyPrivateTag", 1, 1);
722 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7050, 0x1000), ValueRepresentation_PatientName, "Declared public tag", 1, 1); 722 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7050, 0x1000), ValueRepresentation_PersonName, "Declared public tag", 1, 1);
723 723
724 Json::Value v; 724 Json::Value v;
725 const std::string sopClassUid = "1.2.840.10008.5.1.4.1.1.1"; // CR Image Storage: 725 const std::string sopClassUid = "1.2.840.10008.5.1.4.1.1.1"; // CR Image Storage:
726 726
727 { 727 {