pynetdicom.pdu_items.MaximumLengthSubItem¶
-
class
pynetdicom.pdu_items.MaximumLengthSubItem[source][source]¶ A Maximum Length Sub-item.
The Maximum Length Sub-item allows the receivers to limit the size of the Presentation Data Values List parameters of each P-DATA PDU.
-
item_length¶ The number of bytes from the first byte following the Item Length field to the last byte of the Item.
Type: int
Notes
A Maximum Length Sub-item requires the following parameters:
- Item type (1, fixed, 0x51)
- Item length (1)
- Maximum length received (1)
Encoding
When encoded, a Maximum Length Sub-item has the following structure, taken from Table D.1-1 [1] (offsets shown with Python indexing). Items are always encoded using Big Endian [2].
Offset Length Description 0 1 Item type 1 1 Reserved 2 2 Item length 4 4 Maximum length received References
[1] DICOM Standard, Part 8, Annex D.1 [2] DICOM Standard, Part 8, Section 9.3.1 Methods
__init__()Initialise a new Maximum Length 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. from_primitive(primitive)Set the item’s values using a Maximum Length primitive. to_primitive()Return a Maximum Length primitive from the current Item. Attributes
item_lengthReturn the item’s Item Length field value as an int. item_typeReturn the item’s Item Type field value as an int. -
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.
-
from_primitive(primitive)[source][source]¶ Set the item’s values using a Maximum Length primitive.
Parameters: primitive (pdu_primitives.MaximumLengthNotification) – The primitive to use to set the Item’s field values.
-
item_length Return the item’s Item Length field value as an int.
-
item_type Return the item’s Item Type field value as an int.
-
to_primitive()[source][source]¶ Return a Maximum Length primitive from the current Item.
Returns: The primitive representation of the current Item. Return type: pdu_primitives.MaximumLengthNotification
-