Skip to content

Commit d87ee32

Browse files
committed
BF Remove unnecessary VR validation
1 parent 8fb8616 commit d87ee32

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

nibabel/nifti1.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ def __init__(self, code, content, parent_hdr=None):
425425
elif isinstance(content, bytes): # Got a byte string - unmangle it
426426
self._raw_content = content
427427
self._is_implicit_VR = self._guess_implicit_VR()
428-
ds = self._unmangle_and_verify(content, self._is_implicit_VR,
429-
self._is_little_endian)
428+
ds = self._unmangle(content, self._is_implicit_VR,
429+
self._is_little_endian)
430430
self._content = ds
431431
elif content == None: # Otherwise, initialize a new dicom dataset
432432
self._is_implicit_VR = False
@@ -435,14 +435,6 @@ def __init__(self, code, content, parent_hdr=None):
435435
raise TypeError("content must be either a bytestring or a pydicom "
436436
"Dataset. Got %s" % content.__class__)
437437

438-
def _unmangle_and_verify(self, content, is_implicit_VR, is_little_endian):
439-
""""Decode and verify dicom dataset"""
440-
ds = self._unmangle(content, is_implicit_VR, is_little_endian)
441-
for elem in ds:
442-
if elem.VR not in pdcm.values.converters.keys():
443-
raise StandardError # Ensure that all VRs are valid
444-
return ds
445-
446438
def _guess_implicit_VR(self):
447439
"""Try to guess DICOM syntax by checking for valid VRs.
448440

0 commit comments

Comments
 (0)