comparison UnitTestsSources/FromDcmtkTests.cpp @ 2115:a657f7772e69

Handling of private tags/creators in the "Dictionary" configuration option
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 31 Oct 2016 15:23:32 +0100
parents 88831c3edd8f
children 87b395a77c41
comparison
equal deleted inserted replaced
2114:e4f8e377782f 2115:a657f7772e69
55 55
56 using namespace Orthanc; 56 using namespace Orthanc;
57 57
58 TEST(DicomFormat, Tag) 58 TEST(DicomFormat, Tag)
59 { 59 {
60 ASSERT_EQ("PatientName", FromDcmtkBridge::GetName(DicomTag(0x0010, 0x0010))); 60 ASSERT_EQ("PatientName", FromDcmtkBridge::GetTagName(DicomTag(0x0010, 0x0010), ""));
61 61
62 DicomTag t = FromDcmtkBridge::ParseTag("SeriesDescription"); 62 DicomTag t = FromDcmtkBridge::ParseTag("SeriesDescription");
63 ASSERT_EQ(0x0008, t.GetGroup()); 63 ASSERT_EQ(0x0008, t.GetGroup());
64 ASSERT_EQ(0x103E, t.GetElement()); 64 ASSERT_EQ(0x103E, t.GetElement());
65 65
574 } 574 }
575 575
576 576
577 TEST(ParsedDicomFile, ToJsonFlags1) 577 TEST(ParsedDicomFile, ToJsonFlags1)
578 { 578 {
579 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7053, 0x1000), ValueRepresentation_PersonName, "MyPrivateTag", 1, 1); 579 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7053, 0x1000), ValueRepresentation_PersonName, "MyPrivateTag", 1, 1, "");
580 FromDcmtkBridge::RegisterDictionaryTag(DicomTag(0x7050, 0x1000), ValueRepresentation_PersonName, "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
715 } 715 }
716 716
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_PersonName, "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 {