pynetdicom.dsutils.encode#
- pynetdicom.dsutils.encode(ds: Dataset, is_implicit_vr: bool, is_little_endian: bool, deflated: bool = False) bytes | None[source]#
Encode a pydicom
Datasetds.- 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:
bytes or None