Skip to content

Commit

Permalink
Fix for change to aquisition date format
Browse files Browse the repository at this point in the history
  • Loading branch information
marksgraham committed Apr 5, 2024
1 parent 86839e1 commit cbd5f00
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions oct_converter/dicom/dicom.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,15 @@ def write_opt_dicom(
# OPT Image Module PS3.3 C.8.17.7
ds.ImageType = ["DERIVED", "SECONDARY"]
ds.SamplesPerPixel = 1
ds.AcquisitionDateTime = (
meta.series_info.acquisition_date.strftime("%Y%m%d%H%M%S.%f")
if meta.series_info.acquisition_date
else ""
)
if meta.series_info.acquisition_date:
# Convert string to datetime object
input_datetime = datetime.strptime(
meta.series_info.acquisition_date, "%Y-%m-%d %H:%M:%S"
)
ds.AcquisitionDateTime = input_datetime.strftime("%Y%m%d%H%M%S.%f")
else:
ds.AcquisitionDateTime = ""

ds.AcquisitionNumber = 1
ds.PhotometricInterpretation = "MONOCHROME2"
# Unsigned integer
Expand Down

0 comments on commit cbd5f00

Please sign in to comment.