Contexts and the Association Acceptor#
When acting as the association acceptor (usually the SCP), you should define which presentation contexts will be supported. Unlike the requestor you can define an unlimited number of supported presentation contexts.
In pynetdicom this is accomplished through one of the following methods:
Setting the
AE.supported_contexts
attribute directly using a list ofPresentationContext
items.from pynetdicom import AE, build_context from pynetdicom.sop_class import Verification ae = AE() ae.supported_contexts = [build_context(Verification)] ae.start_server(("127.0.0.1", 11112))
Using the
AE.add_supported_context()
method to add a newPresentationContext
to theAE.supported_contexts
attribute.from pynetdicom import AE from pynetdicom.sop_class import Verification ae = AE() ae.add_supported_context(Verification) ae.start_server(("127.0.0.1", 11112))
Supplying a list of
PresentationContext
items toAE.start_server()
via the contexts keyword parameterfrom pynetdicom import AE, build_context from pynetdicom.sop_class import Verification ae = AE() supported = [build_context(Verification)] ae.start_server(("127.0.0.1", 11112), contexts=supported)
The abstract syntaxes you support should correspond to the service classes that are being offered. For example, if you offer the Storage Service then you should support one or more of the Storage Service’s corresponding SOP Classes.
The transfer syntaxes for each abstract syntax should match the data encoding you support.
Note
In general, pynetdicom is able to support any transfer syntax when acting as an SCP.