dcmsend(1)
π dcmsend(1) β OFFIS DCMTKβs simple DICOM storage SCU sender π
okay so bestie, welcome to dcmsend(1) from OFFIS DCMTK β the little DICOM sender that keeps things cute and simple π
β¨ NAME β¨
dcmsend β Simple DICOM storage SCU (sender), aka your friendly neighborhood file-shipper π
πΈ SYNOPSIS πΈ
dcmsend [options] peer port dcmfile-in...
π DESCRIPTION π
The dcmsend application is a Service Class User (SCU) for the Storage Service Class. And no cap, compared to the well-known storescu utility, dcmsend has fewer options and is therefore easier to use β thatβs literally why the title says βsimple.β Its main character purpose is to send a whole bunch of DICOM files to a Storage Service Class Provider (SCP). dcmsend supports both multiple associations (one after the other) and decompression of DICOM SOP instances if thatβs needed to transfer them. slay π
π«Ά PARAMETERS π«Ά
peerβ hostname of DICOM peer πportβ tcp/ip port number of peer πdcmfile-inβ DICOM file or directory to be transmitted π
π¦ OPTIONS π¦
π general options
-h,--helpβ print this help text and exit--versionβ print version information and exit--list-decodersβ list transfer syntaxes of decoders 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[l]evel: string constantβ(fatal, error, warn, info, debug, trace)use level l for the logger-lc,--log-config[f]ilename: stringβ use config file f for the logger+v,--verbose-pcβ show presentation contexts in verbose mode
πΎ input options
π input file format:
+f,--read-fileβ read file format or data set+fo,--read-file-onlyβ read file format only (default)-f,--read-datasetβ read data set without file meta information
π input files:
+rd,--read-from-dicomdirβ read information on input files from DICOMDIR+sd,--scan-directoriesβ scan directories for input files (dcmfile-in)+sp,--scan-pattern[p]attern: string(only with--scan-directories) β pattern for filename matching (wildcards)# possibly not available on all systems
-r,--no-recurseβ do not recurse within directories (default)+r,--recurseβ recurse within specified directories
βοΈ processing options
π transfer syntax conversion:
-dn,--decompress-neverβ never decompress compressed data sets+dls,--decompress-losslessβ only decompress lossless compression (default)+dly,--decompress-lossyβ decompress both lossy and lossless compression
ποΈ deflate compression level:
+cl,--compression-level[l]evel: integer (default: 6)β0=uncompressed, 1=fastest, 9=best compression
π§ other processing options:
-nh,--no-haltβ do not halt on first invalid input file or if unsuccessful store encountered-nip,--no-illegal-proposalβ do not propose any presentation context that does not contain the default transfer syntax (if needed)-nuc,--no-uid-checksβ do not check UID values of input files
π network options
π‘ IP protocol version:
-i4,--ipv4β use IPv4 only (default)-i6,--ipv6β use IPv6 only-i0,--ip-autoβ use DNS lookup to determine IP protocol
π·οΈ application entity titles:
-aet,--aetitle[a]etitle: stringβ set my calling AE title (default:DCMSEND)-aec,--call[a]etitle: stringβ set called AE title of peer (default:ANY-SCP)
π association handling:
+ma,--multi-associationsβ use multiple associations (one after the other) if needed to transfer the instances (default)-ma,--single-associationβ always use a single association
π°οΈ other network options:
-to,--timeout[s]econds: integer (default: unlimited)β timeout for connection requests-ta,--acse-timeout[s]econds: integer (default: 30)β timeout for ACSE messages-td,--dimse-timeout[s]econds: integer (default: unlimited)β timeout for DIMSE messages-pdu,--max-pdu[n]umber of bytes: integer (4096..131072)β set max receive pdu to n bytes (default: 16384)--max-send-pdu[n]umber of bytes: integer (4096..131072)β restrict max send pdu to n bytes
π output options
π general:
+crf,--create-report-file[f]ilename: stringβ create a detailed report on the transfer (if successful) and write it to text file f
π₯ NOTES π₯
π¬ Typical Usage
A typical use case of dcmsend is sending arbitrary SOP instances that are stored as DICOM files to a storage SCP. The following command does exactly this:
dcmsend --verbose <peer> <port> *.dcm
If the DICOM files are stored in a hierarchy of directories below the directory IMAGES, the following command can be used:
dcmsend -v <peer> <port> --scan-directories --recurse IMAGES
It is also possible to specify multiple directories and combine the aforementioned approaches (using both file and directory names):
dcmsend -v +sd +r <peer> <port> IMAGES_1 IMAGES_2 test.img *.dcm
If the SOP instances are referenced from a DICOMDIR file, option --read-from-dicomdir (or +rd) can be used to send all referenced DICOM files without loading them already for the association negotiation:
dcmsend -v <peer> <port> --read-from-dicomdir DICOMDIR
And again, all of the above approaches can be combined like this:
dcmsend -v +sd +r +rd <peer> <port> IMAGES_1 IMAGES_2 test.img DICOMDIR *.dcm
The default option --read-file-only makes sure that only DICOM files (i.e. the ones with meta-header and magic word "DICM" after the preamble) are processed. Usually, if processing a whole bunch of files, it is also a good idea not to halt on the first invalid input file or if an unsuccessful store was encountered. This can be accomplished by using option --no-halt. Please note, however, that βunsuccessful storeβ does not mean that the DIMSE status of the C-STORE response indicates an error. It means that the C-STORE request could not be sent to the storage SCP. π
If more than 128 Presentation Contexts are needed, which is the maximum number allowed according to the DICOM standard, a new association is started after the previous one has been completed. In cases where this behavior is unwanted, it can be disabled using option --single-association. In addition, whether only lossless compressed data sets are decompressed (if needed), which is the default, or also lossy compressed data sets can be specified using the --decompress-xxx options.
In order to get both an overview and detailed information on the transfer of the DICOM SOP instances, option --create-report-file can be used to create a corresponding text file. However, this file is only created as a final step if the application did not terminate before (with an error). π
π Scanning Directories
Adding directories as a parameter to the command line only makes sense if option --scan-directories is also given. If the files in the provided directories should be selected according to a specific name pattern (e.g. using wildcard matching), option --scan-pattern has to be used. Please note that this file pattern only applies to the files within the scanned directories, and, if any other patterns are specified on the command line outside the --scan-pattern option (e.g. in order to select further files), these do not apply to the specified directories.
Thus, the third of the above examples will recurse over directories IMAGES_1 and IMAGES_2 and transmit files that are contained in these two folders and all their subfolders (due to option +r). Additionally, dcmsend will transfer "test.img" and all files with extension "dcm" from the current working folder. Note that providing directory names without enabling option +sd does not make sense.
π§ DICOM Conformance
Basically, the dcmsend application supports all Storage SOP Classes as an SCU, including private ones. By default, the application checks the SOP Class UID of the DICOM file in order to make sure that only valid SOP instances are sent. With option --no-uid-checks this check can be disabled.
The dcmsend application also supports all Transfer Syntaxes that are defined in the DICOM standard. Private Transfer Syntaxes can only be used if the UID check is disabled with option --no-uid-checks. Please note, however, that only a limited number of Transfer Syntaxes are supported for converting them to the DICOM Default Transfer Syntax (Implicit VR Little Endian). With option --list-decoders the Transfer Syntaxes supported natively or by decoders are listed. The output typically looks like the following:
Transfer Syntaxes supported natively:
- Little Endian Implicit
- Little Endian Explicit
- Big Endian Explicit
Transfer Syntaxes supported by decoders:
- Deflated Explicit VR Little Endian
- JPEG Baseline
- JPEG Extended, Process 2+4
- JPEG Spectral Selection, Non-hierarchical, Process 6+8
- JPEG Full Progression, Non-hierarchical, Process 10+12
- JPEG Lossless, Non-hierarchical, Process 14
- JPEG Lossless, Non-hierarchical, 1st Order Prediction
- JPEG-LS Lossless
- JPEG-LS Lossy (Near-lossless)
- RLE Lossless
Since dcmsend tries to be as simple as possible for the user, by default Presentation Contexts might be proposed to the SCP that are strictly speaking βillegal.β This is because, according to the DICOM standard, the SCU always has to propose the DICOM Default Transfer Syntax in at least one Presentation Context associated with each abstract syntax (i.e. SOP class). This requirement is waived if the SCU only has access to the SOP instance in lossy compressed form or if the decompressed pixel data would be too large to be encoded. With option --no-illegal-proposal the strict DICOM-conformant behavior can be enforced, i.e. no possibly illegal Presentation Context will be proposed but the corresponding SOP instance will be rejected (if needed). Please note, however, that the size of the decompressed pixel data is not checked. π«Ά
The default Transfer Syntax for "Lossless JPEG Compression", "Lossy JPEGCompression" and so on are not always proposed as also required by the DICOM standard. The same limitation applies to other compression schemes. See DICOM PS 3.5 section 10 for details.
π LOGGING π
okay so bestie, you can literally choose how chatty the tools are π¬ 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 β so it's giving "quietly judging you" energy, not "spilling everything" energy.
--verboseβ turns the volume up so informational messages like processing details get reported too π--debugβ for when you really need the tea β more details on the internal activity, e.g. for debugging purposes- other logging levels can be selected using
--log-levelβ pick your vibe β¨ --quietmode β only fatal errors are reported. and bestie, in such very severe error events, the application will usually terminate π like, it's not mad, it's just done
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 is your girl π«Ά 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 β go look, it's right there π
π₯οΈ COMMAND LINE π₯οΈ
All command line tools use the following notation for parameters, so let's decode the lore π
- square brackets enclose optional values (0-1) β like
[maybe]π¦ - three trailing dots indicate that multiple values are allowed (1-n) β
stuff...π - a combination of both means 0 to n values β
[stuff...]β¨
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) β main character energy, they show up whenever π
However, if options are mutually exclusive the rightmost appearance is used. This behavior conforms to the standard evaluation rules of common Unix shells. no cap, that's just how it works π€·ββοΈ
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 β no inception, bestie π«π 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). literally the "save your fave combo" feature π
π¦ EXIT CODES π¦
The dcmsend utility uses the following exit codes when terminating. This enables the user to check for the reason why the application terminated β like a little receipt for what just happened π§Ύπ
general
EXITCODE_NO_ERRORβ0πEXITCODE_COMMANDLINE_SYNTAX_ERRORβ1π
input file errors
EXITCODE_CANNOT_READ_INPUT_FILEβ20(*)EXITCODE_NO_INPUT_FILESβ21EXITCODE_INVALID_INPUT_FILEβ22EXITCODE_NO_VALID_INPUT_FILESβ23
output file errors
EXITCODE_CANNOT_WRITE_OUTPUT_FILEβ40(*)EXITCODE_CANNOT_WRITE_REPORT_FILEβ43
network errors
EXITCODE_CANNOT_INITIALIZE_NETWORKβ60EXITCODE_CANNOT_NEGOTIATE_ASSOCIATIONβ61EXITCODE_CANNOT_SEND_REQUESTβ62EXITCODE_CANNOT_ADD_PRESENTATION_CONTEXTβ65
π«Ά quick heads-up: (*) Actually, these codes are currently not used by dcmsend but serve as a placeholder for the corresponding group of exit codes. so like, they're reserved seats at the table reserved for the whole friend group, iykyk π
π§ ENVIRONMENT π§
The dcmsend 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 β like, don't fix what isn't broken, bestie π
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 πβ οΈ
π SEE ALSO π
the whole friend group, fr fr π«Άπ
Β© COPYRIGHT Β©
Copyright (C) 2011-2026 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany. π
and that's the whole page bestie, you're literally a dcmsend expert now πβ¨
Version 3.7.1 πΈ Sat Oct 17 2026 09:34:01 π¦ β slay, go send some DICOM files, ily, bye! π π
π¦ 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