Skip to content

Commit d897a62

Browse files
committed
PEP8 and header warning (doc)
1 parent cc3af8e commit d897a62

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

doc/source/dicom/dicom_niftiheader.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ Creating a PMOD-compatible header is just as easy::
5252
>> nim.header.extensions.append(dcmext)
5353
>> nib.save(nim,'pet_withdcm.nii')
5454
55+
Be careful! Many imaging tools don't maintain information in the extended
56+
header, so it's possible [likely] that this information may be lost during
57+
routine use. You'll have to keep track, and re-write the information if
58+
required.
59+
5560
.. _`NIfTI Extensions Standard`: http://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1fields_pages/extension.html
5661
5762
.. include:: links_names.txt

nibabel/nifti1.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -412,25 +412,25 @@ def _guess_implicit_VR(self):
412412
valid VRs"""
413413
potential_vr = self._raw_content[4:6].decode()
414414
if potential_vr in dicom_converters.keys():
415-
implicit_VR=False
415+
implicit_VR = False
416416
else:
417-
implicit_VR=True
417+
implicit_VR = True
418418
return implicit_VR
419419

420420
def _guess_little_endian(self):
421421
return True
422422

423-
def _unmangle(self,value):
424-
bio=BytesIO(value)
425-
ds=read_dataset(bio,self._is_implicit_VR,self._is_little_endian)
423+
def _unmangle(self, value):
424+
bio = BytesIO(value)
425+
ds = read_dataset(bio, self._is_implicit_VR, self._is_little_endian)
426426
return ds
427427

428428
def _mangle(self, dataset):
429-
bio=BytesIO()
430-
dio=DicomFileLike(bio)
429+
bio = BytesIO()
430+
dio = DicomFileLike(bio)
431431
dio.is_implicit_VR = self._is_implicit_VR
432432
dio.is_little_endian = self._is_little_endian
433-
ds_len=write_dataset(dio,dataset)
433+
ds_len = write_dataset(dio, dataset)
434434
dio.seek(0)
435435
return dio.read(ds_len)
436436

0 commit comments

Comments
 (0)