GithubHelp home page GithubHelp logo

aravindhp / pypx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fnndsc/pypx

0.0 2.0 0.0 155 KB

Python wrapper to interact with a PACS (based off DCMTK and PyDicom)

Python 85.87% Dockerfile 3.81% Shell 10.32%

pypx's Introduction

pypx - 1.1.2.0

https://travis-ci.org/FNNDSC/pypx.svg?branch=master

pypx is a complete client-side PACS (Picture Archive and Communications System) Query/Retrieve/Storage solution that operates in stand-alone script mode in addition to providing a set of python modules for use in other packages. The modules/API provide a simple mechanism for a python program to interact with an appropriately configured remote PACS, while the stand alone scripts offer a convenient ability to directly Query/Retrieve/Storge images from the command line.

pypx was mostly developed for use in the ChRIS system as part of the pfdcm microservice; however the CLI scripts of pypx and the provided docker image offer a quick and powerful means of accessing a PACS without any additional overhead.

This solution is client-side and cannot operate fully independently of an appropriately configured PACS. Having said that, in the dockerized mode (either by building a local container or using the container provided on dockerhub (fnndsc/pypx) all the necessary infrastructure is provided to listen for and store incoming image data. Some minor post configuration might however be required.

A PACS exists as a separate service on a network, and pypx communicates with a pre-configured PACS when asking for Query data and when Retrieving images. Importantly, from the client perspective, data is PUSHED from the PACS, and not PULLED from the client. This means that client software in essence "asks" the PACS for images and the PACS obliges by transmitting the images over the network to a pre-configured location.

Communications with a PACS are for the most insecure and reflected a circa 1990s view/model of internetworking. When a client communicates with a PACS, it sends along with every request string identifiers unique to the client and configured in the PACS. Typical identifiers are the AETitle and sometimes additionally the CalledAETitle. The PACS examines these strings on receipt to identify/authenticate the client and also to identify a destination network IP:port to which data can be transmitted.

In order to be fully complete, a destination PACS with which pypx modules wish to communicate needs to be configured with appropriate AETitle, CalledAETitle, as well as the network address IP and port of the pypx hosting machine. Configuring a PACS is obviously outside of the scope of this documentation. Consult your PACS for information on this configuration.

Locally, however, some configuration is required and conveniently located in the script PACS_QR.sh. In the

function institution_set
{
    ...
}

simply add another block reflecting the variables appropriate to your remote PACS service.

Internally, the code wraps around DCMTK utilies as well as the PyDicom module. The following modules/scripts are provided:

  • px-echo: Ping the PACS to make sure it is online (echoscu).
  • px-find: Find data on the PACS (findscu).
  • px-move: Move data from the PACS (movescu).
  • px-listen: Listen for incoming data from the PACS (storescp).

Using the dockerized container is the recommended installation vector as the image contains a configured listener service that can receive image data without any additional software on the host system.

docker pull fnndsc/pypx

Alternatively, you can build a local image with

# If behing a proxy
PROXY=http://some.proxy.com
docker build --build-arg http_proxy=${PROXY} --build-arg UID=$UID -t local/pypx .

# otherwise...
docker build --build-arg UID=$UID -t local/pypx .

For convenience, a PyPI installation is also available. Note that to be useful for image reception, services on the host machine for listening on a given port and interacting with px-listen must be manually configured. This is recommended only for advanced users.

apt-get update                                   \
&& apt-get install -y dcmtk                      \
&& apt-get install -y python3-pip python3-dev    \
&& pip3 install --upgrade pip                    \
&& pip install pypx

The container is preconfigured to receive image data on port 10402. This port should be accessible to the remote PACS, and note that if the docker container is run directly with the docker command be sure to publish this port with

docker run  --rm -ti                        \
        -p 10402:10402                      \
        ...

If necessary, this port can be changed in the Dockerfile for a local build of the container.

Please see the relevant wiki pages for usage instructions:

PyDicom

DCMTK

  • Author(s): Dicom @ OFFIS Team

pypx's People

Contributors

rudolphpienaar avatar nicolasrannou avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.