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 ✨
  • --quiet mode β€” 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 β€” 21
  • EXITCODE_INVALID_INPUT_FILE β€” 22
  • EXITCODE_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 β€” 60
  • EXITCODE_CANNOT_NEGOTIATE_ASSOCIATION β€” 61
  • EXITCODE_CANNOT_SEND_REQUEST β€” 62
  • EXITCODE_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 (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