From 54dff62794dfcbab4bdaf308e3f2d0399d496bc7 Mon Sep 17 00:00:00 2001 From: William T Clarke Date: Mon, 23 Sep 2024 10:47:34 +0100 Subject: [PATCH] Pydicom compatibility (#149) * Update requirements.yml * Update requirements.yml * Replace depreciated pydcm functions --- requirements.yml | 3 ++- spec2nii/spec2nii.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.yml b/requirements.yml index 70d583c..6dc58c3 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,7 +1,8 @@ dependencies: - numpy>=1.26 - nibabel - - pydicom + - pydicom==3.*;python_version>="3.10" + - pydicom==2.4.*;python_version<"3.10" - pyMapVBVD>=0.6.0 - scipy==1.13.* - brukerapi>=0.1.8 diff --git a/spec2nii/spec2nii.py b/spec2nii/spec2nii.py index d06c93e..7ba6526 100644 --- a/spec2nii/spec2nii.py +++ b/spec2nii/spec2nii.py @@ -467,9 +467,9 @@ def auto(self, args): sorted(args.file.rglob('*.IMA')) + \ sorted(args.file.rglob('*.ima')) + \ sorted(args.file.rglob('*.dcm')) - file = pdcm.read_file(files_in[0]) + file = pdcm.dcmread(files_in[0]) else: - file = pdcm.read_file(args.file) + file = pdcm.dcmread(args.file) manufacturer = file.Manufacturer setattr(args, 'tag', None)