Configuring the DICOM C-STORE SCP Receiver

Starting with version 1.5, XNAT includes an integrated DICOM C-STORE Service Class Provider (SCP). What does that mean?  

C-STORE is a protocol by which DICOM data objects are sent from one application (the Service Class User, or SCU) to another (the Service Class Provider, or SCP) to be stored. The XNAT C-STORE SCP not only stores DICOM objects, but also translates DICOM metadata into an XNAT session document.  The XNAT DICOM C-STORE SCP can receive data from any DICOM C-STORE SCU, including scanners or DICOM viewers such as OsiriX or DicomBrowser.

Any DICOM service is a transaction between two applications: an SCU that initiates the request and an SCP that responds. Each application is identified by the IP address of its host, the TCP port number used for the connection, and a DICOM Application Entity (AE) title, a string that names the application.

The XNAT DICOM C-STORE SCP supports multiple AEs per XNAT. Each AE has its own AE title and its own rules for determining the project, subject, and session of received objects. Multiple AEs can be used in a variety of ways to make it easier to route incoming data to the correct project.

Out-of-the-box configuration

It's done through a Spring config file, dicom-import-context.xml.  

Configuration with port remapping

The well-known TCP port number for DICOM is 104, which is a privleged port on UNIX systems. Some sites therefore run the server on an unprivileged port (e.g., 8104), then use a reverse proxy server or other port mapping technique so that clients access the service at port 104.  By default, the XNAT SCP listens on port 8104.

The procedure to set up port remapping depends on your system configuration and what tools you will use to perform the remapping. The following commands, when run as root on a system with iptables (e.g., Linux or Solaris), will set up forwarding from port 104 to port 8104.

root@myhost$ /sbin/iptables -A FORWARD -p tcp --destination-port 104 -j ACCEPT
root@myhost$ /sbin/iptables -t nat -A PREROUTING -j REDIRECT -p tcp --destination-port 104 --to-port 8104
root@myhost$ /sbin/service iptables save

Configuration with a reverse proxy server

Set up the proxy according to the instructions for your system, and configure the server's listening port in dicom-import-context.xml.

Viewing the configuration

Administrators (1.6.1+)

The Configuration screen has a "DICOM Receiver" tab that displays the current configuration:


The configuration can also be viewed via the image upload screen (click the "other ways" link):

Enabling/disabling the receiver (1.6.1+)

Changes via either method are effective immediately and are persistent across a Tomcat restart. Before disabling the receiver, verify that there are no transmissions currently in progress.

To enable/disable the receiver transiently (w/o persisting the configuration setting), use this REST call.

via the Configuration screen

Just set the checkbox appropriately (see above screenshot).

via the REST API

PUT /data/services/settings/enableDicomReceiver/[true|false]

Assigning received data to a project

Here are the default mapping rules that XNAT uses.