pynetdicom.pdu.PresentationDataValueItem

class pynetdicom.pdu.PresentationDataValueItem[source]

A Presentation Data Value Item.

Presentation Data Value (PDV) Items are used to contain DIMSE Messages that have been fragmented into Command and Data fragments, with each fragment placed into its own PDV Item.

Notes

A Presentation Data Value Item requires the following parameters:

  • Item length (1)

  • Presentation context ID (1)

  • Presentation data value (1)

Encoding

When encoded, a Presentation Data Value Item has the following structure, taken from Tables 9.24 of the DICOM Standard (offsets shown with Python indexing). Items are always encoded using Big Endian.

Offset

Length

Description

0

4

Item length

4

1

Presentation context ID

5

Variable

Presentation data value

References

__init__() None[source]

Initialise a new Presentation Data Value Item.

Methods

__init__()

Initialise a new Presentation Data Value Item.

decode(bytestream)

Decode bytestream and use the result to set the field values of the PDU item.

encode()

Return the encoded PDU as bytes.

Attributes

context_id

Return the item's Presentation Context ID field value.

data

Return the item's Presentation Data Value field value.

item_length

Return the item's Item Length field value as int.

item_type

Raise NotImplementedError as Presentation Data Value Items have no Item Type field.

message_control_header_byte

Return the message control header byte as a formatted string.

property context_id: int | None

Return the item’s Presentation Context ID field value.

property data: bytes | None

Return the item’s Presentation Data Value field value.

property item_length: int

Return the item’s Item Length field value as int.

property item_type: int

Raise NotImplementedError as Presentation Data Value Items have no Item Type field.

property message_control_header_byte: str

Return the message control header byte as a formatted string.