3.0 pfdcm controlling the listener service - FNNDSC/pfdcm GitHub Wiki
This page describes how to use pfdcm to control a DICOM listener service. This service is managed by xinetd, which manages a listener that intercepts communication sent from a remote PACS host. In the context of this system, the listener is a separate python app called px-listen.
-
xinetdon the system runningpfdcm-- be it a container or "on the metal". -
If "on the metal" make sure to also:
- Install
pypxas per your host system. Usingpip3:pip3 install pypx
- Install the
pypxsource repo:git clone https://github.com/FNNDSC/pypx.git
- Make sure the listener is linked to its proper location:
cd pypx/bin sudo ln -s $(pwd)/px-listen /usr/local/bin
- Install
-
A HOST_IP environment variable that denotes the IP of the host housing the service. In Linux, you can do:
export HOST_IP=$(ip route | grep -v docker | awk '{if(NF==11) print $9}')- Make sure that
pfdcmhas been started (see here for more info)
pfcon --forever --httpResponse-
Have the following information pertaining to the remote PACS server:
- IP
- port
- AETITLE
- CALLED AETITLE
-
Set the internal values specifying the remote PACS host according to here.
On first run, it is necessary to create the service file and associated directories. This assumes the ability to run as root (or passwordless sudo).
First, create the listener service file:
./pfurl --verb POST \
--raw \
--http ${HOST_IP}:4055/api/v1/cmd \
--jsonwrapper 'payload' \
--msg '{
"action": "xinetd",
"meta": {
"object" : "file",
"do": "create"
}
}'make the listener service directories:
./pfurl --verb POST \
--raw \
--http ${HOST_IP}:4055/api/v1/cmd \
--jsonwrapper 'payload' \
--msg '{
"action": "xinetd",
"meta": {
"object" : "service",
"do": "mkdirs"
}
}'and install the listener service file in the correct place
./pfurl --verb POST \
--raw \
--http ${HOST_IP}:4055/api/v1/cmd \
--jsonwrapper 'payload' \
--msg '{
"action": "xinetd",
"meta": {
"object" : "file",
"do": "install"
}
}'Once the listener service file and directories exist, we can restart (or start) xinetd to service any incoming DICOM data transmissions:
./pfurl --verb POST \
--raw \
--http ${HOST_IP}:4055/api/v1/cmd \
--jsonwrapper 'payload' \
--msg '{
"action": "xinetd",
"meta": {
"object" : "service",
"do": "restart"
}
}'A convenience flag is available to pfdcm that performs these steps at startup, and is useful for containerization:
pfdcm --forever --httpResponse --startlistenerOr, effect the same outcome by calling
./pfurl --verb POST \
--raw \
--http ${HOST_IP}:4055/api/v1/cmd \
--jsonwrapper 'payload' \
--msg '{
"action": "xinetd",
"meta": {
"object" : "service",
"do": "everything"
}
}'--30--