A lightweight, cross-platform, blazingly fast implementation of the C-ECHO1 DICOM procedure. ๐ฅ
This package implements a service class user (SCU)2 app which functions like a ping, testing that the peer service class provider (SCP)2 is accepting associations for the given AE titles3.
Both a simple CLI and a Python API are provided for easy integration with your DICOM projects.
pipx is recommended to install dicom-echo as a standalone CLI utility:
pipx install dicom-echo
# or if integrating with another Python project:
pip3 install dicom-echoTo send a C-ECHO request to localhost:11111:
โฏ dicom-echo localhost:11111
โ
Success
โฏ dicom-echo --help Usage: dicom-echo [OPTIONS] HOST
Send a `C-ECHO` request to the given address.
The `C-ECHO` procedure functions like a `ping`, serving to test that the peer SCP is
accepting associations.
This command will fail if the peer SCP is unreachable or rejects the association request
for the given AE titles.
Reference: https://www.dicomstandard.org/standards/view/message-exchange#sect_9.1.5
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ * host TEXT The socket address of the peer SCP: {host}:{port} โ
โ Optionally, the AE title may be included: {AE title}@{host}:{port} โ
โ [required] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --version -V display the version of this program โ
โ --install-completion Install completion for the current shell. โ
โ --show-completion Show completion for the current shell, to copy it or โ
โ customize the installation. โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ DICOM Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --called,--called-ae-title -aec TEXT peer AE title of the host SCP โ
โ [default: ANY-SCP] โ
โ --calling,--calling-ae-title -aet TEXT the AE title of this client โ
โ [default: ECHOSCU] โ
โ --id,--message-id -id INTEGER the message ID to send [default: 1] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
The dicom_echo module provides a simple API for sending C-ECHO requests:
>>> import dicom_echo as echo
>>> echo.send(address)
0See the API documentation for more details.
Footnotes
-
for additional details, see 9.3.5
C-ECHOprotocol | DICOM PS3.7 2024c - Message Exchange โฉ -
6.7 Service Class Specification | DICOM PS3.4 2024c - Service Class Specifications for the definitions of service class user (SCU) and service class provider (SCP):
โฉ โฉ2The SCU or user agent acts as the 'client,' while the SCP or origin server acts as the 'server'. For DIMSE based services the SCU/SCP roles are determined during Association establishment
-
โฉA DICOM Application Entity Title uniquely identifies a service or application on a specific system in the network.