Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Update load_dicom to accommodate Pydicom 3.0 #503

Merged
merged 6 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "pydicom >= 3.0 has breaking change: dicomio.read_file -> dico…
…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
commit bfbf58b6fee1f16314561dc34546a3cdc8043aa7
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