Skip to content

Commit 3f35e5c

Browse files
committed
Revert "Read Full Datasets Using TransferSyntax"
Only read DICOM tags directly and don't worry about metadata or transfer sytax. This reverts commit 947034d.
1 parent 947034d commit 3f35e5c

File tree

5 files changed

+1
-14
lines changed

5 files changed

+1
-14
lines changed

nibabel/nifti1.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def _check_meta(self):
426426
is_implicit_VR = False
427427
is_little_endian = False
428428
elif transfer_syntax == dicom.UID.DeflatedExplicitVRLittleEndian:
429-
zipped = self._bio.read()
429+
zipped = fileobj.read()
430430
unzipped = zlib.decompress(zipped, -zlib.MAX_WBITS)
431431
self._bio = BytesIO(unzipped) # a file-like object
432432
is_implicit_VR = False
@@ -483,7 +483,6 @@ def _mangle(self, value):
483483
from dicom.filebase import DicomFileLike
484484
from dicom.values import converters as dicom_converters
485485
import dicom.UID
486-
import zlib
487486
from io import BytesIO
488487
except ImportError:
489488
"""Fall back to standard reader if pydicom unavailable."""
Binary file not shown.
-362 Bytes
Binary file not shown.
-362 Bytes
Binary file not shown.

nibabel/tests/test_nifti1.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,18 +1144,6 @@ def test_nifti_dicom_extension():
11441144

11451145
dcmext.write_to(BytesIO(),False)
11461146

1147-
dicomtestfiles=[
1148-
('data/0_ExplicitVRBigEndian.dcm',dicom.UID.ExplicitVRBigEndian),
1149-
('data/0_ExplicitVRLittleEndian.dcm',dicom.UID.ExplicitVRLittleEndian),
1150-
('data/0_DeflatedExplicitVRLittleEndian.dcm',dicom.UID.DeflatedExplicitVRLittleEndian)]
1151-
for fname,encoding in dicomtestfiles:
1152-
with open(fname,'rb') as dim:
1153-
dcmbytes_full = dim.read()
1154-
dcmext = Nifti1DicomExtension(2,dcmbytes_full)
1155-
assert_equal(dcmext.get_content().PatientID, 'NiPy')
1156-
assert_equal(dcmext.get_content().file_meta.TransferSyntaxUID,encoding)
1157-
1158-
11591147
class TestNifti1General(object):
11601148
""" Test class to test nifti1 in general
11611149

0 commit comments

Comments
 (0)