man storescp (Commandes) - DICOM storage (C-STORE) SCP
NAME
storescp - DICOM storage (C-STORE) SCP
SYNOPSIS
storescp [options] [port]
DESCRIPTION
The storescp application implements a Service Class Provider (SCP) for the Storage Service Class. It listens on a specific TCP/IP port for incoming association requests from a Storage SCU and can receive images according to the Storage Service Class. Received images will normally be stored in files (within the current working directory). The storescp application also supports the Verification Service Class as an SCP.
PARAMETERS
port tcp/ip port number to listen on. This parameter is required unless the --inetd option is specified.
OPTIONS
general options
-h --help print this help text and exit
--version print version information and exit
-v --verbose verbose mode, print processing details
-d --debug debug mode, print debug information
-od --output-directory [p]ath: string write output-files to (existing) directory p (default: .)
network options
association negotiation profile from configuration file:
-xf --config-file [f]ilename [p]rofile: string use profile p from config file f
preferred network transfer syntaxes (not with --config-file):
+x= --prefer-uncompr prefer explicit VR local byte order (default)
+xe --prefer-little prefer explicit VR little endian TS
+xb --prefer-big prefer explicit VR big endian TS
+xs --prefer-lossless prefer default JPEG lossless TS
+xy --prefer-jpeg8 prefer default JPEG lossy TS for 8 bit data
+xx --prefer-jpeg12 prefer default JPEG lossy TS for 12 bit data
+xv --prefer-j2k-lossless prefer JPEG 2000 lossless TS
+xw --prefer-j2k-lossy prefer JPEG 2000 lossy TS
+xr --prefer-rle prefer RLE lossless TS
+xd --prefer-deflated prefer deflated expl. VR little endian TS
+xi --implicit accept implicit VR little endian TS only
network host access control (tcp wrapper) options:
-ac --access-full accept connections from any host (default)
+ac --access-control enforce host access control rules
other network options:
-id --inetd run from inetd super server (this option is available only on Posix platforms)
-ta --acse-timeout [s]econds: integer (default: 30) timeout for ACSE messages
-td --dimse-timeout [s]econds: integer (default: unlimited) timeout for DIMSE messages
-aet --aetitle aetitle: string set my AE title (default: STORESCP)
-pdu --max-pdu [n]umber of bytes: integer [4096..131072] set max receive pdu to n bytes (default: 16384)
-dhl --disable-host-lookup disable hostname lookup
--refuse refuse association
--reject reject association if no implementation class UID
--ignore ignore store data, receive but do not store
--sleep-after [s]econds: integer sleep s seconds after store (default: 0)
--sleep-during [s]econds: integer sleep s seconds during store (default: 0)
--abort-after abort association after receipt of C-STORE-RQ (but before sending response)
--abort-during abort association during receipt of C-STORE-RQ
-pm --promiscuous promiscuous mode, accept unknown SOP classes (not with --config-file)
-up --uid-padding silently correct space-padded UIDs
output options
bit preserving mode:
-B --normal allow implicit format conversions (default)
+B --bit-preserving write data exactly as read (not with -ss)
output file format:
+F --write-file write file format (default)
-F --write-dataset write data set without file meta information
output transfer syntax (not with --bit-preserving or compressed transmission):
+t= --write-xfer-same write with same TS as input (default)
+te --write-xfer-little write with explicit VR little endian TS
+tb --write-xfer-big write with explicit VR big endian TS
+ti --write-xfer-implicit write with implicit VR little endian TS
+td --write-xfer-deflated write with deflated explicit VR little endian TS
post-1993 value representations (not with --bit-preserving):
+u --enable-new-vr enable support for new VRs (UN/UT) (default)
-u --disable-new-vr disable support for new VRs, convert to OB
group length encoding (not with --bit-preserving):
+g= --group-length-recalc recalculate group lengths if present (default)
+g --group-length-create always write with group length elements
-g --group-length-remove always write without group length elements
length encoding in sequences and items (not with --bit-preserving):
+e --length-explicit write with explicit lengths (default)
-e --length-undefined write with undefined lengths
data set trailing padding (not with --write-dataset or --bit-preserving):
-p --padding-off no padding (default)
+p --padding-create [f]ile-pad [i]tem-pad: integer align file on multiple of f bytes and items on multiple of i bytes
deflate compression level (not with --write-xfer-little/big/implicit):
+cl --compression-level compression level: 0-9 (default 6) 0=uncompressed, 1=fastest, 9=best compression
sorting into subdirectories (not with --bit-preserving):
-ss --sort-conc-studies [p]refix: string sort concerning studies into subdirectories that start with prefix p
filename generation:
-uf --default-filenames generate filename from instance UID (default)
+uf --unique-filenames generate unique filenames
-tn --timenames generate filename from creation time
-fe --filename-extension [e]xtension: string append e to all filenames
event options
-xcr --exec-on-reception [c]ommand: string execute command c after having received and processed one C-STORE-Request message
-xcs --exec-on-eostudy [c]ommand: string (only w/ -ss) execute command c after having received and processed all C-STORE-Request messages that belong to one study
-rns --rename-on-eostudy (only w/ -ss) having received and processed all C-STORE-Request messages that belong to one study, rename output files according to a certain pattern
-tos --eostudy-timeout [t]imeout: integer specifies a timeout of t seconds for end-of-study determination (only w/ -ss, -xcs or -rns)
-xs --exec-sync execute command synchronously in foreground. This option is available on Windows only.
transport layer security (TLS) options
transport protocol stack options:
-tls --disable-tls use normal TCP/IP connection (default)
+tls --enable-tls [p]rivate key file, [c]ertificate file: string use authenticated secure TLS connection
private key password options (only with --enable-tls):
+ps --std-passwd prompt user to type password on stdin (default)
+pw --use-passwd [p]assword: string use specified password
-pw --null-passwd use empty string as password
key and certificate file format options:
-pem --pem-keys read keys and certificates as PEM file (default)
-der --der-keys read keys and certificates as DER file
certification authority options:
+cf --add-cert-file [c]ertificate filename: string add certificate file to list of certificates
+cd --add-cert-dir [c]ertificate directory: string add certificates in d to list of certificates
ciphersuite options:
+cs --cipher [c]iphersuite name: string add ciphersuite to list of negotiated suites
+dp --dhparam [f]ilename: string read DH parameters for DH/DSS ciphersuites
pseudo random generator options:
+rs --seed [f]ilename: string seed random generator with contents of f
+ws --write-seed write back modified seed (only with --seed)
+wf --write-seed-file [f]ilename: string (only with --seed) write modified seed to file f
peer authentication options:
-rc --require-peer-cert verify peer certificate, fail if absent (default)
-vc --verify-peer-cert verify peer certificate if present
-ic --ignore-peer-cert don't verify peer certificate
NOTES
The semantic impacts of the above mentioned options is clear for the majority of options. Some particular options, however, are so specific that they need detailed descriptions which will be given in this passage.
Option --sort-conc-studies enables a user to sort all received DICOM objects into different subdirectories. The sorting will be done with regard to the studies the individual objects belong to, i.e. objects that belong to the same study will be stored in the same subdirectory. In general, a DICOM object d_n+1 is considered to belong to the same study as a DICOM object d_n if and only if d_n and d_n+1 show the exact same values in attribute Study Instance UID. The names of the resulting subdirectories always start with a prefix p which was passed to this option as a parameter. In addition to this prefix, the subdirectory names contain time stamp information with regard to the date and time of reception of this particular study's first DICOM object. In detail, the determination of the subdirectory names pertains to the pattern
[prefix]_[YYYYMMDD]_[HHMMSSPPP]
where YYYY refers to year (4 digits), MM to month (01-12), DD to day (01-31), HH to hour (00-23), MM to minute (00-59), SS to second (00-59) and PPP to milliseconds (000-999).
Option --timenames creates filenames from timestamps corresponding to the time, storescp writes a file to disk. The format is
[YYYYMMDDHHMMSSPPP]_[SERIALNO].[MD]
where YYYY, MM, DD, HH, MM, SS, PPP are interpreted as described above. If more files are created at the same time, SERIALNO is inserted. It consists of a 4-digit, consecutive number (0000 to 9999). For the first file, that exists for a specific time, no number (and no '_') is inserted at all. MD represents an identification code (2 letters) for the kind of object stored in the file (see notes on --rename-on-eostudy).
Option --filename-extension appends a specified suffix to each filename (a dot '.' is not added automatically). This suffix is not appended to the filenames created by --rename-on-eostudy to maintain the length of 8 characters.
Option --exec-on-reception allows to execute a certain command line after having received and processed one DICOM object (through a C-STORE-Request message). The command line to be executed is passed to this option as a parameter. The specified command line may contain a number of placeholders which will be replaced at run time:
- •
- #p: complete path to the output directory into which the last DICOM object was stored (not available with option --ignore though)
- •
- #f: filename of the current output file (not available with option --ignore though)
- •
- #a: calling application entity title of the peer Storage SCU
- •
- #c: called application entity title used by the peer Storage SCU to address storescp.
The specified command line is executed as a separate process, so that the execution of storescp will not be held back.
Option --exec-on-eostudy allows to execute a certain command line when all DICOM objects that belong to one study have been received by storescp. The same placeholders as with --exec-on-reception may be used, except for #f, which is not supported. A study is considered complete by storescp when an object belonging to a different study is received or the timeout specified with --eostudy-timeout takes place. If option --rename-on-eostudy is in force, the renaming takes place before the external command is executed.
Option --rename-on-eostudy refers to the above mentioned option --sort-conc-studies and can only be used in combination with this option. If a user specifies option --rename-on-eostudy and storescp determines that all DICOM objects that belong to a certain study have been received, all DICOM files that belong to the last study will be renamed in the corresponding output directory. The filenames into which the files are being renamed will be calculated using the pattern
[prefix][consecutive numbering]
where [prefix] is a 2 character prefix that reveals the kind of DICOM object stored in the file and [consecutive numbering] is a consecutively numbered, 6-digit number, starting at '000001'. In general, the question if all DICOM objects that belong to one study have been received by storescp will be answered positively if and only if two consecutively received DICOM objects d_n and d_n+1 do not show the same values in attribute Study Instance UID; in such a case, d_n+1 is considered to belong to a new study.
Using option --eostudy-timeout a user can modify the determination process to figure out if all DICOM objects that belong to one study have already been received by storescp. With regard to this fact, it is clear that this option can only be used in combination with at least one of the three options --sort-conc-studies, --exec-on-eostudy and --rename-on-eostudy. If option --eostudy-timeout is specified, the end of a study is considered to have occurred not only if two consecutively received DICOM objects d_n and d_n+1 do not show the same values in attribute Study Instance UID, but also if whithin a time span of x seconds after the reception of a DICOM object d_n, no other DICOM object was received over the network. Note that the amount x of seconds (which determines the length of this time span) has to be passed to this option as a parameter.
DICOM Conformance
The storescp application supports the following SOP Classes as an SCP:
VerificationSOPClass 1.2.840.10008.1.1
StoredPrintStorage 1.2.840.10008.5.1.1.27 HardcopyGrayscaleImageStorage 1.2.840.10008.5.1.1.29 HardcopyColorImageStorage 1.2.840.10008.5.1.1.30 ComputedRadiographyImageStorage 1.2.840.10008.5.1.4.1.1.1 DigitalXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.1.1 DigitalXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.1.1.1 DigitalMammographyXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.1.2 DigitalMammographyXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.1.2.1 DigitalIntraOralXRayImageStorageForPresentation 1.2.840.10008.5.1.4.1.1.1.3 DigitalIntraOralXRayImageStorageForProcessing 1.2.840.10008.5.1.4.1.1.1.3.1 StandaloneModalityLUTStorage 1.2.840.10008.5.1.4.1.1.10 EncapsulatedPDFStorage 1.2.840.10008.5.1.4.1.1.104.1 StandaloneVOILUTStorage 1.2.840.10008.5.1.4.1.1.11 GrayscaleSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.1 ColorSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.2 PseudoColorSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.3 BlendingSoftcopyPresentationStateStorage 1.2.840.10008.5.1.4.1.1.11.4 XRayAngiographicImageStorage 1.2.840.10008.5.1.4.1.1.12.1 EnhancedXAImageStorage 1.2.840.10008.5.1.4.1.1.12.1.1 XRayFluoroscopyImageStorage 1.2.840.10008.5.1.4.1.1.12.2 EnhancedXRFImageStorage 1.2.840.10008.5.1.4.1.1.12.2.1 RETIRED_XRayAngiographicBiPlaneImageStorage 1.2.840.10008.5.1.4.1.1.12.3 PETImageStorage 1.2.840.10008.5.1.4.1.1.128 PETCurveStorage 1.2.840.10008.5.1.4.1.1.129 CTImageStorage 1.2.840.10008.5.1.4.1.1.2 EnhancedCTImageStorage 1.2.840.10008.5.1.4.1.1.2.1 NuclearMedicineImageStorage 1.2.840.10008.5.1.4.1.1.20 RETIRED_UltrasoundMultiframeImageStorage 1.2.840.10008.5.1.4.1.1.3 UltrasoundMultiframeImageStorage 1.2.840.10008.5.1.4.1.1.3.1 MRImageStorage 1.2.840.10008.5.1.4.1.1.4 EnhancedMRImageStorage 1.2.840.10008.5.1.4.1.1.4.1 MRSpectroscopyStorage 1.2.840.10008.5.1.4.1.1.4.2 RTImageStorage 1.2.840.10008.5.1.4.1.1.481.1 RTDoseStorage 1.2.840.10008.5.1.4.1.1.481.2 RTStructureSetStorage 1.2.840.10008.5.1.4.1.1.481.3 RTBeamsTreatmentRecordStorage 1.2.840.10008.5.1.4.1.1.481.4 RTPlanStorage 1.2.840.10008.5.1.4.1.1.481.5 RTBrachyTreatmentRecordStorage 1.2.840.10008.5.1.4.1.1.481.6 RTTreatmentSummaryRecordStorage 1.2.840.10008.5.1.4.1.1.481.7 RETIRED_NuclearMedicineImageStorage 1.2.840.10008.5.1.4.1.1.5 RETIRED_UltrasoundImageStorage 1.2.840.10008.5.1.4.1.1.6 UltrasoundImageStorage 1.2.840.10008.5.1.4.1.1.6.1 RawDataStorage 1.2.840.10008.5.1.4.1.1.66 SpatialRegistrationStorage 1.2.840.10008.5.1.4.1.1.66.1 SpatialFiducialsStorage 1.2.840.10008.5.1.4.1.1.66.2 RealWorldValueMappingStorage 1.2.840.10008.5.1.4.1.1.67 SecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7 MultiframeSingleBitSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.1 MultiframeGrayscaleByteSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.2 MultiframeGrayscaleWordSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.3 MultiframeTrueColorSecondaryCaptureImageStorage 1.2.840.10008.5.1.4.1.1.7.4 RETIRED_VLImageStorage 1.2.840.10008.5.1.4.1.1.77.1 VLEndoscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.1 VideoEndoscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.1.1 VLMicroscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.2 VideoMicroscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.2.1 VLSlideCoordinatesMicroscopicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.3 VLPhotographicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.4 VideoPhotographicImageStorage 1.2.840.10008.5.1.4.1.1.77.1.4.1 OphthalmicPhotography8BitImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.1 OphthalmicPhotography16BitImageStorage 1.2.840.10008.5.1.4.1.1.77.1.5.2 StereometricRelationshipStorage 1.2.840.10008.5.1.4.1.1.77.1.5.3 RETIRED_VLMultiFrameImageStorage 1.2.840.10008.5.1.4.1.1.77.2 StandaloneOverlayStorage 1.2.840.10008.5.1.4.1.1.8 DRAFT_SRTextStorage 1.2.840.10008.5.1.4.1.1.88.1 DRAFT_SRAudioStorage 1.2.840.10008.5.1.4.1.1.88.2 DRAFT_SRDetailStorage 1.2.840.10008.5.1.4.1.1.88.3 DRAFT_SRComprehensiveStorage 1.2.840.10008.5.1.4.1.1.88.4 BasicTextSR 1.2.840.10008.5.1.4.1.1.88.11 EnhancedSR 1.2.840.10008.5.1.4.1.1.88.22 ComprehensiveSR 1.2.840.10008.5.1.4.1.1.88.33 ProcedureLogStorage 1.2.840.10008.5.1.4.1.1.88.40 MammographyCADSR 1.2.840.10008.5.1.4.1.1.88.50 KeyObjectSelectionDocument 1.2.840.10008.5.1.4.1.1.88.59 ChestCADSR 1.2.840.10008.5.1.4.1.1.88.65 XRayRadiationDoseSR 1.2.840.10008.5.1.4.1.1.88.67 StandaloneCurveStorage 1.2.840.10008.5.1.4.1.1.9 DRAFT_WaveformStorage 1.2.840.10008.5.1.4.1.1.9.1 TwelveLeadECGWaveformStorage 1.2.840.10008.5.1.4.1.1.9.1.1 GeneralECGWaveformStorage 1.2.840.10008.5.1.4.1.1.9.1.2 AmbulatoryECGWaveformStorage 1.2.840.10008.5.1.4.1.1.9.1.3 HemodynamicWaveformStorage 1.2.840.10008.5.1.4.1.1.9.2.1 CardiacElectrophysiologyWaveformStorage 1.2.840.10008.5.1.4.1.1.9.3.1 BasicVoiceAudioWaveformStorage 1.2.840.10008.5.1.4.1.1.9.4.1
The storescp application will accept presentation contexts for all of the abovementioned supported SOP Classes using any of the transfer syntaxes:
LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2
The default behaviour of the storescp application is to prefer transfer syntaxes having an explicit encoding over the default implicit transfer syntax. If storescp is running on big-endian hardware it will prefer BigEndianExplicit transfer syntax to LittleEndianExplicitTransferSyntax (and vice versa). This behaviour can be changed with the --prefer options (see above).
The storescp application does not support extended negotiation.
Access Control
When compiled on Unix platforms with TCP wrapper support, host-based access control can be enabled with the --access-control command line option. In this case the access control rules defined in the system's host access control tables for storescp are enforced. The default locations of the host access control tables are /etc/hosts.allow and /etc/hosts.deny. Further details are described in hosts_access(5).
Running storescp from inetd
On Posix platforms, storescp can be initiated through the inetd(8) super server. This requires that storescp be configured in the /etc/inetd.conf configuration file. A typical configuration line could look like this:
acr-nema stream tcp nowait root /usr/sbin/storescp -id +ac -od /tmp/storescp
where -id (--inetd) activates the inetd mode in which the DICOM association is actually accepted by inetd and passed to storescp, +ac (--access-control) activates the TCP wrapper based access control described above and -od (--output-directory) defines the directory in which storescp stores incoming DICOM objects. Note that the service name ('acr-nema' in this example) determines the port number on which DICOM associations are accepted and must be defined in /etc/services. When runnning from inetd, the stdout and stderr streams are redirected to files in the /tmp filesystem which can be identified by the filename starting with the prefix 'storescp_'.
Please note that when run through inetd, storescp is executed with root privileges, which may be a security risk.
Association Negotiation Profiles and Configuration Files
storescp supports a flexible mechanism for specifying the DICOM network association negotiation behaviour, based on so-called 'association negotiation profiles' which may be read from a configuration file. The format and semantics of this configuration file are documented in asconfig.txt.
COMMAND LINE
All command line tools use the following notation for parameters: square brackets enclose optional values (0-1), three trailing dots indicate that multiple values are allowed (1-n), a combination of both means 0 to n values.
Command line options are distinguished from parameters by a leading '+' or '-' sign, respectively. Usually, order and position of command line options are arbitrary (i.e. they can appear anywhere). However, if options are mutually exclusive the rightmost appearance is used. This behaviour conforms to the standard evaluation rules of common Unix shells.
In addition, one or more command files can be specified using an '@' sign as a prefix to the filename (e.g. @command.txt). Such a command argument is replaced by the content of the corresponding text file (multiple whitespaces are treated as a single separator) prior to any further evaluation. Please note that a command file cannot contain another command file. This simple but effective approach allows to summarize common combinations of options/parameters and avoids longish and confusing command lines (an example is provided in file share/data/dumppat.txt).
ENVIRONMENT
The storescp utility will attempt to load DICOM data dictionaries specified in the DCMDICTPATH environment variable. By default, i.e. if the DCMDICTPATH environment variable is not set, the file <PREFIX>/lib/dicom.dic will be loaded unless the dictionary is built into the application (default for Windows).
The default behaviour should be preferred and the DCMDICTPATH environment variable only used when alternative data dictionaries are required. The DCMDICTPATH environment variable has the same format as the Unix shell PATH variable in that a colon (':') separates entries. The data dictionary code will attempt to load each file specified in the DCMDICTPATH environment variable. It is an error if no data dictionary can be loaded.
FILES
share/doc/asconfig.txt - configuration file documentation
etc/storescp.cfg - example association negotiation profile
SEE ALSO
COPYRIGHT
Copyright (C) 1994-2005 by Kuratorium OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.