pynetdicom.pdu.PresentationDataValueItem¶
-
class
pynetdicom.pdu.PresentationDataValueItem[source][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 [1], 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 [2] (offsets shown with Python indexing). Items are always encoded using Big Endian [3].
Offset Length Description 0 4 Item length 4 1 Presentation context ID 5 Variable Presentation data value References
[1] DICOM Standard, Part 8, Annex E [2] DICOM Standard, Part 8, Section 9.3.5.1 [3] DICOM Standard, Part 8, Section 9.3.1 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_idReturn the item’s Presentation Context ID field value. dataReturn the item’s Presentation Data Value field value. item_lengthReturn the item’s Item Length field value as an int. item_typeRaise NotImplementedError as Presentation Data Value Items have no Item Type field. message_control_header_byteReturn the message control header byte as a formatted string. -
context_id¶ Return the item’s Presentation Context ID field value.
-
data¶ Return the item’s Presentation Data Value field value.
-
decode(bytestream)[source]¶ Decode bytestream and use the result to set the field values of the PDU item.
Parameters: bytestream (bytes) – The PDU data to be decoded.
-
item_length Return the item’s Item Length field value as an 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.