From c21d0216a967fb59587133c63538cdc51f055a6a Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 13 Sep 2021 10:12:37 +0200 Subject: [PATCH 1/2] Properly set Pixel Presentation Pixel Presentation != Pixel Representation For reference: * http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.16.2.html#table_C.8-131 --- src/highdicom/legacy/sop.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/highdicom/legacy/sop.py b/src/highdicom/legacy/sop.py index b592e019..0fce9418 100644 --- a/src/highdicom/legacy/sop.py +++ b/src/highdicom/legacy/sop.py @@ -189,7 +189,10 @@ def _convert_legacy_to_enhanced( unique_image_types.add(tuple(frame_type)) frame_type_item = Dataset() frame_type_item.FrameType = frame_type - frame_type_item.PixelRepresentation = pixel_representation + if pixel_representation == 0: + frame_type_item.PixelPresentation = 'MONOCHROME' + else: + frame_type_item.PixelPresentation = 'COLOR' frame_type_item.VolumetricProperties = volumetric_properties if frame_type[0] == 'ORIGINAL': frame_type_item.VolumeBasedCalculationTechnique = 'NONE' From a6fa7c245c2703b07bc48dc087ad3aed3fc8b741 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 13 Sep 2021 10:59:26 +0200 Subject: [PATCH 2/2] Properly set Pixel Presentation Pixel Presentation != Pixel Representation For reference: * http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.16.2.html#table_C.8-131 --- src/highdicom/legacy/sop.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/highdicom/legacy/sop.py b/src/highdicom/legacy/sop.py index 0fce9418..306ac02b 100644 --- a/src/highdicom/legacy/sop.py +++ b/src/highdicom/legacy/sop.py @@ -338,7 +338,10 @@ def _convert_legacy_to_enhanced( mf_dataset.ImageType = list(list(unique_image_types)[0]) if len(unique_image_types) > 1: mf_dataset.ImageType[2] = 'MIXED' - mf_dataset.PixelRepresentation = pixel_representation + if pixel_representation == 0: + mf_dataset.PixelPresentation = 'MONOCHROME' + else: + mf_dataset.PixelPresentation = 'COLOR' mf_dataset.VolumetricProperties = volumetric_properties # Shared Functional Groups