dcmdecap(1)
π dcmdecap(1) β OFFIS DCMTK girlies rise π
okay so bestie, this is a page straight out of the OFFIS DCMTK manual set, and honestly? it's a little baddie. it takes a DICOM file that's got a whole document stuffed inside it and justβ¦ yoinks it out. no cap. let's get into it π«Ά
β¨ NAME β¨
dcmdecap β the icon that extracts an encapsulated file from a DICOM encapsulated storage object. literally her whole job π
β¨ SYNOPSIS β¨
dcmdecap [options] dcmfile-in encfile-out
β¨ DESCRIPTION β¨
so dcmdecap reads a DICOM file from one of the Encapsulated Storage SOP Classes (dcmfile-in), pulls out the embedded document, and writes it to an output file (encfile-out). and if you're feeling extra? you can optionally execute a command after the output file gets created. main character energy fr π₯
β¨ PARAMETERS β¨
dcmfile-inβ the DICOM input filename (use-for stdin, she's flexible like that πΈ)encfile-outβ the encapsulated document output filename (use-for stdout, we love a pipe moment β¨)
β¨ OPTIONS β¨
π general options
-h,--helpβ print this help text and exit. the classic "wait what does this do again" move π--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. she's telling you EVERYTHING π-d,--debugβ debug mode, print debug information-ll,--log-levelβ[l]evel: string constantβ the levels arefatal,error,warn,info,debug,trace. use level l for the logger-lc,--log-configβ[f]ilename: stringβ use config file f for the logger
π¦ input options
input file format:
+f,--read-fileβ read file format or data set (default) β+fo,--read-file-onlyβ read file format only-f,--read-datasetβ read data set without file meta information
input transfer syntax:
-t=,--read-xfer-autoβ use TS recognition (default) β-td,--read-xfer-detectβ ignore TS specified in the file meta header-te,--read-xfer-littleβ read with explicit VR little endian TS-tb,--read-xfer-bigβ read with explicit VR big endian TS-ti,--read-xfer-implicitβ read with implicit VR little endian TS
parsing of odd-length attributes:
+ao,--accept-odd-lengthβ accept odd length attributes (default) β+ae,--assume-even-lengthβ assume real length is one byte larger
handling of undefined length UN elements:
+ui,--enable-cp246β read undefined len UN as implicit VR (default) β-ui,--disable-cp246β read undefined len UN as explicit VR
handling of defined length UN elements:
-uc,--retain-unβ retain elements as UN (default) β+uc,--convert-unβ convert to real VR if known
automatic data correction:
+dc,--enable-correctionβ enable automatic data correction (default) β-dc,--disable-correctionβ disable automatic data correction
bitstream format of deflated input:
+bd,--bitstream-deflatedβ expect deflated bitstream (default) β+bz,--bitstream-zlibβ expect deflated zlib bitstream
π processing options
execution options:
-x,--execβ[c]ommand: stringβ execute command c after document extraction π₯
β¨ NOTES β¨
okay so listen π β option --exec lets you run a certain command line after the PDF document gets created. you pass the command line to this option as a parameter. the command line you specify may contain the placeholder #f, and that placeholder gets replaced by the output filename at run time. and here's the thing: the specified command line runs in the foreground, meaning dcmdecap will be blocked until the command terminates. like, she's waiting at the door for you. no cap π
β¨ LOGGING β¨
the level of logging output of the various command line tools and underlying libraries? you, bestie, get to choose it π
by default, only errors and warnings are written to the standard error stream. using option --verbose also reports informational messages like processing details. option --debug gets you 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 β and 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. slay π
β¨ EXIT CODES β¨
dcmdecap uses the following exit codes when terminating. this lets you check why the application terminated β very "receipts" of her πΈ
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
output file errors
EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40
processing errors
EXITCODE_EXEC_FAILED 91
β¨ 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), and a combination of both means 0 to n values. iykyk π§
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. periodt.
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). it's giving organized π
β¨ ENVIRONMENT β¨
dcmdecap 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 π
β¨ SEE ALSO β¨
dcmencap(1) β her sibling, the one who puts stuff IN π¦
β¨ COPYRIGHT β¨
Copyright (C) 2007-2026 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
okay that's the whole page bestie, you ate π
and for the sign-off: this iconic little manual for dcmdecap(1) is Version 3.7.1, dated Sat Oct 17 2026 09:34:01 β go forth and decapsulate, queen ππ
π¦ 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