pydicom.encaps.parse_basic_offsets

pydicom.encaps.parse_basic_offsets(buffer: bytes | bytearray | ReadableBuffer, *, endianness: str = '<') list[int][source]

Return the encapsulated pixel data’s basic offset table frame offsets.

Added in version 3.0.

Parameters:
  • buffer (bytes | bytearray | readable buffer) – A buffer containing the encapsulated frame data, positioned at the beginning of the Basic Offset Table. May be bytes, bytearray or an object with read(), tell() and seek() methods. If the latter then after reading it will be positioned at the start of the item tag of the first fragment after the Basic Offset Table.

  • endianness (str, optional) – If "<" (default) then the encapsulated data uses little endian encoding, otherwise if ">" it uses big endian encoding.

Returns:

A list of the offset positions to the first item tag of each frame, as measured from the end of the basic offset table.

Return type:

list[int]

References

DICOM Standard, Part 5, Annex A.4