pynetdicom.pdu_items.SCP_SCU_RoleSelectionSubItem

class pynetdicom.pdu_items.SCP_SCU_RoleSelectionSubItem

An SCP/SCU Role Selection Sub-item.

An SCU/SCU Role Selection Sub-item allows communicating Application Entities to negotiate the roles in which they will server for each SOP Class or Meta SOP Class supported on the association.

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 (0x54).

Type:int
scu_role

The SCU Role field value, 0 or 1 or None.

Type:int or None
scp_role

The SCP Role field value, 0 or 1 or None.

Type:int or None
sop_class_uid

The SOP Class UID field value.

Type:pydicom.uid.UID or None
uid_length

The UID Length field value.

Type:int

Notes

An SCP/SCU Role Selection Sub-item requires the following parameters:

  • Item type (1, fixed, 0x51)
  • Item length (1)
  • UID length (1)
  • SOP Class UID (1)
  • SCU role (1)
  • SCP role (1)

Encoding

When encoded, an SCP/SCU Role Section Sub-item has the following structure, taken from Tables D.3-9 and D.3-10 [1] (offsets shown with Python indexing). Items are always encoded using Big Endian [2]. The SOP Class UID parameter is encoded as a UID as per the rules in Part 5, Section 9.1 (ie NO trailing padding null byte).

Offset Length Description
0 1 Item type
1 1 Reserved
2 2 Item length
4 2 UID length
6 Variable SOP class UID
6 + UID length 1 SCP role
7 + UID length 1 SCU role

References

[1]DICOM Standard, Part 7, Annex D.3.3.4
[2]DICOM Standard, Part 8, Section 9.3.1
__init__()

Initialise a new SCP/SCU Role Selection Item.

Methods

__init__() Initialise a new SCP/SCU Role Selection 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 an SCP/SCU Role Selection primitive.
to_primitive() Return an SCP/SCU Role Selection 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.
scp Return the item’s SCP Role field value.
scp_role Return the item’s SCP Role field value.
scu Return the item’s SCU Role field value.
scu_role Return the item’s SCU Role field value.
sop_class_uid Return the item’s SOP Class UID field value.
uid Return the item’s SOP Class UID field value.
uid_length Return the UID Length parameter value.
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 an SCP/SCU Role Selection primitive.

Parameters:primitive (pdu_primitives.SCP_SCU_RoleSelectionNegotiation) – 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.

scp

Return the item’s SCP Role field value.

scp_role

Return the item’s SCP Role field value.

scu

Return the item’s SCU Role field value.

scu_role

Return the item’s SCU Role field value.

sop_class_uid

Return the item’s SOP Class UID field value.

to_primitive()

Return an SCP/SCU Role Selection primitive from the current Item.

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

Return the item’s SOP Class UID field value.

uid_length

Return the UID Length parameter value.