Bulk Data Encapsulation Utilities (pydicom.encaps)

Functions for parsing and applying encapsulation to bulk data elements such as (7FE0,0010) Pixel Data.

Parsing Encapsulated Data


Read encapsulated data and return a list of bytes.


Read encapsulated data and return the fragments as one continuous bytes.

generate_pixel_data(bytestream[, nr_frames])

Yield an encapsulated pixel data frame.


Yield the encapsulated pixel data fragments.

generate_pixel_data_frame(bytestream[, ...])

Yield complete frames from buffer as bytes.


Return a list of the fragment offsets from the Basic Offset Table.


Read and return a single Item in the fragmented data stream.

parse_basic_offsets(buffer, *[, endianness])

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

parse_fragments(buffer, *[, endianness])

Return the number of fragments and their positions in buffer.

generate_fragments(buffer, *[, endianness])

Yield frame fragments from the encapsulated pixel data in buffer.

generate_fragmented_frames(buffer, *[, ...])

Yield fragmented pixel data frames from buffer.

generate_frames(buffer, *[, ...])

Yield complete pixel data frames from buffer.

get_frame(buffer, index, *[, ...])

Return the specified frame at index.

Creating Encapsulated Data

encapsulate(frames[, fragments_per_frame, ...])

Return encapsulated frames.


Return encapsulated image data and values for the Extended Offset Table elements.

fragment_frame(frame[, nr_fragments])

Yield one or more fragments from frame.


Return an itemized fragment.

itemize_frame(frame[, nr_fragments])

Yield items generated from frame.