Skip to content

Commit

Permalink
Merge pull request #3659 from penguinpee/replace_imghdr
Browse files Browse the repository at this point in the history
Replace deprecated imghdr
  • Loading branch information
effigies authored Oct 6, 2024
2 parents ccec546 + 303a0e8 commit 83e3903
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions nipype/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def get_nipype_gitversion():
"filelock>=3.0.0",
"etelemetry>=0.2.0",
"looseversion!=1.2",
"puremagic",
]

TESTS_REQUIRES = [
Expand Down
4 changes: 2 additions & 2 deletions nipype/interfaces/dcmstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from glob import glob

import nibabel as nb
import imghdr
import puremagic

from .base import (
TraitedSpec,
Expand Down Expand Up @@ -152,7 +152,7 @@ def _run_interface(self, runtime):
meta_filter = dcmstack.make_key_regex_filter(exclude_regexes, include_regexes)
stack = dcmstack.DicomStack(meta_filter=meta_filter)
for src_path in src_paths:
if imghdr.what(src_path) != "gif":
if puremagic.what(src_path) != "gif":
src_dcm = pydicom.dcmread(src_path, force=self.inputs.force_read)
stack.add_dcm(src_dcm)
nii = stack.to_nifti(embed_meta=True)
Expand Down

0 comments on commit 83e3903

Please sign in to comment.