Skip to content

1. px echo

Rudolph Pienaar edited this page Sep 27, 2019 · 5 revisions

px-echo

Overview

px-echo is a wrapper around dcmtk echoscu.

px-echo sends a DICOM C-ECHO message to a Service Class Provider (SCP) and waits 
for a response. The application can be used to verify basic DICOM connectivity.
-- DCMTK, about echoscu.

Help

px-echo --desc

Synopsis

           px-echo                                                  \
                [--aet <AETitle>]                                   \
                [--aec <CalledAETitle>]                             \
                [--serverIP <PACSserverIP>]                         \
                [--serverPort <PACSserverPort>]                     \
                [--echoscu <echoscuAbsolutePath>]                   \
                [-x|--desc]                                         \
                [-y|--synopsis]                                     \
                [--version]                                         \
                [--debugToDir <dir>]                                \
                [--verbosity <level>]

Args

        [--aet <AETitle>]
        The AETitle of *this* entity.

        [--aec <CalledAETitle>]                             
        The called AETitle of *this* entity. Needed for some PACS systems.

        [--serverIP <PACSserverIP>]
        The IP of the PACS server.

        [--serverPort <PACSserverPort>]                     
        The port associated with the PACS server.

        [--echoscu <echoscuAbsolutePath>]                
        The absolute location of the 'movescu' executable.
        
        [-x|--desc]                                     
        Provide an overview help page.

        [-y|--synopsis]
        Provide a synopsis help summary.

        [--version]
        Print internal version number and exit.

        [--debugToDir <dir>]
        A directory to contain various debugging output -- these are typically
        JSON object strings capturing internal state. If empty string (default)
        then no debugging outputs are captured/generated. If specified, then
        ``pfcon`` will check for dir existence and attempt to create if
        needed.

        [-v|--verbosity <level>]
        Set the verbosity level. "0" typically means no/minimal output. Allows for
        more fine tuned output control as opposed to '--quiet' that effectively
        silences everything.

CLI use

Directly on the metal

    px-echo                                                     \
        --aet CHIPS                                             \
        --aec ORTHANC                                           \
        --serverIP 127.0.0.1                                    \
        --serverPort 104

Dockerized container

    docker run  --rm -ti                                        \
        -p 10402:10402                                          \
        -v /tmp:/dicom                                          \
        local/pypx                                              \
        --px-echo                                               \
        --aet CHIPS                                             \
        --aec ORTHANC                                           \
        --serverIP  10.72.76.155                                \
        --serverPort 4242

Return

{
  "status": "success",
  "data": [
    "I: Requesting Association",
    "I: Association Accepted (Max Send PDV: 16372)",
    "I: Sending Echo Request (MsgID 1)",
    "I: Received Echo Response (Success)",
    "I: Releasing Association"
  ],
  "command": "/usr/bin/echoscu  --timeout 5 -v   -aec ORTHANC -aet CHIPS 10.72.76.155 4242",
  "returncode": 0
}

Python module syntax

px-echo module

   # in yourscript.py
   import pypx

   pacs_settings = {
     'executable': '/usr/bin/echoscu',
     'aec':        'ORTHANC',
     'aet':        'CHIPS',
     'serverIP':   '127.0.0.1',
     'serverPort': '4242',
   }

   output = pypx.echo(pacs_settings)
   print(output)

-30-