Skip to content

Commit

Permalink
change transfer syntax UID and LUT space
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Apr 1, 2024
1 parent 902ccc0 commit 9928314
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dicommake.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from PIL import Image
import numpy as np
from loguru import logger
from pydicom.uid import ExplicitVRLittleEndian
LOG = logger.debug
logger_format = (
"<green>{time:YYYY-MM-DD HH:mm:ss}</green> │ "
Expand All @@ -34,7 +35,7 @@



__version__ = '2.2.6'
__version__ = '2.2.8'

DISPLAY_TITLE = r"""
_ _ _ _
Expand Down Expand Up @@ -137,6 +138,14 @@ def npimage_get(image):
ds.BitsAllocated = 8
ds.HighBit = 7
ds.PixelRepresentation = 0

# The changes in `pfdcm` made to use `oxidicom` to receive PACS files from a server
# changes the TransferSyntaxUID of a DICOM file to 'lossy JPEG compression'. Since the image
# file itself isn't compressed, saving it as a DICOM file would throw error.
# The below fix handles this.
# We change the transfer syntax UID (https://github.com/pydicom/pydicom/issues/1109)
ds.PresentationLUTShape = ''
ds.file_meta.TransferSyntaxUID = ExplicitVRLittleEndian
ds.PixelData = np_image.tobytes()
ds.AcquisitionTime = AcquisitionTime()
ds.AcquisitionDate = AcquisitionDate()
Expand Down

0 comments on commit 9928314

Please sign in to comment.