comparison OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp @ 5319:f2e1ad71e49c

added "OrthancPluginLoadDicomInstance()" to load DICOM instances from the database
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 24 Jun 2023 12:18:58 +0200
parents 68e15471b408
children a904a4caf5b7
comparison
equal deleted inserted replaced
5318:68e15471b408 5319:f2e1ad71e49c
3262 ASSERT_EQ("OW", visitor.GetResult() [PIXEL_DATA]["vr"].asString()); 3262 ASSERT_EQ("OW", visitor.GetResult() [PIXEL_DATA]["vr"].asString());
3263 } 3263 }
3264 } 3264 }
3265 3265
3266 3266
3267 #include "../Sources/DicomFormat/DicomArray.h"
3268 TEST(ParsedDicomFile, RemoveFromPixelData)
3269 {
3270 ParsedDicomFile dicom(true);
3271 ASSERT_TRUE(dicom.GetDcmtkObject().getDataset()->putAndInsertString(DcmTag(0x7fe0, 0x0000), "").good());
3272 ASSERT_TRUE(dicom.GetDcmtkObject().getDataset()->putAndInsertString(DcmTag(0x7fe0, 0x0009), "").good());
3273 ASSERT_TRUE(dicom.GetDcmtkObject().getDataset()->putAndInsertUint8Array(DcmTag(0x7fe0, 0x0010), NULL, 0).good());
3274 ASSERT_TRUE(dicom.GetDcmtkObject().getDataset()->putAndInsertString(DcmTag(0x7fe0, 0x0011), "").good());
3275 ASSERT_TRUE(dicom.GetDcmtkObject().getDataset()->putAndInsertString(DcmTag(0x7fe1, 0x0000), "").good());
3276
3277 {
3278 DicomMap m;
3279 dicom.ExtractDicomSummary(m, 0);
3280
3281 ASSERT_EQ(10u, m.GetSize());
3282 ASSERT_TRUE(m.HasTag(DICOM_TAG_MEDIA_STORAGE_SOP_INSTANCE_UID));
3283 ASSERT_TRUE(m.HasTag(DICOM_TAG_SOP_INSTANCE_UID));
3284 ASSERT_TRUE(m.HasTag(DICOM_TAG_PATIENT_ID));
3285 ASSERT_TRUE(m.HasTag(DICOM_TAG_SERIES_INSTANCE_UID));
3286 ASSERT_TRUE(m.HasTag(DICOM_TAG_STUDY_INSTANCE_UID));
3287 ASSERT_TRUE(m.HasTag(0x7fe0, 0x0000));
3288 ASSERT_TRUE(m.HasTag(0x7fe0, 0x0009));
3289 ASSERT_TRUE(m.HasTag(DICOM_TAG_PIXEL_DATA));
3290 ASSERT_TRUE(m.HasTag(0x7fe0, 0x0011));
3291 ASSERT_TRUE(m.HasTag(0x7fe1, 0x0000));
3292 }
3293
3294 dicom.RemoveFromPixelData();
3295
3296 {
3297 DicomMap m;
3298 dicom.ExtractDicomSummary(m, 0);
3299
3300 ASSERT_EQ(7u, m.GetSize());
3301 ASSERT_TRUE(m.HasTag(DICOM_TAG_MEDIA_STORAGE_SOP_INSTANCE_UID));
3302 ASSERT_TRUE(m.HasTag(DICOM_TAG_SOP_INSTANCE_UID));
3303 ASSERT_TRUE(m.HasTag(DICOM_TAG_PATIENT_ID));
3304 ASSERT_TRUE(m.HasTag(DICOM_TAG_SERIES_INSTANCE_UID));
3305 ASSERT_TRUE(m.HasTag(DICOM_TAG_STUDY_INSTANCE_UID));
3306 ASSERT_TRUE(m.HasTag(0x7fe0, 0x0000));
3307 ASSERT_TRUE(m.HasTag(0x7fe0, 0x0009));
3308 ASSERT_FALSE(m.HasTag(DICOM_TAG_PIXEL_DATA));
3309 ASSERT_FALSE(m.HasTag(0x7fe0, 0x0011));
3310 ASSERT_FALSE(m.HasTag(0x7fe1, 0x0000));
3311 }
3312 }
3313
3314
3267 TEST(ParsedDicomFile, DISABLED_InjectEmptyPixelData2) 3315 TEST(ParsedDicomFile, DISABLED_InjectEmptyPixelData2)
3268 { 3316 {
3269 static const char* PIXEL_DATA = "7FE00010"; 3317 static const char* PIXEL_DATA = "7FE00010";
3270 3318
3271 for (int i = 0; i <= DicomTransferSyntax_XML; i++) 3319 for (int i = 0; i <= DicomTransferSyntax_XML; i++)