pynetdicom.pdu_items.MaximumLengthSubItem

class pynetdicom.pdu_items.MaximumLengthSubItem

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
item_type

The Item Type field value (0x51).

Type:int
maximum_length_received

The Maximum Length Received field value.

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
__init__()

Initialise a new Maximum Length Item.

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_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.
decode(bytestream)

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

Parameters:bytestream (bytes) – The PDU data to be decoded.
encode()

Return the encoded PDU as bytes.

Returns:The encoded PDU.
Return type:bytes
from_primitive(primitive)

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()

Return a Maximum Length primitive from the current Item.

Returns:The primitive representation of the current Item.
Return type:pdu_primitives.MaximumLengthNotification