@@ -259,7 +259,7 @@ def __init__(self, code, content):
259
259
"""
260
260
Parameters
261
261
----------
262
- code : int| str
262
+ code : int or str
263
263
Canonical extension code as defined in the NIfTI standard, given
264
264
either as integer or corresponding label
265
265
(see :data:`~nibabel.nifti1.extension_codes`)
@@ -385,25 +385,27 @@ class Nifti1DicomExtension(Nifti1Extension):
385
385
"""NIfTI1 DICOM header extension
386
386
387
387
This class is a thin wrapper around pydicom to read a binary DICOM
388
- byte string. If pydicom is not available, it silently falls back to the
389
- standard NiftiExtension class.
388
+ byte string. If pydicom is available, content is exposed as a Dicom Dataset.
389
+ Otherwise, this silently falls back to the standard NiftiExtension class
390
+ and content is the raw bytestring loaded directly from the nifti file
391
+ header.
390
392
"""
391
393
def __init__ (self , code , content , parent_hdr = None ):
392
394
"""
393
395
Parameters
394
396
----------
395
- code : int| str
397
+ code : int or str
396
398
Canonical extension code as defined in the NIfTI standard, given
397
399
either as integer or corresponding label
398
400
(see :data:`~nibabel.nifti1.extension_codes`)
399
- content : bytes| pydicom Dataset| None
401
+ content : bytes or pydicom Dataset or None
400
402
Extension content - either a bytestring as read from the NIfTI file
401
403
header or an existing pydicom Dataset. If a bystestring, the content
402
404
is converted into a Dataset on initialization. If None, a new empty
403
405
Dataset is created.
404
- parent_hdr : :data :`~nibabel.nifti1.Nifti1Header`
405
- Optional - If a dicom extension belongs to an existing
406
- :data :`~nibabel.nifti1.Nifti1Header`, it may be provided here to
406
+ parent_hdr : :class :`~nibabel.nifti1.Nifti1Header`, optional
407
+ If a dicom extension belongs to an existing
408
+ :class :`~nibabel.nifti1.Nifti1Header`, it may be provided here to
407
409
ensure that the DICOM dataset is written with correctly corresponding
408
410
endianness; otherwise it is assumed the dataset is little endian.
409
411
@@ -428,7 +430,7 @@ def __init__(self, code, content, parent_hdr=None):
428
430
ds = self ._unmangle (content , self ._is_implicit_VR ,
429
431
self ._is_little_endian )
430
432
self ._content = ds
431
- elif content == None : # Otherwise, initialize a new dicom dataset
433
+ elif content is None : # initialize a new dicom dataset
432
434
self ._is_implicit_VR = False
433
435
self ._content = pdcm .dataset .Dataset ()
434
436
else :
0 commit comments