Skip to content

Commit be070fd

Browse files
authored
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
1 parent d854801 commit be070fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/highdicom/legacy/sop.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ def _convert_legacy_to_enhanced(
189189
unique_image_types.add(tuple(frame_type))
190190
frame_type_item = Dataset()
191191
frame_type_item.FrameType = frame_type
192-
frame_type_item.PixelRepresentation = pixel_representation
192+
if frame_type_item.PixelRepresentation == 0:
193+
frame_type_item.PixelPresentation = 'MONOCHROME'
194+
else:
195+
frame_type_item.PixelPresentation = 'COLOR'
193196
frame_type_item.VolumetricProperties = volumetric_properties
194197
if frame_type[0] == 'ORIGINAL':
195198
frame_type_item.VolumeBasedCalculationTechnique = 'NONE'

0 commit comments

Comments
 (0)