diff --git a/nipype/interfaces/dcmstack.py b/nipype/interfaces/dcmstack.py index 6909c0fc8f..49acf9f509 100644 --- a/nipype/interfaces/dcmstack.py +++ b/nipype/interfaces/dcmstack.py @@ -24,7 +24,7 @@ have_dcmstack = True try: - import dicom + import pydicom import dcmstack from dcmstack.dcmmeta import NiftiWrapper except ImportError: @@ -34,7 +34,7 @@ def sanitize_path_comp(path_comp): result = [] for char in path_comp: - if char not in string.letters + string.digits + "-_.": + if char not in string.ascii_letters + string.digits + "-_.": result.append("_") else: result.append(char) @@ -154,7 +154,7 @@ def _run_interface(self, runtime): stack = dcmstack.DicomStack(meta_filter=meta_filter) for src_path in src_paths: if not imghdr.what(src_path) == "gif": - src_dcm = dicom.read_file(src_path, force=self.inputs.force_read) + src_dcm = pydicom.dcmread(src_path, force=self.inputs.force_read) stack.add_dcm(src_dcm) nii = stack.to_nifti(embed_meta=True) nw = NiftiWrapper(nii)