diff --git a/Dockerfile b/Dockerfile index 9179d8e..4a63009 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ RUN apt-get update && apt-get -y install \ # Install scitran.data dependencies RUN pip install \ - pydicom \ + dicom \ python-dateutil==2.6.0 \ pytz==2017.2 \ tzlocal==1.4 \ diff --git a/dicom-mr-classifier.py b/dicom-mr-classifier.py index 4004cd7..32bb346 100755 --- a/dicom-mr-classifier.py +++ b/dicom-mr-classifier.py @@ -10,7 +10,7 @@ import zipfile import datetime import argparse -import pydicom as dicom +import dicom from pprint import pprint from fnmatch import fnmatch import classification_from_label @@ -156,9 +156,12 @@ def assign_type(s): return format_string(s) if type(s) == list or type(s) == dicom.multival.MultiValue: try: - return [ float(x) for x in s if x.is_integer() == False ] + return [ float(x) for x in s ] except ValueError: - return [ format_string(x) for x in s if len(x) > 0 ] + try: + return [ int(x) for x in s ] + except ValueError: + return [ format_string(x) for x in s if len(x) > 0 ] elif type(s) == float or type(s) == int: return s else: @@ -172,6 +175,7 @@ def assign_type(s): return format_string(s) + def format_string(in_string): """ Remove non-ascii characters to make sure the values will display properly