Skip to content

Commit

Permalink
Revert "pydicom >= 3.0 has breaking change: dicomio.read_file -> dico…
Browse files Browse the repository at this point in the history
…mio.dcmread"

pydicom >= 3.0 does not appear to be compatible with Python < 3.10.
"TypeError: unsupported operand type(s) for |: 'type' and 'type'" upon import of pydicom.dicomio
  • Loading branch information
mrclary committed Sep 27, 2024
1 parent 0741279 commit bfbf58b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ xarray
pillow
django
h5py
pydicom>=3.0
pydicom
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_version(module='spyder_kernels'):
'pillow',
'django',
'h5py',
'pydicom>=3.0'
'pydicom'
]

setup(
Expand Down
4 changes: 2 additions & 2 deletions spyder_kernels/utils/iofuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,9 @@ def load_dicom(filename):

name = osp.splitext(osp.basename(filename))[0]
try:
data = dicomio.dcmread(filename, force=True)
data = dicomio.read_file(filename, force=True)
except TypeError:
data = dicomio.dcmread(filename)
data = dicomio.read_file(filename)
arr = data.pixel_array
return {name: arr}, None
except Exception as error:
Expand Down

0 comments on commit bfbf58b

Please sign in to comment.