Skip to content

Commit 920ba70

Browse files
committed
RF: Remove pydicom<1 conditions in pydicom_compat
1 parent 9c3da68 commit 920ba70

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

nibabel/pydicom_compat.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,17 @@
3030
pydicom = read_file = tag_for_keyword = Sequence = None
3131

3232
try:
33-
import dicom as pydicom
33+
import pydicom
3434
except ImportError:
35-
try:
36-
import pydicom
37-
except ImportError:
38-
have_dicom = False
39-
else: # pydicom module available
40-
from pydicom.dicomio import read_file
41-
from pydicom.sequence import Sequence
42-
# Values not imported by default
43-
import pydicom.values
44-
else: # dicom module available
35+
have_dicom = False
36+
else: # pydicom module available
37+
from pydicom.dicomio import read_file
38+
from pydicom.sequence import Sequence
4539
# Values not imported by default
46-
import dicom.values
47-
from dicom.sequence import Sequence
48-
read_file = pydicom.read_file
40+
import pydicom.values
4941

5042
if have_dicom:
51-
try:
52-
# Versions >= 1.0
53-
tag_for_keyword = pydicom.datadict.tag_for_keyword
54-
except AttributeError:
55-
# Versions < 1.0 - also has more search options.
56-
tag_for_keyword = pydicom.datadict.tag_for_name
43+
tag_for_keyword = pydicom.datadict.tag_for_keyword
5744

5845

5946
@deprecate_with_version("dicom_test has been moved to nibabel.nicom.tests",

0 commit comments

Comments
 (0)