Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly set Pixel Presentation #105

Merged
merged 2 commits into from
Sep 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/highdicom/legacy/sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -335,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
Expand Down