pynetdicom.pdu_items.PresentationContextItemAC¶
-
class
pynetdicom.pdu_items.
PresentationContextItemAC
[source]¶ A Presentation Context (AC) Ttem.
Presentation Contexts (AC) Items are used by the association acceptor to signal which Abstract Syntaxes and Transfer Syntaxes have been accepted or rejected.
-
item_length
¶ The number of bytes from the first byte following the Item Length field to the last byte of the Item.
- Type
-
presentation_context_id
¶ The Presentation Context ID field value, an odd integer between 1 and 255.
-
transfer_syntax
¶ The Presentation Context Item’s Transfer Syntax (if available).
- Type
list of pydicom.uid.UID
-
transfer_syntax_sub_item
¶ The Presentation Context Items’ Transfer Syntax Sub-item field value.
- Type
list of pynetdicom.uid.UID
Notes
A Presentation Context (AC) Item requires the following parameters:
Item type (1, fixed value,
0x21
)Item length (1)
Presentation context ID (1)
Result/reason (1)
Transfer Syntax Sub-item (1)
Item type (1, fixed, 0x40)
Item length (1)
Transfer syntax name (1)
Encoding
When encoded, a Presentation Context (AC) Item has the following structure, taken from Part 8, Table 9-13 of the DICOM Standard (offsets shown with Python indexing). Items are always encoded using Big Endian.
Offset
Length
Description
0
1
Item type
1
1
Reserved
2
2
Item length
4
1
Presentation context ID
5
1
Reserved
6
1
Result/reason
7
1
Reserved
8
Variable
Transfer syntax sub-item
References
DICOM Standard, Part 8, Section 9.3.3.2
DICOM Standard, Part 8, Section 9.3.1
Methods
__init__
()Initialise a new Presentation Context (AC) 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 Presentation Context primitive.
Return a PresentationContext primitive from the current Item.
Attributes
Return the item’s Presentation Context ID field value.
Return the item’s Item Length field value as
int
.Return the item’s Item Type field value as
int
.Return the item’s Result/reason field value.
Get a string describing the result.
Return the Transfer Syntax, if available.
-
property
context_id
¶ Return the item’s Presentation Context ID field value.
-
from_primitive
(primitive)[source]¶ Set the item’s values using a Presentation Context primitive.
- Parameters
primitive (presentation.PresentationContext) – The primitive to use to set the Item’s field values.
-
property
result
¶ Return the item’s Result/reason field value.
-
property
result_str
¶ Get a string describing the result.
-
to_primitive
()[source]¶ Return a PresentationContext primitive from the current Item.
- Returns
The primitive representation of the current Item.
- Return type
-
property
transfer_syntax
¶ Return the Transfer Syntax, if available.
- Returns
If no Transfer Syntax Sub-item or an empty Transfer Syntax Sub-item has been sent by the Acceptor then returns None, otherwise returns the Transfer Syntax Sub-item’s transfer syntax UID.
- Return type
-