Skip to content

Commit

Permalink
set timezone to eastern
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Oct 21, 2024
1 parent dc625a6 commit 6d4dc34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# FROM docker.io/fnndsc/conda:python3.10.2-cuda11.6.0
FROM docker.io/python:3.11.0-slim-bullseye

# set timezone to EDT
RUN ln -sf /usr/share/zoneinfo/America/New_York /etc/timezone

LABEL org.opencontainers.image.authors="FNNDSC <[email protected]>" \
org.opencontainers.image.title="DICOM image make" \
org.opencontainers.image.description="A ChRIS plugin that creates a new DICOM file from an existing DICOM and a new image"
Expand Down
8 changes: 5 additions & 3 deletions dicommake.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
from pflog import pflog
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
from functools import partial
from pytz import timezone
import os, sys
import pudb
import pydicom
import datetime
os.environ['XDG_CONFIG_HOME'] = '/tmp' # For root/non root container sanity
eastern = timezone('US/Eastern')

from PIL import Image
import numpy as np
Expand All @@ -36,7 +38,7 @@



__version__ = '2.3.8'
__version__ = '2.3.9'

DISPLAY_TITLE = r"""
_ _ _ _
Expand Down Expand Up @@ -118,8 +120,8 @@ def image_intoDICOMinsert(image: Image.Image, ds: pydicom.Dataset) -> pydicom.Da
Returns:
pydicom.Dataset: a DICOM Dataset with the new image
"""
AcquisitionDate = lambda : datetime.datetime.now().strftime('%Y%m%d')
AcquisitionTime = lambda : datetime.datetime.now().strftime('%H%M%S')
AcquisitionDate = lambda : datetime.datetime.now(eastern).strftime('%Y%m%d')
AcquisitionTime = lambda : datetime.datetime.now(eastern).strftime('%H%M%S')

def npimage_get(image):
interpretation:str = ""
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ numpy
loguru
pftag==1.2.22
pflog==1.2.26
pftel-client
pftel-client
pytz # for timezone

0 comments on commit 6d4dc34

Please sign in to comment.