Skip to content

Commit a2719d3

Browse files
committed
A little cleanup
* Remove redundant get size method (inherited) * Remove unnecessary super()
1 parent b5b6550 commit a2719d3

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

nibabel/nifti1.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,6 @@ def __init__(self, code, content):
393393
self._is_implicit_VR = self._guess_implicit_VR()
394394
self._content = self._unmangle(content)
395395

396-
super(Nifti1DicomExtension,self)
397-
398396
def _guess_implicit_VR(self):
399397
"""Without a DICOM Transfer Syntax, it's difficult to tell if Value
400398
Representations (VRs) are included in the DICOM encoding or not.
@@ -424,16 +422,6 @@ def _mangle(self, value):
424422
dio.seek(0)
425423
return dio.read(ds_len)
426424

427-
def get_sizeondisk(self):
428-
"""Return the size of the extension in the NIfTI file.
429-
"""
430-
size = len(self._mangle(self._content))
431-
size += 8
432-
# extensions size has to be a multiple of 16 bytes
433-
size += 16 - (size % 16)
434-
435-
return size
436-
437425
try:
438426
from dicom.filereader import read_dataset
439427
from dicom.filewriter import write_dataset

nibabel/tests/test_nifti1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ def test_nifti_dicom_extension():
10871087
hdr = nim.header
10881088
exts_container = hdr.extensions
10891089

1090-
# create a single dicom tag (Patien ID, [0010,0020]) with Explicit VR
1090+
# create a single dicom tag (Patient ID, [0010,0020]) with Explicit VR
10911091
dcmbytes_explicit = struct.pack('<HH2sH4s',0x10,0x20,
10921092
'LO'.encode('utf-8'),4,'NiPy'.encode('utf-8'))
10931093
dcmext = Nifti1DicomExtension(2,dcmbytes_explicit)
@@ -1099,7 +1099,7 @@ def test_nifti_dicom_extension():
10991099
assert_equal(dcmext._mangle(dcmext.get_content()),dcmbytes_explicit)
11001100
assert_equal(dcmext.get_sizeondisk() % 16, 0)
11011101

1102-
# create a single dicom tag (Patien ID, [0010,0020]) with Implicit VR
1102+
# create a single dicom tag (Patient ID, [0010,0020]) with Implicit VR
11031103
dcmbytes_implicit = struct.pack('<HHL4s',0x10,0x20,4,'NiPy'.encode('utf-8'))
11041104
dcmext = Nifti1DicomExtension(2,dcmbytes_implicit)
11051105
assert_equal(dcmext._guess_implicit_VR(),True)

0 commit comments

Comments
 (0)