pynetdicom.pdu_items.ApplicationContextItem¶
-
class
pynetdicom.pdu_items.
ApplicationContextItem
¶ An Application Context Item.
An Application Context explicitly defines the set of appliation service elements, related options and any other information necessary for the inter-working of Application Entities on an association [1].
-
application_context_name
¶ The Application Context Name field value.
Type: pydicom.uid.UID
-
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 (0x10).
Type: int
Notes
An Application Context Item requires the following parameters:
- Item type (1, fixed value, 0x10)
- Item length (1)
- Application Context Name (1)
Application Context Names
Application Context Names are OSI Object Identifiers in a numeric form as defined by ISO 8824 [2]. They are encoded as an ISO 646:1990-Basic G0 Set Numeric String of bytes (characters 0-9), separated by the character
.
(0x2e) [3]. No separator or padding shall be present before the first digit of the first component or after the last digit of the last component.Application context names shall not exceed 64 total characters.
A single DICOM Application Context Name is defined for the current (2018c) version of the DICOM Standard and it is 1.2.840.10008.3.1.1.1 [4].
Encoding
When encoded, an Application Context Item has the following structure, taken from Table 9-12 [5] (offsets shown with Python indexing). Items are always encoded using Big Endian [6]. Encoding of the Application Context Name parameter follows the rules in Part 8, Annex F.
Offset Length Description 0 1 Item type 1 1 Reserved 2 2 Item length 4 Variable Application context name References
[1] DICOM Standard, Part 7, Annex A [2] ISO/IEC 8824-1:2015 [3] DICOM Standard, Part 8, Annex F [4] DICOM Standard, Part 7, Annex A.2.1 [5] DICOM Standard, Part 8, Section 9.3.2.1 [6] DICOM Standard, Part 8, Section 9.3.1 -
__init__
()¶ Initialise a new Application Context Item.
Methods
__init__
()Initialise a new Application Context 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
application_context_name
Return the item’s Application Context Name field value as UID. 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. -
application_context_name
Return the item’s Application Context Name field value as UID.
-
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
-
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.
-