Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Interface changes for AE #179

Merged
merged 18 commits into from
Jul 16, 2018
Merged

Conversation

scaramallion
Copy link
Member

@scaramallion scaramallion commented Jun 16, 2018

Description

Update the AE interface to make it more flexible with respect to requesting/supporting presentation contexts

SCU

SCP

SCU/SCP

  • Allow easier management of presentation context transfer syntaxes (AE should only have a single sop_class_list used to build Presentation Context for Assoc #73)
  • Add generic presentation contexts by supported service class:
    • VerificationPresentationContexts
    • StoragePresentationContexts
    • QueryRetrievePresentationContexts
    • BasicWorklistManagementPresentationContexts
  • Remove existing SOP Class lists:
    • VerificationSOPClass
    • StorageSOPClassList
    • QueryRetrieveSOPClassList
  • Simplify initialisation for AE
    • Remove scu_sop_class and scp_sop_class arguments
    • Remove transfer_syntax argument
    • Remove bind_addr argument
  • Remove AE properties:
    • AE.scp_supported_sop and AE.scu_supported_sop
    • AE.transfer_syntax
    • AE.presentation_contexts_scu and AE.presentation_contexts_scp
  • Add ability to set the AE's Implementation Version Name and Implementation Class UID through AE.implementation_version_name and AE.implementation_class_uid properties.
  • Change module file from applicationentity.py to ae.py

Examples

SCU

Multi-association presentation context requests

from pynetdicom3 import AE, StoragePresentationContexts

ae = AE(ae_title=b'MYAE')
ae.implementation_version_name = b'PYNETDICOM'
ae.implementation_class_uid = '1.2.3.4.5.6'
ae.requested_contexts = StoragePresentationContexts
assoc = ae.associate('127.0.0.1', 104)
if assoc.is_established:
    assoc.release()

Per-association presentation context requests

from pynetdicom3 import AE, StoragePresentationContexts

ae = AE(ae_title=b'MYAE')
assoc = ae.associate('127.0.0.1', 104, contexts=StoragePresentationContexts)
if assoc.is_established:
    assoc.release()

Add specific presentation contexts (will check for duplication/validity)

from pynetdicom3 import AE

ae = AE(ae_title=b'MYAE')
# add_requested_context(abstract_syntax, transfer_syntax=DEFAULT_TRANSFER_SYNTAX)
ae.add_requested_context('1.2.840.10008.1.1', transfer_syntax=['1.2.840.10008.1.2'])
ae.add_requested_context('1.2.840.10008.1.1', transfer_syntax=['1.2.840.10008.1.2.1'])

Remove presentation context

from pynetdicom3 import AE, StoragePresentationContexts
from pynetdicom3.sop_class import CTImageStorage

ae = AE(ae_title=b'MYAE')
ae.requested_contexts = StoragePresentationContexts
# No longer requests CTImageStorage with Implicit VR Little Endian
# but other default transfer syntaxes are still requested
ae.remove_requested_context(CTImageStorage, ['1.2.840.10008.1.2'])

SCP

Supported presentation context

from pynetdicom3 import AE, StoragePresentationContexts
from pynetdicom3.sop_class import VerificationSOPClass

ae = AE(ae_title=b'MYAE', port=104)
ae.supported_contexts = StoragePresentationContexts
ae.add_supported_context(VerificationSOPClass)
assoc.start()

Remove supported presentation context

from pynetdicom3 import AE, StoragePresentationContexts
from pynetdicom3.sop_class import CTImageStorage

ae = AE(ae_title=b'MYAE', port=104)
ae.supported_contexts = StoragePresentationContexts
# Completely removes support for CTImageStorage and all associated transfer syntaxes
ae.remove_supported_context(CTImageStorage)
assoc.start()

Tasks

  • Unit tests added that reproduce issue or prove feature is working
  • Fix or feature added
  • Documentation updated (if relevant)
  • Unit tests passing after adding fix/feature
  • Apps updated and tested (if relevant)

@scaramallion scaramallion changed the title [WIP] Interface changes for AE [MRG] Interface changes for AE Jul 16, 2018
@scaramallion scaramallion merged commit 0da1d6c into pydicom:master Jul 16, 2018
@scaramallion scaramallion deleted the dev-interface branch July 16, 2018 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant