pydicom.values.convert_tag

pydicom.values.convert_tag(byte_string: bytes, is_little_endian: bool, offset: int = 0) BaseTag[source]

Return a decoded BaseTag from the encoded byte_string. byte_string must be at least 4 bytes long.

Parameters:
  • byte_string (bytes) – The encoded tag.

  • is_little_endian (bool) – True if the encoding is little endian, False otherwise.

  • offset (int, optional) – The byte offset in byte_string to the start of the tag.

Returns:

The decoded tag.

Return type:

BaseTag

Raises:

ValueError – If byte_string is too short.