pynetdicom.dsutils.encode_element

pynetdicom.dsutils.encode_element(elem, is_implicit_vr=True, is_little_endian=True)

Encode a pydicom DataElement elem to bytes.

Parameters
  • elem (pydicom.dataelem.DataElement) – The element to encode.

  • is_implicit_vr (bool, optional) – The element encoding scheme the element will be encoded with, default True.

  • is_little_endian (bool, optional) – The byte ordering the element will be encoded in, default True.

Returns

The encoded element.

Return type

bytes