Skip to Content
go-dicom(3)
Command line

storescp

Runs a DICOM Storage SCP: it accepts C-STORE requests and writes each instance it receives to a directory as <SOP Instance UID>.dcm, until it is stopped.

When to use it

Use storescp as the destination of a modality, a PACS export, a C-MOVE, or a test of storescu. It accepts every storage SOP class, and compressed transfer syntaxes as well as the uncompressed ones, and stores what it is sent without decoding it. It also answers C-ECHO.

It keeps no index and answers no query. For a server that stores and then answers C-FIND, C-MOVE, C-GET and DICOMweb, use qrscp.

The closest tools are dcmtk's storescp and pynetdicom's python -m pynetdicom storescp.

Examples

Receive into a directory

go-dicom storescp -port 11112 -output received -allow 127.0.0.1,::1
Starting DICOM Store SCP
  AE Title: STORESCP
  Port:     11112
  Output:   received
  Allow:    addresses 127.0.0.1/32, ::1/128
Listening for associations... (Ctrl+C to stop)
Received: 1.3.6.1.4.1.5962.1.1.1.1.1.20040119072730.12322 (SOP Class: 1.2.840.10008.5.1.4.1.1.2) -> received/1.3.6.1.4.1.5962.1.1.1.1.1.20040119072730.12322.dcm
Received: 1.3.6.1.4.1.5962.1.1.4.1.1.20040826185059.5457 (SOP Class: 1.2.840.10008.5.1.4.1.1.4) -> received/1.3.6.1.4.1.5962.1.1.4.1.1.20040826185059.5457.dcm

-allow here admits callers from this machine only (see below). Senders must call it by its AE title, STORESCP unless -aet sets another. The output directory is made if it is not there (default: the current directory).

Admit only known callers

go-dicom storescp -port 11112 -output received -allow CT01@10.0.0.5
…
Refused "STORESCU" from 10.0.0.5:50253: the calling AE title is not on -allow
Received: 1.3.6.1.4.1.5962.1.1.1.1.1.20040119072730.12322 (SOP Class: 1.2.840.10008.5.1.4.1.1.2) -> …

-allow takes calling AE titles, IP addresses, CIDR ranges and TITLE@ADDRESS, comma separated and repeatable; -allow-file reads them from a file, one to a line, # for comments. Any other caller is refused before anything is negotiated: an unknown title with reason 3 (calling AE title not recognized), an unknown address with no reason given. A host name is not resolved; it is read as an AE title.

Tip

Without -allow every caller is admitted. On a network you do not fully control, list the modalities by TITLE@ADDRESS.

TLS only

go-dicom storescp -port 2762 -output received -tls -tls-cert node.crt -tls-key node.key -tls-ca ca.crt

With -tls, -tls-cert and -tls-key are required; -tls-ca requires clients to present a certificate issued by one of its CAs.

Log what arrives, as data

go-dicom storescp -port 11112 -output received -events received.jsonl

-events appends every PDU, association event and DIMSE message as JSON lines, including a record of each file stored; see Events.

Notes

  • Files are named by the SOP Instance UID the sender gives, which is checked before it becomes a path; an instance with an unusable UID is answered with a failure status and not written. An instance received twice is written over.
  • The server listens on every interface of the machine, on -port (default 11112), and runs until interrupted (Ctrl+C or SIGTERM).
  • See CONFORMANCE.md, SOP classes supported as SCP and Security and enforced limits.

See also

Options

On this page