comparison OrthancFramework/UnitTestsSources/DicomMapTests.cpp @ 4494:39192eb9b43d

New metadata automatically computed at the instance level: "PixelDataOffset"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Feb 2021 15:31:00 +0100
parents b57ca702a430
children dd6274412ff4
comparison
equal deleted inserted replaced
4493:b57ca702a430 4494:39192eb9b43d
874 874
875 typedef std::list< std::pair<std::string, uint64_t> > Sources; 875 typedef std::list< std::pair<std::string, uint64_t> > Sources;
876 876
877 Sources sources; 877 Sources sources;
878 sources.push_back(std::make_pair(PATH + "../ColorTestMalaterre.dcm", 0x03a0u)); 878 sources.push_back(std::make_pair(PATH + "../ColorTestMalaterre.dcm", 0x03a0u));
879 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.1.dcm", 0x037c)); 879 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.1.dcm", 0x037cu));
880 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.2.dcm", 0x03e8)); // Big Endian 880 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.2.dcm", 0x03e8u)); // Big Endian
881 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.50.dcm", 0x04ac)); 881 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.50.dcm", 0x04acu));
882 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.51.dcm", 0x072c)); 882 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.51.dcm", 0x072cu));
883 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.57.dcm", 0x0620)); 883 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.57.dcm", 0x0620u));
884 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.70.dcm", 0x065a)); 884 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.70.dcm", 0x065au));
885 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.80.dcm", 0x0b46)); 885 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.80.dcm", 0x0b46u));
886 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.81.dcm", 0x073e)); 886 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.81.dcm", 0x073eu));
887 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.90.dcm", 0x0b66)); 887 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.90.dcm", 0x0b66u));
888 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.91.dcm", 0x19b8)); 888 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.4.91.dcm", 0x19b8u));
889 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.5.dcm", 0x0b0a)); 889 sources.push_back(std::make_pair(PATH + "1.2.840.10008.1.2.5.dcm", 0x0b0au));
890 890
891 { 891 {
892 std::string dicom; 892 std::string dicom;
893 893
894 uint64_t offset; 894 uint64_t offset;
907 SystemToolbox::ReadFile(dicom, it->first, false); 907 SystemToolbox::ReadFile(dicom, it->first, false);
908 908
909 { 909 {
910 uint64_t offset; 910 uint64_t offset;
911 ASSERT_TRUE(DicomStreamReader::LookupPixelDataOffset(offset, dicom)); 911 ASSERT_TRUE(DicomStreamReader::LookupPixelDataOffset(offset, dicom));
912 ASSERT_EQ(it->second, offset);
913 }
914
915 {
916 uint64_t offset;
917 ASSERT_TRUE(DicomStreamReader::LookupPixelDataOffset(offset, dicom.c_str(), dicom.size()));
912 ASSERT_EQ(it->second, offset); 918 ASSERT_EQ(it->second, offset);
913 } 919 }
914 920
915 ParsedDicomFile a(dicom); 921 ParsedDicomFile a(dicom);
916 Json::Value aa; 922 Json::Value aa;