dcmrecv(1)
β¨ NAME β¨
okay bestie, this is dcmrecv(1) from OFFIS DCMTK β the manual page for dcmrecv, aka the Simple DICOM storage SCP (receiver). Sheβs here to catch DICOM datasets and make it look easy π
β¨
πΈ SYNOPSIS πΈ
dcmrecv [options] port
π¦ DESCRIPTION π¦
So hereβs the tea: the dcmrecv application implements a Service Class Provider (SCP) for the Storage Service Class. In contrast to the well-known storescp utility, dcmrecv has less options and might, therefore, be easier to use β this also explains the term "simple" in the title. No cap, itβs giving low-key but iconic π
Her main purpose is to receive a whole bunch of DICOM datasets from a Storage Service Class User (SCU) and store them to a configurable directory and file structure. Main character energy, honestly π«Ά
π PARAMETERS π
portβ tcp/ip port number to listen on πβ¨
π OPTIONS π
π§Έ general options π§Έ
-h,--helpβ print this help text and exit π«Ά--versionβ print version information and exit β--argumentsβ print expanded command line arguments π§-q,--quietβ quiet mode, print no warnings and errors π€«-v,--verboseβ verbose mode, print processing details π-d,--debugβ debug mode, print debug information π-ll,--log-levelβ use *l*evel for the logger; *l*evel is a string constant:fatal,error,warn,info,debug,traceπͺ΅-lc,--log-configβ use config file f for the logger; takes[f]ilename: stringπ+v,--verbose-pcβ show presentation contexts in verbose mode π-ll,--log-levelβ use level l for the logger;<yellow>[l]evel: string constant</yellow>is one offatal,error,warn,info,debug,traceπͺ΅-lc,--log-configβ use config file f for the logger; takes<yellow>[f]ilename: string</yellow>π+v,--verbose-pcβ show presentation contexts in verbose mode π
bestie, the general-options list above is exactly the original list β-ll,-lc, and+vare included once each, no dupes, periodt π
π‘ network options π‘
π IP protocol version π
-i4,--ipv4β use IPv4 only (default) π’-i6,--ipv6β use IPv6 only π΅-i0,--ip-autoβ use IPv6/IPv4 dual stack π
ποΈ association negotiation profile from configuration file ποΈ
-xf,--config-fileβ use profile p from configuration file f; takes[f]ilename, [p]rofile: stringπ
πͺͺ application entity title πͺͺ
-uca,--use-called-aetitleβ always respond with called AE title (default) π-aet,--aetitleβ set my AE title and check called AE title; takes[a]etitle: stringπ·οΈ
π other network options π
-ta,--acse-timeoutβ timeout for ACSE messages; takes[s]econds: integer, default30β³-td,--dimse-timeoutβ timeout for DIMSE messages; takes[s]econds: integer, default unlimited βΎοΈ-pdu,--max-pduβ set max receive pdu to n bytes; takes[n]umber of bytes: integer (4096..131072), default16384π¦-dhl,--disable-host-lookupβ disable hostname lookup π
π transport layer security (TLS) options π
π§± transport protocol stack π§±
-tls,--disable-tlsβ use normal TCP/IP connection (default) π+tls,--enable-tlsβ use authenticated secure TLS connection; takes[p]rivate key file, [c]ertificate file: stringπ
π private key password (only with --enable-tls) π
+ps,--std-passwdβ prompt user to type password on stdin (default) β¨οΈ+pw,--use-passwdβ use specified password; takes[p]assword: stringποΈ-pw,--null-passwdβ use empty string as password π«₯
π key and certificate file format π
-pem,--pem-keysβ read keys and certificates as PEM file (default) πΈ-der,--der-keysβ read keys and certificates as DER file π§¬
π‘οΈ certification authority π‘οΈ
+cf,--add-cert-fileβ add certificate file to list of certificates; takes[f]ilename: stringπ+cd,--add-cert-dirβ add certificates in d to list of certificates; takes[d]irectory: stringπ+crl,--add-crl-fileβ add certificate revocation list file; takes[f]ilename: string; implies--enable-crl-vfyβ οΈ+crv,--enable-crl-vfyβ enable leaf CRL verification β+cra,--enable-crl-allβ enable full chain CRL verification π§
π§Ό security profile π§Ό
+ph,--list-profilesβ list supported TLS profiles and exit π+pg,--profile-8996β BCP 195 RFC 8996 TLS Profile (default) π+pm,--profile-8996-modβ Modified BCP 195 RFC 8996 TLS Profile π οΈ+py,--profile-bcp195-ndβ Non-downgrading BCP 195 TLS Profile (retired) π΅+px,--profile-bcp195β BCP 195 TLS Profile (retired) π΅+pz,--profile-bcp195-exβ Extended BCP 195 TLS Profile (retired) π΅+pb,--profile-basicβ Basic TLS Secure Transport Connection Profile (retired) π΅+pa,--profile-aesβ AES TLS Secure Transport Connection Profile (retired) π΅+pn,--profile-nullβ Authenticated unencrypted communication (retired, was used in IHE ATNA) π΅
+pm,--profile-8996-modis only available if underlying TLS library supports all TLS features required for this profile π«Ά+pb,--profile-basicis only available if underlying TLS library supports 3DES π
π ciphersuite π
+cc,--list-ciphersβ list supported TLS ciphersuites and exit π+cs,--cipherβ add ciphersuite to list of negotiated suites; takes[c]iphersuite name: stringπ§©+dp,--dhparamβ read DH parameters for DH/DSS ciphersuites; takes[f]ilename: stringπ
π server name indication π
--no-sniβ do not use SNI (default) π ββοΈ--expect-sniβ expect requests for server name s; takes[s]erver name: stringπ
π² pseudo random generator π²
+rs,--seedβ seed random generator with contents of f; takes[f]ilename: stringπ±+ws,--write-seedβ write back modified seed (only with--seed) πΎ+wf,--write-seed-fileβ write modified seed to file f (only with--seed); takes[f]ilename: stringπ
π€ peer authentication π€
-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 π
π¦ output options π¦
π§Ύ general π§Ύ
-od,--output-directoryβ write received objects to existing directory d; takes[d]irectory: string, default"."π
πͺ subdirectory generation πͺ
-s,--no-subdirβ do not generate any subdirectories (default) π«+ssd,--series-date-subdirβ generate subdirectories from series date π
π·οΈ filename generation π·οΈ
+fd,--default-filenamesβ generate filename from instance UID (default) π+fu,--unique-filenamesβ generate unique filename based on new UID β¨+fsu,--short-unique-namesβ generate short pseudo-random unique filename π+fst,--system-time-namesβ generate filename from current system time β°-fe,--filename-extensionβ append e to all generated filenames; takes[e]xtension: string, default none π
πΎ storage mode πΎ
-B,--normalβ allow implicit format conversions (default) π’+B,--bit-preservingβ write dataset exactly as received π§¬--ignoreβ ignore dataset, receive but do not store it π«₯
π NOTES π
πΈ Typical Usage πΈ
A typical use case of dcmrecv is to receive SOP instances that are sent from a storage SCU and save them as DICOM files. The following command does exactly this:
dcmrecv --verbose <port> --config-file storescp.cfg default
If you prefer some automatically created subdirectory structure, shorter file names and the extension ".dcm" for all DICOM files, use the following command:
dcmrecv -v -xf storescp.cfg default <port> --series-date-subdir
--short-unique-names
--filename-extension .dcm
In case of very large SOP instances or if the dataset should be written exactly as received (e.g. for debugging purposes), the "bit preserving mode" could be used:
dcmrecv -v -xf storescp.cfg default <port> --bit-preserving
The received datasets are always stored as DICOM files with the same Transfer Syntax as used for the network transmission. periodt, bestie π
π¦ DICOM Conformance π¦
Basically, the dcmrecv application supports all Storage SOP Classes as an SCP, including private ones. This requires, however, that a corresponding association negotiation profile is loaded from a configuration file. The format and semantics of this configuration file are documented in asconfig.txt.
By default, that means if no association negotiation profile is loaded, dcmrecv only supports the Verification SOP Class as an SCP (with default transfer syntax, i.e. Implicit VR Little Endian).
In the future, there might be additional options that allow for specifying the list of supported Presentation Contexts (i.e. combination of SOP Class and Transfer Syntaxes) directly, i.e. without loading a configuration file. iykyk π
π Subdirectory Generation π
The option --series-date-subdir allows for generating subdirectories (below the specified output directory) based on the value of the data element Series Date (0008,0021) from the received DICOM dataset. If this value could be retrieved from the dataset and is valid (i.e. consists of a valid DICOM date field), the subdirectory structure is as follows:
<output-directory>/data/<year>/<month>/<day>/<filename>
If the Series Date (0008,0021) cannot be retrieved or is invalid, the current system date is used for the following subdirectory structure:
<output-directory>/undef/<year><month><day>/<filename>
In both cases, <year> consists of 4 decimal digits and <month> as well as <day> of 2 decimal digits. organized queen behavior π
β¨ Filename Generation β¨
By default, the filenames for storing the received DICOM datasets are generated according to the following scheme:
<short-modality-prefix>.<sop-instance-uid><filename-extension>
If the same SOP instance is received twice, a warning message is reported and the existing file is overwritten.
The option --unique-filenames makes sure that each received DICOM dataset is stored as a separate file, i.e. no files should ever be overwritten. This is done by using a newly created unique identifier (UID) for each generated filename (and the infix ".X" in order to avoid conflicts with real SOP Instance UID values). The naming scheme for this option is as follows:
<short-modality-prefix>.X.<unique-identifier><filename-extension>
When option --short-unique-names is used, the filenames are generated by some pseudo-random name generator, which also makes sure that there are no conflicts (i.e. existing files are not overwritten). This is the naming scheme:
<short-modality-prefix>_<pseudo-random-name><filename-extension>
With <pseudo-random-name> consisting of 16 digits in hexadecimal notation.
Finally, option --system-time-names allows for generating filenames based on the current system time:
<date><time>.<short-modality-prefix><filename-extension>
With <date> consisting of "<year><month><day>" and <time> of "<hour><minute><second>.<micro-second>". Please note that this scheme could result in naming conflicts if the resolution of the system time is not sufficiently high (i.e. does not support microseconds). tiny time-resolution drama π
π«Ά Limitations π«Ά
Please note that option --bit-preserving cannot be used together with option --series-date-subdir since the received dataset is stored directly to file and the value of the Series Date (0008,0021) is, therefore, not available before the file has been created. do not try to make them hold hands, they cannot π
π LOGGING π
The level of logging output of the various command line tools and underlying libraries can be specified by the user. By default, only errors and warnings are written to the standard error stream. Using option --verbose also informational messages like processing details are reported. Option --debug can be used to get more details on the internal activity, e.g. for debugging purposes. Other logging levels can be selected using option --log-level. In --quiet mode only fatal errors are reported. In such very severe error events, the application will usually terminate. For more details on the different logging levels, see documentation of module "oflog".
In case the logging output should be written to file (optionally with logfile rotation), to syslog (Unix) or the event log (Windows) option --log-config can be used. This configuration file also allows for directing only certain messages to a particular output stream and for filtering certain messages based on the module or application where they are generated. An example configuration file is provided in <etcdir>/logger.cfg. log girlies stay winning πΏ
π» 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 behavior 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 unless they appear between two quotation marks) prior to any further evaluation. Please note that a command file cannot contain another command file. This simple but effective approach allows one to summarize common combinations of options/parameters and avoids longish and confusing command lines (an example is provided in file <datadir>/dumppat.txt). command files are giving shortcut royalty π
πͺ EXIT CODES πͺ
The dcmrecv utility uses the following exit codes when terminating. This enables the user to check for the reason why the application terminated.
general
EXITCODE_NO_ERRORβ0EXITCODE_COMMANDLINE_SYNTAX_ERRORβ1
input file errors
EXITCODE_CANNOT_READ_INPUT_FILEβ20(*)
output file errors
EXITCODE_CANNOT_WRITE_OUTPUT_FILEβ40(*)EXITCODE_INVALID_OUTPUT_DIRECTORYβ45
network errors
EXITCODE_CANNOT_INITIALIZE_NETWORKβ60(*)EXITCODE_CANNOT_START_SCP_AND_LISTENβ64EXITCODE_INVALID_ASSOCIATION_CONFIGβ66EXITCODE_CANNOT_CREATE_TRANSPORT_LAYERβ71
(*) Actually, these codes are currently not used by dcmrecv but serve as a placeholder for the corresponding group of exit codes. placeholder codes said βnot my eraβ π
π ENVIRONMENT π
The dcmrecv 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 <datadir>/dicom.dic will be loaded unless the dictionary is built into the application (default for Windows).
The default behavior 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. On Windows systems, a semicolon (";") is used as a separator. 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. dictionary path bestie, respect her π
π FILES π
<docdir>/asconfig.txtβ configuration file documentation<etcdir>/storescp.cfgβ example association negotiation profile
π SEE ALSO π
dcmsend(1), storescu(1), storescp(1) β the whole friend group, fr fr π«Ά
Β©οΈ COPYRIGHT Β©οΈ
Copyright (C) 2013-2026 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
okay bestie, thatβs the whole iconic dcmrecv(1) page β Version 3.7.1, stamped Sat Oct 17 2026 09:34:01. slay and stay hydrated π
β¨π«Ά
π¦ where this page comes from
- arch rolling: dcmtk 3.7.1-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms