DicomObjects Reference
DicomObjects Reference / DicomContexts Collection
Members
In This Topic
    DicomContexts Collection
    In This Topic
    Description

    A DicomContexts collection consists of DicomContext objects, and represents the set of DICOM presentation contexts offered or accepted for an association negotiation.

    Most applications will not need to use this collection, as appropriate defaults are provided in most circumstances, and even these may be modified via registry entries, but this collection may prove useful where it is necessary to use different presentation contexts (giving different transfer syntaxes) for different remote entities, such as in teleradiology.  When used on incoming connections, it can also be very useful for debugging purposes.

    Remarks

    This collection is used in three very different scenarios:

    • To define the presentation contexts to be offered on an outgoing association.  This is achieved by adding DicomContext items to the initially empty Contexts collection of a new DicomConnection object, prior to calling SetDestination.
    • To Select the presentation contexts to be accepted on an incoming association.  This can only be done within the AssociationRequest event, and the appropriate changes (using AcceptedTS or Reject) must be made using the Contexts parameter.
    • To check the presentation contexts available on an association, and, where possible, to select which to use.  This is achieved using the Contexts property of an incoming or outgoing DicomConnection, and although the contexts may not be altered, the information contained may be used to set the DicomConnection’s PreferredTS and PreferredPCID properties.

    For the first two uses above, appropriate defaults exist, based on the registry.
    For outgoing contexts the following rules apply:

    • If any DicomContext items are added to the DicomConnection’s Contexts collection, then the client application assumes full responsibility for the presentation contexts, and the following steps are not performed.
    • The list of abstract syntaxes is as found as a space separated list in the AbstractSyntax registry entry.
    • Each is offered with a list of transfer syntaxes, determined as follows:
      • If a registry value TransferSyntax/<TransferSyntaxUID> exists, then that space separated list is used.
      • Otherwise, the TransferSyntax key’s default value is used.
      • In either of the above cases, if a transfer syntax UID in the list is immediately preceded by an asterisk, then that transfer syntax is offered in its own presentation context, potentially allowing later transfer context selection.

    For acceptance of incoming contexts the following rules apply:

    • If any proposed context is neither rejected, nor specifically accepted (by setting the AcceptedTS property, then the if a registry value TransferSyntax/<TransferSyntaxUID> exists, the first value in the list, which is also in the proposed list is accepted.  As above, if the specific value does not exist, then the TransferSyntax key’s default value is used, and the same rule applies.
    • The AbstractSyntax list is not checked, and by default, all incoming syntaxes are accepted, but is desired, this may be altered for a particular syntax by setting the TransferSyntax/<TransferSyntaxUID> value to a null string.

    Like all other collections in DicomObjects, this collection supports the “NewEnum” method, allowing use of the “for each” construct in Visual Basic to iterate through the members. There is no Count property, however, as the iterator Item(n), uses the presentation context ID as the index, such that the highest value is not the same as number of items.   Instead, where direct iteration is not possible, take the index from 1 to 255 (in increments of 2), and for each possible index, check the Exists property.

    See Also