pynetdicom.pdu.A_ASSOCIATE_RQ

class pynetdicom.pdu.A_ASSOCIATE_RQ[source]

An A-ASSOCIATE-RQ PDU.

An A-ASSOCIATE-RQ PDU is sent by an association requestor to initiate association negotiation with an acceptor.

application_context_name

The Application Context Item’s Application Context Name field value (if available).

Type

pydicom.uid.UID or None

called_ae_title

The Called AE Title field value, which is the destination DICOM application name as a fixed length 16-byte value (padded with trailing spaces 0x20). Leading and trailing spaces are non-significant and a value of 16 spaces is not allowed.

Type

bytes

calling_ae_title

The Calling AE Title field value, which is the destination DICOM application name as a fixed length 16-byte value (padded with trailing spaces 0x20). Leading and trailing spaces are non-significant and a value of 16 spaces is not allowed.

Type

bytes

pdu_length

The number of bytes from the first byte following the PDU Length field to the last byte of the PDU.

Type

int

pdu_type

The PDU Type field value (0x01).

Type

int

presentation_context

The Presentation Context Item(s).

Type

list of pdu_items.PresentationContextItemRQ

protocol_version

The Protocol Version field value (0x01).

Type

int

user_information

The User Information Item (if available).

Type

pdu_items.UserInformationItem

variable_items

A list containing the A-ASSOCIATE-RQ’s Variable Items. Contains one Application Context item, one or more Presentation Context items and one User Information item. The order of the items is not guaranteed.

Type

list

Notes

An A-ASSOCIATE-RQ PDU requires the following parameters:

  • PDU type (1, fixed value, 0x01)

  • PDU length (1)

  • Protocol version (1, default value, 0x01)

  • Called AE title (1)

  • Calling AE title (1)

  • Variable items (1)

    • Application Context Item (1)

      • Item type (1, fixed value, 0x10)

      • Item length (1)

      • Application Context Name (1, fixed in an application)

    • Presentation Context Item(s) (1 or more)

      • Item type (1, fixed value, 0x21)

      • Item length (1)

      • Context ID (1)

      • Abstract/Transfer Syntax Sub-items (1)

        • Abstract Syntax Sub-item (1)

          • Item type (1, fixed, 0x30)

          • Item length (1)

          • Abstract syntax name (1)

        • Transfer Syntax Sub-items (1 or more)

          • Item type (1, fixed, 0x40)

          • Item length (1)

          • Transfer syntax name(s) (1 or more)

    • User Information Item (1)

      • Item type (1, fixed, 0x50)

      • Item length (1)

      • User data Sub-items (2 or more)

        • Maximum Length Received Sub-item (1)

        • Implementation Class UID Sub-item (1)

        • Optional User Data Sub-items (0 or more)

Encoding

When encoded, an A-ASSOCIATE-RQ PDU has the following structure, taken from Table 9-11<part08/sect_9.3.2.html> (offsets shown with Python indexing). PDUs are always encoded using Big Endian.

Offset

Length

Description

0

1

PDU type

1

1

Reserved

2

4

PDU length

6

2

Protocol version

8

2

Reserved

10

16

Called AE title

26

16

Calling AE title

42

32

Reserved

74

Variable

Variable items

References

  • DICOM Standard, Part 8, Sections 9.3.2 and 9.3.1

__init__()[source]

Initialise a new A-ASSOCIATE-RQ PDU.

Methods

__init__()

Initialise a new A-ASSOCIATE-RQ PDU.

decode(bytestream)

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

encode()

Return the encoded PDU as bytes.

from_primitive(primitive)

Setup the current PDU using an A-ASSOCIATE (request) primitive.

to_primitive()

Return an A-ASSOCIATE (request) primitive from the current PDU.

Attributes

application_context_name

Return the Application Context Name, if available.

called_ae_title

Return the Called AE Title field value as bytes.

calling_ae_title

Return the Calling AE Title field value as bytes.

pdu_length

Return the PDU Length field value as int.

pdu_type

Return the PDU Type field value as int.

presentation_context

Return a list of the Presentation Context items.

user_information

Return the User Information Item, if available.

property application_context_name

Return the Application Context Name, if available.

Returns

The requestor’s Application Context Name or None if not available.

Return type

pydicom.uid.UID or None

property called_ae_title

Return the Called AE Title field value as bytes.

property calling_ae_title

Return the Calling AE Title field value as bytes.

from_primitive(primitive)[source]

Setup the current PDU using an A-ASSOCIATE (request) primitive.

Parameters

primitive (pdu_primitives.A_ASSOCIATE) – The primitive to use to set the current PDU field values.

property pdu_length

Return the PDU Length field value as int.

property presentation_context

Return a list of the Presentation Context items.

Returns

The Presentation Context items.

Return type

list of pdu_items.PresentationContextItemRQ

to_primitive()[source]

Return an A-ASSOCIATE (request) primitive from the current PDU.

Returns

The primitive representation of the current PDU.

Return type

pdu_primitives.A_ASSOCIATE

property user_information

Return the User Information Item, if available.

Returns

The requestor’s User Information object or None, if not available.

Return type

pdu_items.UserInformationItem or None