pynetdicom.dsutils.encode¶
-
pynetdicom.dsutils.
encode
(ds, is_implicit_vr, is_little_endian, deflated=False)[source]¶ Encode a pydicom
Dataset
ds.Changed in version 1.5: Added deflated keyword parameter
- Parameters
ds (pydicom.dataset.Dataset) – The dataset to encode
is_implicit_vr (bool) – The element encoding scheme the dataset will be encoded with,
True
for implicit VR,False
for explicit VR.is_little_endian (bool) – The byte ordering the dataset will be encoded in,
True
for little endian,False
for big endian.deflated (bool, optional) –
True
if the dataset is to be encoded using Deflated Explicit VR Little Endian transfer syntax (defaultFalse
).
- Returns
The encoded dataset as
bytes
(if successful) orNone
if the encoding failed.- Return type