Allow signed as synonym for metadata isSigned

This commit is contained in:
RunasSudo 2025-10-27 18:51:26 +11:00
parent f09376c06e
commit 1af98b893c
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -1,5 +1,5 @@
# ev-to-dicom
# Copyright © 2023–2024 Lee Yingtong Li
# Copyright © 2023–2025 Lee Yingtong Li
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -86,7 +86,10 @@ def ev_files_to_dcm_file(study_uid, series_uid, series_number, image_number, inp
ds.InstitutionName = metadata['metadata']['institutionName']
ds.PatientAge = metadata['metadata']['patientAge']
ds.SamplesPerPixel = 3 if metadata['color'] else 1
ds.PixelRepresentation = 1 if metadata['isSigned'] else 0
if 'isSigned' in metadata:
ds.PixelRepresentation = 1 if metadata['isSigned'] else 0
else:
ds.PixelRepresentation = 1 if metadata['signed'] else 0
#ds.BitsAllocated = metadata['bytesPerSample'] * 8 # Incorrect value!
#ds.BitsStored = metadata['bytesPerSample'] * 8
ds.Columns = metadata['columns']