pynetdicom.dsutils.encode¶
-
pynetdicom.dsutils.encode(ds, is_implicit_vr, is_little_endian, deflated=False)[source]¶ Encode a pydicom
Datasetds.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,
Truefor implicit VR,Falsefor explicit VR.is_little_endian (bool) – The byte ordering the dataset will be encoded in,
Truefor little endian,Falsefor big endian.deflated (bool, optional) –
Trueif the dataset is to be encoded using Deflated Explicit VR Little Endian transfer syntax (defaultFalse).
- Returns
The encoded dataset as
bytes(if successful) orNoneif the encoding failed.- Return type